Re: [PATCH v2 2/4] blk-integrity: convert to struct device_attribute

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

 



> +		container_of(attr, struct device_attribute, attr);
>  	ssize_t ret = 0;
>  
> +	if (dev_attr->store)
> +		ret = dev_attr->store(dev, dev_attr, page, count);
>  
>  	return ret;

This can be simplified to:

	if (!rev_attr->store)
		return 0;
	return dev_attr->store(dev, dev_attr, page, count);

(I'm still confused why 0 is the right return value here, but that's not
 new in your patch, so better don't rock that boat).

> +static ssize_t format_show(struct device *dev, struct device_attribute *attr, char *page)

Please avoid the overly long line here. an in the other methods.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux