Re: [PATCH 2/2] libata: CONFIG_ATA_SYSFS_COMPAT

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

 



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.

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

   Same here. The buffer seems oversized too...

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

   snprintf(), perhaps?

> +
> +	return sysfs_create_link(&parent->kobj, &dev->kobj, compat_name);
> +}
> +
> +static void ata_tport_compat_link_delete(struct ata_port *ap)
> +{
> +	struct device *dev = &ap->tdev;
> +	struct device *parent = dev->parent;
> +	char compat_name[64];
> +
> +	sprintf(compat_name, "ata%d", ap->print_id);

   snprintf()?

[...]

MBR, Sergey



[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