public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xen: xen-pciback: remove DRIVER_ATTR() usage
Date: Wed, 19 Jul 2017 16:22:21 +0200	[thread overview]
Message-ID: <20170719142221.GA30949@kroah.com> (raw)
In-Reply-To: <813c3691-d8d0-28f0-6f49-c2b450a07c42@suse.com>

On Wed, Jul 19, 2017 at 03:17:53PM +0200, Juergen Gross wrote:
> On 19/07/17 14:58, Greg KH wrote:
> > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > It's better to be explicit and use the DRIVER_ATTR_RW() and
> > DRIVER_ATTR_RO() macros when defining a driver's sysfs file.
> > 
> > Bonus is this fixes up a checkpatch.pl warning.
> > 
> > This is part of a series to drop DRIVER_ATTR() from the tree entirely.
> > 
> > Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> > Cc: Juergen Gross <jgross@suse.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > ---
> >  drivers/xen/xen-pciback/pci_stub.c |   44 ++++++++++++++++---------------------
> >  1 file changed, 20 insertions(+), 24 deletions(-)
> > 
> > 
> > --- a/drivers/xen/xen-pciback/pci_stub.c
> > +++ b/drivers/xen/xen-pciback/pci_stub.c
> > @@ -1172,8 +1172,8 @@ out:
> >  	return err;
> >  }
> >  
> > -static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf,
> > -				size_t count)
> > +static ssize_t new_slot_store(struct device_driver *drv, const char *buf,
> > +			      size_t count)
> >  {
> >  	int domain, bus, slot, func;
> >  	int err;
> > @@ -1189,10 +1189,10 @@ out:
> >  		err = count;
> >  	return err;
> >  }
> > -static DRIVER_ATTR(new_slot, S_IWUSR, NULL, pcistub_slot_add);
> > +static DRIVER_ATTR_WO(new_slot);
> >  
> > -static ssize_t pcistub_slot_remove(struct device_driver *drv, const char *buf,
> > -				   size_t count)
> > +static ssize_t remove_slot_store(struct device_driver *drv, const char *buf,
> > +				 size_t count)
> >  {
> >  	int domain, bus, slot, func;
> >  	int err;
> > @@ -1208,9 +1208,9 @@ out:
> >  		err = count;
> >  	return err;
> >  }
> > -static DRIVER_ATTR(remove_slot, S_IWUSR, NULL, pcistub_slot_remove);
> > +static DRIVER_ATTR_WO(remove_slot);
> >  
> > -static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf)
> > +static ssize_t slots_show(struct device_driver *drv, char *buf)
> >  {
> >  	struct pcistub_device_id *pci_dev_id;
> >  	size_t count = 0;
> > @@ -1231,9 +1231,9 @@ static ssize_t pcistub_slot_show(struct
> >  
> >  	return count;
> >  }
> > -static DRIVER_ATTR(slots, S_IRUSR, pcistub_slot_show, NULL);
> > +static DRIVER_ATTR_RO(slots);
> >  
> > -static ssize_t pcistub_irq_handler_show(struct device_driver *drv, char *buf)
> > +static ssize_t irq_handlers_show(struct device_driver *drv, char *buf)
> >  {
> >  	struct pcistub_device *psdev;
> >  	struct xen_pcibk_dev_data *dev_data;
> > @@ -1260,11 +1260,10 @@ static ssize_t pcistub_irq_handler_show(
> >  	spin_unlock_irqrestore(&pcistub_devices_lock, flags);
> >  	return count;
> >  }
> > -static DRIVER_ATTR(irq_handlers, S_IRUSR, pcistub_irq_handler_show, NULL);
> > +static DRIVER_ATTR_RO(irq_handlers);
> >  
> > -static ssize_t pcistub_irq_handler_switch(struct device_driver *drv,
> > -					  const char *buf,
> > -					  size_t count)
> > +static ssize_t irq_handler_state_store(struct device_driver *drv,
> > +				       const char *buf, size_t count)
> >  {
> >  	struct pcistub_device *psdev;
> >  	struct xen_pcibk_dev_data *dev_data;
> > @@ -1301,11 +1300,10 @@ out:
> >  		err = count;
> >  	return err;
> >  }
> > -static DRIVER_ATTR(irq_handler_state, S_IWUSR, NULL,
> > -		   pcistub_irq_handler_switch);
> > +static DRIVER_ATTR_WO(irq_handler_state);
> >  
> > -static ssize_t pcistub_quirk_add(struct device_driver *drv, const char *buf,
> > -				 size_t count)
> > +static ssize_t quirks_add(struct device_driver *drv, const char *buf,
> > +			  size_t count)
> 
> Shouldn't this be named quirks_store()?

Odd, yes, it should, I don't know how my build-testing didn't catch
that, sorry.

Let me go make a v2...

thanks,

greg k-h

  reply	other threads:[~2017-07-19 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 12:58 [PATCH] xen: xen-pciback: remove DRIVER_ATTR() usage Greg KH
2017-07-19 13:17 ` Juergen Gross
2017-07-19 14:22   ` Greg KH [this message]
2017-07-19 14:43 ` [PATCH v2] " Greg KH
2017-07-19 14:51   ` Juergen Gross
2017-07-19 15:17     ` Greg KH
2017-07-19 17:20       ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170719142221.GA30949@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox