lkml.org 
[lkml]   [2024]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 2/7] scsi: libsas: Define NCQ Priority sysfs attributes for SATA devices
From
On 05/03/2024 00:50, Igor Pylypiv wrote:
>
> static inline void sas_ata_disabled_notice(void)
> @@ -123,6 +125,10 @@ static inline int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *p
> sas_ata_disabled_notice();
> return -ENODEV;
> }
> +
> +static const struct attribute_group sas_ata_sdev_attr_group = {
> + .attrs = NULL,
> +};

I just noticed a build issue.

With CONFIG_SCSI_SAS_ATA not set, I get this for W=1 build:

In file included from drivers/scsi/hisi_sas/hisi_sas.h:29,
from drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:7:
/include/scsi/sas_ata.h:129:37: error: ‘sas_ata_sdev_attr_group’
defined but not used [-Werror=unused-const-variable=]
129 | static const struct attribute_group sas_ata_sdev_attr_group = {

I suppose that marking sas_ata_sdev_attr_group as __maybe_unused is ok,
but less than ideal. The linker should strip it out of files when unused.

I think that this is also ok:

#define sas_ata_sdev_attr_group (struct attribute_group) {}

The compiler here will create a empty structure and have
&sas_ata_sdev_attr_group point at it.

Thanks,
John

\
 
 \ /
  Last update: 2024-05-27 15:35    [W:0.958 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site