lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65f4dc4e-3b48-2baa-a13b-3cc34dd51ce1@linux.intel.com>
Date: Mon, 4 Nov 2024 15:25:13 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Thomas Weißschuh <linux@...ssschuh.net>
cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
    "Rafael J. Wysocki" <rafael@...nel.org>, 
    Bjorn Helgaas <bhelgaas@...gle.com>, 
    Srinivas Kandagatla <srinivas.kandagatla@...aro.org>, 
    Davidlohr Bueso <dave@...olabs.net>, 
    Jonathan Cameron <jonathan.cameron@...wei.com>, 
    Dave Jiang <dave.jiang@...el.com>, 
    Alison Schofield <alison.schofield@...el.com>, 
    Vishal Verma <vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, 
    Alex Deucher <alexander.deucher@....com>, 
    Christian König <christian.koenig@....com>, 
    Xinhui Pan <Xinhui.Pan@....com>, David Airlie <airlied@...il.com>, 
    Simona Vetter <simona@...ll.ch>, 
    Dennis Dalessandro <dennis.dalessandro@...nelisnetworks.com>, 
    Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>, 
    Tudor Ambarus <tudor.ambarus@...aro.org>, 
    Pratyush Yadav <pratyush@...nel.org>, Michael Walle <mwalle@...nel.org>, 
    Miquel Raynal <miquel.raynal@...tlin.com>, 
    Richard Weinberger <richard@....at>, Vignesh Raghavendra <vigneshr@...com>, 
    Naveen Krishna Chatradhi <naveenkrishna.chatradhi@....com>, 
    Carlos Bilbao <carlos.bilbao.osdev@...il.com>, 
    Hans de Goede <hdegoede@...hat.com>, 
    Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>, 
    "David E. Box" <david.e.box@...ux.intel.com>, 
    "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>, 
    "Martin K. Petersen" <martin.petersen@...cle.com>, 
    Richard Henderson <richard.henderson@...aro.org>, 
    Matt Turner <mattst88@...il.com>, Frederic Barrat <fbarrat@...ux.ibm.com>, 
    Andrew Donnellan <ajd@...ux.ibm.com>, Arnd Bergmann <arnd@...db.de>, 
    Logan Gunthorpe <logang@...tatee.com>, 
    "K. Y. Srinivasan" <kys@...rosoft.com>, 
    Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>, 
    Dexuan Cui <decui@...rosoft.com>, Dan Williams <dan.j.williams@...el.com>, 
    LKML <linux-kernel@...r.kernel.org>, linux-pci@...r.kernel.org, 
    linux-cxl@...r.kernel.org, amd-gfx@...ts.freedesktop.org, 
    dri-devel@...ts.freedesktop.org, linux-rdma@...r.kernel.org, 
    linux-mtd@...ts.infradead.org, platform-driver-x86@...r.kernel.org, 
    linux-scsi@...r.kernel.org, linux-usb@...r.kernel.org, 
    linux-alpha@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org, 
    linux-hyperv@...r.kernel.org
Subject: Re: [PATCH v2 05/10] sysfs: treewide: constify attribute callback
 of bin_is_visible()

On Sun, 3 Nov 2024, Thomas Weißschuh 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ßschuh <linux@...ssschuh.net>
> ---
>  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/hsmp.c
> index 8fcf38eed7f00ee01aade6e3e55e20402458d5aa..8f00850c139fa8d419bc1c140c1832bf84b2c3bd 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)
>  }
>  
>  static umode_t hsmp_is_sock_attr_visible(struct kobject *kobj,
> -					 struct bin_attribute *battr, int id)
> +					 const struct bin_attribute *battr, int id)

Hi Thomas,

This driver is reworked in pdx86/for-next.

-- 
 i.


>  {
>  	if (plat_dev.proto_ver == HSMP_PROTO_VER6)
>  		return battr->attr.mode;
> diff --git a/drivers/platform/x86/intel/sdsi.c b/drivers/platform/x86/intel/sdsi.c
> index 9d137621f0e6e7a23be0e0bbc6175c51c403169f..33f33b1070fdc949c1373251c3bca4234d9da119 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[] = {
>  };
>  
>  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)
>  {
>  	struct device *dev = kobj_to_dev(kobj);
>  	struct sdsi_priv *priv = dev_get_drvdata(dev);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ