Re: [PATCH 1/2] libata: Expose trim capability in sysfs

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

 



Hello,

On Tue, Apr 01, 2014 at 08:42:36PM -0400, Martin K. Petersen wrote:
> +static ssize_t
> +show_ata_dev_trim(struct device *dev,
> +		  struct device_attribute *attr, char *buf)
> +{
> +	struct ata_device *ata_dev = transport_class_to_dev(dev);
> +	unsigned int mode;

Let's please just do

	const char *mode = "unsupported";

	if (ata_id_has_trim(ata_dev->id)) {
		if (ata_fpdma_dsm_supported(ata_dev))
			mode = "queued";
		else
			mode = "unqueued";
	}

	return sprintf(buf, "%s\n", mode);

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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