From patchwork Wed Dec 20 07:41:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181514 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2476229dyi; Tue, 19 Dec 2023 23:41:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYp2cm8ToptScMxeE5/uPisaZaRh3PdFgqkXg3S89F/Y91X5lCnvNUZJy+pWSCY0MuiDRK X-Received: by 2002:a17:906:282:b0:a23:5530:f340 with SMTP id 2-20020a170906028200b00a235530f340mr2168709ejf.52.1703058104236; Tue, 19 Dec 2023 23:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703058104; cv=none; d=google.com; s=arc-20160816; b=nCgLoG4to5kiVBu8IjlWss0Eox5EhYEs97cEmecpj7sHpA6Is51tvcWCmgErnlc+tC v6yP8vN9pXEX1/zrk5yaZqUq2zgWVWtEfGl6ygnq+kNtf4yHi9oXYOclAHaRQUI0IPZz KJwWgVe8VzwG59ocNmMeu2JRNgF5NQIayQIoF6kDr27/DNWZqjBFtlVNPigahnD3OJ6E OX5/igQtICWaeXi2fnTplL7gJYyBC0McPhFsob7bdspeFSR8Q8NplCjnGcyvrRF27bFG YWmWiZK4oqgZTY835Gsm/wZm6boWHXN1K8PbF3ki0IPNsf/aJKf1UCXpFjXkpAaX3y9X 72bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=QCOJnkZjUkE87QdKKF68QQahJpd7xYRKqdi0itk2bxA=; fh=/adRXC/d41c7LGu4ZJAqEUfkvz/r8bnYDyWv28BobcI=; b=WT00y6Zxuy7C6ZKmZ/BjSURGW5JMlwuTWeXwFsrt0elms8L9nrjWVPGefNRZvXKALb LS+3nrE0BKCVtdoAY6hdruRO4eDg09WUvp2vDEbMvMp0v02S3Ldien1XCqVJuP5JHB3b nKokz7D1WcAUrA/ZFxxiL/YN5KTgYc0YQOpAp3X4OgDbRGnM0KaxzD2y3w7y//UUfMfL MM9U89svso75X2eQgSxpgb6B6UX1q5xgYO/+9VuG5CXj26nbgvadbjPaRb1jf/VwbK7E smun9RML2WfJhyr0P5u85wqglNe00j7RWsoxaIRMqT5BqHfCUrjVk2HYmQBleiEAcejJ dFcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C1PRSMih; spf=pass (google.com: domain of linux-kernel+bounces-6508-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6508-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ks25-20020a170906f85900b00a234681b215si2932022ejb.340.2023.12.19.23.41.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 23:41:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6508-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C1PRSMih; spf=pass (google.com: domain of linux-kernel+bounces-6508-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6508-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D48141F21935 for ; Wed, 20 Dec 2023 07:41:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C80EA1A59E; Wed, 20 Dec 2023 07:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C1PRSMih" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07606168CF; Wed, 20 Dec 2023 07:41:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BBE5C433C9; Wed, 20 Dec 2023 07:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1703058083; bh=eicNkkHSvbTuvKDaD0uy33eDZQ21rFcTjG+07eDtb24=; h=From:To:Cc:Subject:Date:From; b=C1PRSMihdU16ZQCKm3Os+pG4tQUmTaCzgOgApklcMglhb2QBLv1qzrSihzFFlLRFD Z0sJtaxJQHMHTLrHFvVEvm72DtefS/fO8R1Xdrk07PRQ9fCcGfYMpZ4P1PoBEpvF0P x/uUI8jCks/Cs1g/lwsznRtF/OL0Ev7qKbGFBXA8= From: Greg Kroah-Hartman To: wintera@linux.ibm.com, wenjia@linux.ibm.com Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-s390@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2] iucv: make iucv_bus const Date: Wed, 20 Dec 2023 08:41:18 +0100 Message-ID: <2023122017-shelf-cadet-309c@gregkh> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lines: 58 X-Developer-Signature: v=1; a=openpgp-sha256; l=1878; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=eicNkkHSvbTuvKDaD0uy33eDZQ21rFcTjG+07eDtb24=; b=owGbwMvMwCRo6H6F97bub03G02pJDKlNs+YKRC5Sdahf1nZgq3vOe3uvU7ne7ksnn4/Zers4T K/f9PrljlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIgy0M88Nidga+3sl0acWR dx6zhDbH3xaz9mRYcOpe7JuZy3encuQxL3voL83qdvrrXgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785785854553196953 X-GMAIL-MSGID: 1785785854553196953 Now that the driver core can properly handle constant struct bus_type, move the iucv_bus variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Wenjia Zhang Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-s390@vger.kernel.org Cc: netdev@vger.kernel.org Acked-by: Alexandra Winter Signed-off-by: Greg Kroah-Hartman --- v2: add Alexandra ack fix typo in subject line as pointed out by Niklas include/net/iucv/iucv.h | 4 ++-- net/iucv/iucv.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h index f9e88401d7da..8b2055d64a6b 100644 --- a/include/net/iucv/iucv.h +++ b/include/net/iucv/iucv.h @@ -80,7 +80,7 @@ struct iucv_array { u32 length; } __attribute__ ((aligned (8))); -extern struct bus_type iucv_bus; +extern const struct bus_type iucv_bus; extern struct device *iucv_root; /* @@ -489,7 +489,7 @@ struct iucv_interface { int (*path_sever)(struct iucv_path *path, u8 userdata[16]); int (*iucv_register)(struct iucv_handler *handler, int smp); void (*iucv_unregister)(struct iucv_handler *handler, int smp); - struct bus_type *bus; + const struct bus_type *bus; struct device *root; }; diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 0ed6e34d6edd..6334f64f04d5 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -67,7 +67,7 @@ static int iucv_bus_match(struct device *dev, struct device_driver *drv) return 0; } -struct bus_type iucv_bus = { +const struct bus_type iucv_bus = { .name = "iucv", .match = iucv_bus_match, };