Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2376369rdb; Mon, 12 Feb 2024 02:51:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUNnL2CCpn/Z/Dqtn6pkOtDsaOZzqHtudSn3fU9PBzla1lBdF5qufJgeZqJ93cD2dzQ1NWrlcZOoMYYJfHrd3LkYc4llRWyYU/eNcFHPw== X-Google-Smtp-Source: AGHT+IH/V3ZPfMZO0srg0PXngrj39bLoxUVMfO9XaUWv1iv6LMUV05N188sK3mD3DZVxC9LYrr7v X-Received: by 2002:a05:6a21:3115:b0:19c:a16d:ca79 with SMTP id yz21-20020a056a21311500b0019ca16dca79mr10057119pzb.15.1707735111393; Mon, 12 Feb 2024 02:51:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707735111; cv=pass; d=google.com; s=arc-20160816; b=A8qBo3vIMRJH5gymFJaU47fzGHdL0ZQIANNj9OpGxaTCNBDF96880mpxx1KiKNHXHm 39+iW5GRPmg2rLbibtuAMFOsRu+EOVNt2CWiaFdsiA8prR4GllSCc3Ka5nCdcOhj/JFm 1seFLwAm4E4u4lDPVnxSpl8EqJbq5lPAX1SvDRkVYwfRfmsW3o/B/oHp/UnQGyp7Buzj hkBNuYl/aWymKAgd07/PHI63fL3oeG4/qU3PDr26Cv+VZPdQMxhxj8BOTr3C7+Jbou7U RrgYAjjh1LiKQEhoG0EiuAVhUYygT/BQqLCdL0MleaFExyvFCTZKZdRSLvQRNDch4NB6 QT7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Gv+EQ3P3pOP11+9rwM6t7wY536i7v1zi0x1hsVDYsRo=; fh=xgliWPTuTsyizPyY6o2OS6Ftd2VT6NFkaA3CdMZOSPI=; b=T6kmMLa4df+vy/urWoi1VAmVNF57oa6gOPJ6lvpgHTHHfc1XrcBMubgIAAJF6IKTZv ZVn0/Vmces4pKwky3apxp5fyDcrXjROggj3L6GobKeiec0dYdt1JDo1edEmkYLDWRaqP gqktUhNkYlKAFzD81zMgYRvsTK7Znt2Xt+JTnFIrzJyqskV2ZZIE274X9EZPKZzRqWkq 6hVDJAwAe4gREX3dolvMCfpNWOR4/+pYx6YI72pE68Ccjz5lujUbTFDh80RIWA4kutb0 jwFBomp+CnYJ4BKzxHnCXoJtx22+Nh10UgJvXOPoWWEJe10GmrO+u/TVACBw/UvQoto3 DCug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iBtSIAV5; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-61367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org X-Forwarded-Encrypted: i=2; AJvYcCWOAzs52dbzoqpCe/M0vRS3G2/h+Cx7BfaIpOei1vCKOnJ3AnMMZpoy5vK1SP/QlqyO1oRWwsj5PQ47phvcfjJ+4atBb/lzMUYhxzS54g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id cm3-20020a17090afa0300b00296623d582csi99138pjb.166.2024.02.12.02.51.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:51:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iBtSIAV5; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-61367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61367-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 657952871BB for ; Mon, 12 Feb 2024 10:51:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4DB23DB9A; Mon, 12 Feb 2024 10:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="iBtSIAV5" 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 072BF3D982; Mon, 12 Feb 2024 10:45:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707734735; cv=none; b=QG+aznbSodIDf2rLeFNxpOYNHYO8BrZFpfHLmCa9sT/C4aMeK5uGWRygGcjLx24g/qcD/F36gMMCHZrrEZZm/+8CZxXgo5xqvZVBjKkzqNeWbLBeSbbV7hMqzplrFidk9rhjLnbd3rK+qoo0IIALdT84fFLBI63DQHGgxnttCb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707734735; c=relaxed/simple; bh=HUQxRkObB8KLWprInhiPsP+17A+Mx8/GE9g+cdXpzvg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ppwYIL0m/PjI/EO80SROiO315RwzeQvUQWOryC1x5qvFBenrUpxXk+ZsgyudH7dioUVJbpcweWfc/StqV4F9PI4u3oL2dX2iq9mtn3KCcI7k0/3as9jbFCOyUVhxnc2UzY1emsR0HwqbWgFYpcyx1HBRO60NSZbxJx2trD0W7hE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iBtSIAV5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0352FC433C7; Mon, 12 Feb 2024 10:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1707734734; bh=HUQxRkObB8KLWprInhiPsP+17A+Mx8/GE9g+cdXpzvg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iBtSIAV5aWhVrqbG6Oy91hGLsTz70IXHub4zo5xDQwHvnU3fqS2SE2E52IFqTh1sg gb4dM/X/viM1vZ533KdpZWj7S6wqImX0ErXMOJcnKCCv/4S7KVS+g0G9vdttJkPDTb OPclPgonJvPdYpAfje0VVNXdu58Fl8r3rXDh95gg= Date: Mon, 12 Feb 2024 11:45:31 +0100 From: Greg Kroah-Hartman To: "Ricardo B. Marliere" Cc: "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: Make scsi_bus_type const Message-ID: <2024021246-canon-planner-2bf6@gregkh> References: <20240211-bus_cleanup-scsi2-v1-1-dd04ee82e6b0@marliere.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240211-bus_cleanup-scsi2-v1-1-dd04ee82e6b0@marliere.net> On Sun, Feb 11, 2024 at 12:33:50PM -0300, Ricardo B. Marliere wrote: > Now that the driver core can properly handle constant struct bus_type, > move the scsi_bus_type variable to be a constant structure as well, > placing it into read-only memory which can not be modified at runtime. > > Remove some extraneous whitespace. > > Cc: Greg Kroah-Hartman > Suggested-by: Greg Kroah-Hartman > Signed-off-by: Ricardo B. Marliere > --- > drivers/scsi/scsi_priv.h | 6 +++--- > drivers/scsi/scsi_sysfs.c | 6 +++--- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h > index 1fbfe1b52c9f..6a02114776b3 100644 > --- a/drivers/scsi/scsi_priv.h > +++ b/drivers/scsi/scsi_priv.h > @@ -54,7 +54,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd); > void scsi_log_send(struct scsi_cmnd *cmd); > void scsi_log_completion(struct scsi_cmnd *cmd, int disposition); > #else > -static inline void scsi_log_send(struct scsi_cmnd *cmd) > +static inline void scsi_log_send(struct scsi_cmnd *cmd) Why is this line changed? > { }; > static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) > { }; > @@ -156,7 +156,7 @@ extern void scsi_sysfs_device_initialize(struct scsi_device *); > extern struct scsi_transport_template blank_transport_template; > extern void __scsi_remove_device(struct scsi_device *); > > -extern struct bus_type scsi_bus_type; > +extern const struct bus_type scsi_bus_type; > extern const struct attribute_group *scsi_shost_groups[]; > > /* scsi_netlink.c */ > @@ -197,7 +197,7 @@ struct bsg_device *scsi_bsg_register_queue(struct scsi_device *sdev); > > extern int scsi_device_max_queue_depth(struct scsi_device *sdev); > > -/* > +/* And this? > * internal scsi timeout functions: for use by mid-layer and transport > * classes. > */ > diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c > index 24f6eefb6803..7f1fede8ef5d 100644 > --- a/drivers/scsi/scsi_sysfs.c > +++ b/drivers/scsi/scsi_sysfs.c > @@ -549,7 +549,7 @@ static int scsi_bus_uevent(const struct device *dev, struct kobj_uevent_env *env > return 0; > } > > -struct bus_type scsi_bus_type = { > +const struct bus_type scsi_bus_type = { > .name = "scsi", > .match = scsi_bus_match, > .uevent = scsi_bus_uevent, > @@ -656,7 +656,7 @@ static int scsi_sdev_check_buf_bit(const char *buf) > return 1; > else if (buf[0] == '0') > return 0; > - else > + else And this, please be more careful, it looks like your editor stripped out all trailing whitespace, which is fine for new files, but not for existing ones. thanks, greg k-h