Re: [PATCH 2/2] libata: CONFIG_ATA_SYSFS_COMPAT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/25/22 17:22, Sergey Shtylyov wrote:
Hello!

On 3/25/22 3:56 PM, Hannes Reinecke wrote:

Add a config option 'ATA_SYSFS_COMPAT' to create a compatibility
'ata' symlink in the PCI device sysfs directory.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
[...]
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index e5ed5046b299..29dec89ccc2d 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -251,6 +251,39 @@ static int ata_tport_match(struct attribute_container *cont,
  	return &ata_scsi_transport_template->host_attrs.ac == cont;
  }
+#ifdef CONFIG_ATA_SYSFS_COMPAT
+static int ata_tport_compat_link_add(struct ata_port *ap)
+{
+        struct device *dev = &ap->tdev;

    Indent with a tab, please.


Of course.

+	struct device *parent = dev->parent;
+        char compat_name[64];

    Same here. The buffer seems oversized too...

Hard to tell how many ATA devices there are in the system.
More than hundred?
But yeah, I can reduce it.

+
+	sprintf(compat_name, "ata%d", ap->print_id);

    snprintf(), perhaps?

OK.

Cheers,

Hannes
--
Dr. Hannes Reinecke                Kernel Storage Architect
hare@xxxxxxx                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux