Re: [PATCH 2/4] RDMA: Convert sysfs kobject * show functions to use sysfs_emit()

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

 



On Fri, 2020-10-09 at 11:09 -0300, Jason Gunthorpe wrote:
> On Wed, Oct 07, 2020 at 07:36:25PM -0700, Joe Perches wrote:
> > Done with cocci script:
> > 
> > @@
> > identifier k_show;
> > identifier arg1, arg2, arg3;
> > @@
> > ssize_t k_show(struct kobject *
> > -	arg1
> > +	kobj
> > 	, struct kobj_attribute *
> > -	arg2
> > +	attr
> > 	, char *
> > -	arg3
> > +	buf
> > 	)
> > {
> > 	...
> > (
> > -	arg1
> > +	kobj
> > -	arg2
> > +	attr
> > -	arg3
> > +	buf
> > )
> > 	...
> > }
> 
> This is nice

The 1/4 patch for device * cannot do this as there are
conflicts with dev/device naming within the functions.

It'd be nice to do the conversions though.

Maybe rename

	dev->ibdev
	device->dev

so that all sysfs _show function are consistently

ssize_t <foo>_show(struct device *dev, struct device_attribute *attr, char *buf);





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux