From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59DD0D132C1 for ; Mon, 4 Nov 2024 13:25:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D795510E099; Mon, 4 Nov 2024 13:25:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Jif+i2k/"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4CA4410E099; Mon, 4 Nov 2024 13:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730726735; x=1762262735; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=oPBklUbvKL8bSKRIlaEBq6Ena9N6JHRIUOBA6mqrZ6c=; b=Jif+i2k/l9lbswCm6DKlyr3T5DdWf21LvQyqiVoCWMYVQAZUHvXvWGBr wyodBuh/2xpWgJBYb9CEV30q1MgwNw2kiRxwNbxrVHyEsxq7a576SXaoi B1Ww6EvXpsbRZUiFFpsL77K3Lt5oCL01ajyHt48RHYYW+TMFUZM75lUWm XvWNcX50LfYY/QxyrxUX8VFmWNXgRE3HdanipBgYqJQ6S5x2BOHsN0L+X a5UVhZaP5Mis+la5vsifXtpwxZGAky7XsGVjO8oq4+bNJ8/OK7NJysbiu E/Gr6KSZnAmgPNE1CZNwnPuAIgQiLGLGbn25WOsUulFStxqW0vJ3gweCC w==; X-CSE-ConnectionGUID: HpohJav/TLGVXmbYR6AL5Q== X-CSE-MsgGUID: b6PPmcFDR2+anR3ZZM+lSg== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30275401" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30275401" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 05:25:33 -0800 X-CSE-ConnectionGUID: v9JmlMoUQFaNhWF7H45gGQ== X-CSE-MsgGUID: 4K1oV5FuTuelLKT3nBONXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,257,1725346800"; d="scan'208";a="83542204" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.33]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 05:25:17 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Mon, 4 Nov 2024 15:25:13 +0200 (EET) To: =?ISO-8859-15?Q?Thomas_Wei=DFschuh?= 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 , =?ISO-8859-15?Q?Christian_K=F6nig?= , 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 , =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= , "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 , LKML , 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> Message-ID: <65f4dc4e-3b48-2baa-a13b-3cc34dd51ce1@linux.intel.com> References: <20241103-sysfs-const-bin_attr-v2-0-71110628844c@weissschuh.net> <20241103-sysfs-const-bin_attr-v2-5-71110628844c@weissschuh.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323328-559502379-1730726713=:989" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-559502379-1730726713=:989 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 3 Nov 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. >=20 > As there are not many callback implementers perform this change > throughout the tree at once. >=20 > Signed-off-by: Thomas Wei=C3=9Fschuh > --- > drivers/cxl/port.c | 2 +- > drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- > drivers/infiniband/hw/qib/qib_sysfs.c | 2 +- > drivers/mtd/spi-nor/sysfs.c | 2 +- > drivers/nvmem/core.c | 3 ++- > drivers/pci/pci-sysfs.c | 2 +- > drivers/pci/vpd.c | 2 +- > drivers/platform/x86/amd/hsmp.c | 2 +- > drivers/platform/x86/intel/sdsi.c | 2 +- > drivers/scsi/scsi_sysfs.c | 2 +- > drivers/usb/core/sysfs.c | 2 +- > include/linux/sysfs.h | 30 +++++++++++++++------------= --- > 12 files changed, 27 insertions(+), 26 deletions(-) > diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/h= smp.c > index 8fcf38eed7f00ee01aade6e3e55e20402458d5aa..8f00850c139fa8d419bc1c140= c1832bf84b2c3bd 100644 > --- a/drivers/platform/x86/amd/hsmp.c > +++ b/drivers/platform/x86/amd/hsmp.c > @@ -620,7 +620,7 @@ static int hsmp_get_tbl_dram_base(u16 sock_ind) > } > =20 > static umode_t hsmp_is_sock_attr_visible(struct kobject *kobj, > -=09=09=09=09=09 struct bin_attribute *battr, int id) > +=09=09=09=09=09 const struct bin_attribute *battr, int id) Hi Thomas, This driver is reworked in pdx86/for-next. --=20 i. > { > =09if (plat_dev.proto_ver =3D=3D HSMP_PROTO_VER6) > =09=09return battr->attr.mode; > diff --git a/drivers/platform/x86/intel/sdsi.c b/drivers/platform/x86/int= el/sdsi.c > index 9d137621f0e6e7a23be0e0bbc6175c51c403169f..33f33b1070fdc949c1373251c= 3bca4234d9da119 100644 > --- a/drivers/platform/x86/intel/sdsi.c > +++ b/drivers/platform/x86/intel/sdsi.c > @@ -541,7 +541,7 @@ static struct bin_attribute *sdsi_bin_attrs[] =3D { > }; > =20 > static umode_t > -sdsi_battr_is_visible(struct kobject *kobj, struct bin_attribute *attr, = int n) > +sdsi_battr_is_visible(struct kobject *kobj, const struct bin_attribute *= attr, int n) > { > =09struct device *dev =3D kobj_to_dev(kobj); > =09struct sdsi_priv *priv =3D dev_get_drvdata(dev); --8323328-559502379-1730726713=:989--