From mboxrd@z Thu Jan 1 00:00:00 1970 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 4F7A2216A3D; Thu, 7 Nov 2024 17:20:45 +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=1731000046; cv=none; b=KL9YtFCH28bzxEf2osqHXgYgeJnEz0G7dL/+51SWnjahq9Sah9GLbHDLRPsB0AuMcGS3dOJL2Zjp5KlHTPSBjicy/PG3+4VTcvpqETK+Pp8Ep+vxIQq8juLvCTjPG2Ycdpctzo+EpJyJUC0kstoFKTraBcyXMLC6v8CJkGsng1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731000046; c=relaxed/simple; bh=cADn4ARQkTOhflqlIHhNxtca9L54H5LHvOrTgQwQP8c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=UT2Tkse7N2/fMJXyzMZIfnDM/7LJFyO7c7WniqZH1xaXzCEvDeIWJWld3fJitl5CFCJdLF70brs2TYA+H3VB8UNRSe8IRlXXUIXhdEBdE53bXbGCBvNpZRTHsyK7h91XXAxh6+mWNmWBGDe5B124QKO9/FcA0BIzjkj0SktJdWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uirXLcMy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uirXLcMy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8DA9C4CECC; Thu, 7 Nov 2024 17:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731000045; bh=cADn4ARQkTOhflqlIHhNxtca9L54H5LHvOrTgQwQP8c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=uirXLcMy1Qn//p7lSBnbOlzSbCL5aIT0TqEnGpIZm6Rx23BQJKj1JIwJAP4R6CQ3Y BGW5ysKmLw5HxKe9TW2Kb0/MrhrtH+FEMuRdl+3jaHMQQkHCavjZQ9xWr31Ghy5ARf J2TiGOLT8c6IMr+E/gnELx0660oj7VCoNS9utcB0Gb41g2oymp/+1G/7KVgOzIPwxq q5/0lzC969ZrJFg9aKvlY1ckSKQVQp4pt0o8irIOJAq56q9MDR85uEDv3iCGEqltvk QeOfANjQFk8pt3o4hyDqn3DINTzEn9s+ZnpBLM2/xaYcEN2lpP63yM+3MX3zh3CiMr Amp7lQpjSOJ2g== From: Pratyush Yadav To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Bjorn Helgaas , Srinivas Kandagatla , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Alex Deucher , Christian =?utf-8?Q?K=C3=B6nig?= , Xinhui Pan , David Airlie , Simona Vetter , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky , Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Naveen Krishna Chatradhi , Carlos Bilbao , Hans de Goede , Ilpo =?utf-8?Q?J=C3=A4rvinen?= , "David E. Box" , "James E.J. Bottomley" , "Martin K. Petersen" , Richard Henderson , Matt Turner , Frederic Barrat , Andrew Donnellan , Arnd Bergmann , Logan Gunthorpe , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Dan Williams , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-cxl@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-mtd@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-hyperv@vger.kernel.org Subject: Re: [PATCH v2 05/10] sysfs: treewide: constify attribute callback of bin_is_visible() In-Reply-To: <20241103-sysfs-const-bin_attr-v2-5-71110628844c@weissschuh.net> ("Thomas =?utf-8?Q?Wei=C3=9Fschuh=22's?= message of "Sun, 03 Nov 2024 17:03:34 +0000") References: <20241103-sysfs-const-bin_attr-v2-0-71110628844c@weissschuh.net> <20241103-sysfs-const-bin_attr-v2-5-71110628844c@weissschuh.net> Date: Thu, 07 Nov 2024 17:20:37 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sun, Nov 03 2024, Thomas Wei=C3=9Fschuh wrote: > The is_bin_visible() callbacks should not modify the struct > bin_attribute passed as argument. > Enforce this by marking the argument as const. > > As there are not many callback implementers perform this change > throughout the tree at once. > > Signed-off-by: Thomas Wei=C3=9Fschuh > --- > diff --git a/drivers/mtd/spi-nor/sysfs.c b/drivers/mtd/spi-nor/sysfs.c > index 96064e4babf01f6950c81586764386e7671cbf97..5e9eb268073d18e0a46089000= f18a3200b4bf13d 100644 > --- a/drivers/mtd/spi-nor/sysfs.c > +++ b/drivers/mtd/spi-nor/sysfs.c > @@ -87,7 +87,7 @@ static umode_t spi_nor_sysfs_is_visible(struct kobject = *kobj, > } >=20=20 > static umode_t spi_nor_sysfs_is_bin_visible(struct kobject *kobj, > - struct bin_attribute *attr, int n) > + const struct bin_attribute *attr, int n) Acked-by: Pratyush Yadav # for spi-nor > { > struct spi_device *spi =3D to_spi_device(kobj_to_dev(kobj)); > struct spi_mem *spimem =3D spi_get_drvdata(spi); --=20 Regards, Pratyush Yadav