* [PATCH v2] SCSI: fcoe: convert to use BUS_ATTR_WO
@ 2019-01-22 14:27 Greg Kroah-Hartman
2019-01-26 10:26 ` Hannes Reinecke
2019-01-29 5:30 ` Martin K. Petersen
0 siblings, 2 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-22 14:27 UTC (permalink / raw)
To: Johannes Thumshirn, James E.J. Bottomley, Martin K. Petersen
Cc: linux-kernel, linux-scsi
We are trying to get rid of BUS_ATTR() and the usage of that in the fcoe
driver can be trivially converted to use BUS_ATTR_WO(), so use that
instead.
Cc: Johannes Thumshirn <jth@kernel.org>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
v2: Made simpler with wrapper functions to call the "real" show/store
functions, thanks to James for the idea.
Removed the EXPORT_SYMBOL() removal line, that belongs in a separate
patch
drivers/scsi/fcoe/fcoe_sysfs.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 5c8310bade61..c3dcbdc3aa64 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -671,8 +671,19 @@ static const struct device_type fcoe_fcf_device_type = {
.release = fcoe_fcf_device_release,
};
-static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store);
-static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store);
+static ssize_t ctlr_create_store(struct bus_type *bus, const char *buf,
+ size_t count)
+{
+ return fcoe_ctlr_create_store(bus, buf, count);
+}
+static BUS_ATTR_WO(ctlr_create);
+
+static ssize_t ctlr_destroy_store(struct bus_type *bus, const char *buf,
+ size_t count)
+{
+ return fcoe_ctlr_destroy_store(bus, buf, count);
+}
+static BUS_ATTR_WO(ctlr_destroy);
static struct attribute *fcoe_bus_attrs[] = {
&bus_attr_ctlr_create.attr,
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] SCSI: fcoe: convert to use BUS_ATTR_WO
2019-01-22 14:27 [PATCH v2] SCSI: fcoe: convert to use BUS_ATTR_WO Greg Kroah-Hartman
@ 2019-01-26 10:26 ` Hannes Reinecke
2019-01-26 10:39 ` Greg Kroah-Hartman
2019-01-29 5:30 ` Martin K. Petersen
1 sibling, 1 reply; 5+ messages in thread
From: Hannes Reinecke @ 2019-01-26 10:26 UTC (permalink / raw)
To: Greg Kroah-Hartman, Johannes Thumshirn, James E.J. Bottomley,
Martin K. Petersen
Cc: linux-kernel, linux-scsi
On 1/22/19 3:27 PM, Greg Kroah-Hartman wrote:
> We are trying to get rid of BUS_ATTR() and the usage of that in the fcoe
> driver can be trivially converted to use BUS_ATTR_WO(), so use that
> instead.
>
> Cc: Johannes Thumshirn <jth@kernel.org>
> Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> v2: Made simpler with wrapper functions to call the "real" show/store
> functions, thanks to James for the idea.
> Removed the EXPORT_SYMBOL() removal line, that belongs in a separate
> patch
>
> drivers/scsi/fcoe/fcoe_sysfs.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
> index 5c8310bade61..c3dcbdc3aa64 100644
> --- a/drivers/scsi/fcoe/fcoe_sysfs.c
> +++ b/drivers/scsi/fcoe/fcoe_sysfs.c
> @@ -671,8 +671,19 @@ static const struct device_type fcoe_fcf_device_type = {
> .release = fcoe_fcf_device_release,
> };
>
> -static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store);
> -static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store);
> +static ssize_t ctlr_create_store(struct bus_type *bus, const char *buf,
> + size_t count)
> +{
> + return fcoe_ctlr_create_store(bus, buf, count);
> +}
> +static BUS_ATTR_WO(ctlr_create);
> +
> +static ssize_t ctlr_destroy_store(struct bus_type *bus, const char *buf,
> + size_t count)
> +{
> + return fcoe_ctlr_destroy_store(bus, buf, count);
> +}
> +static BUS_ATTR_WO(ctlr_destroy);
>
> static struct attribute *fcoe_bus_attrs[] = {
> &bus_attr_ctlr_create.attr,
>
Why not renaming the functions and drop the wrapper?
Cheers,
Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] SCSI: fcoe: convert to use BUS_ATTR_WO
2019-01-26 10:26 ` Hannes Reinecke
@ 2019-01-26 10:39 ` Greg Kroah-Hartman
2019-01-26 10:40 ` Hannes Reinecke
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-26 10:39 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Johannes Thumshirn, James E.J. Bottomley, Martin K. Petersen,
linux-kernel, linux-scsi
On Sat, Jan 26, 2019 at 11:26:47AM +0100, Hannes Reinecke wrote:
> On 1/22/19 3:27 PM, Greg Kroah-Hartman wrote:
> > We are trying to get rid of BUS_ATTR() and the usage of that in the fcoe
> > driver can be trivially converted to use BUS_ATTR_WO(), so use that
> > instead.
> >
> > Cc: Johannes Thumshirn <jth@kernel.org>
> > Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
> > Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> > v2: Made simpler with wrapper functions to call the "real" show/store
> > functions, thanks to James for the idea.
> > Removed the EXPORT_SYMBOL() removal line, that belongs in a separate
> > patch
> >
> > drivers/scsi/fcoe/fcoe_sysfs.c | 15 +++++++++++++--
> > 1 file changed, 13 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
> > index 5c8310bade61..c3dcbdc3aa64 100644
> > --- a/drivers/scsi/fcoe/fcoe_sysfs.c
> > +++ b/drivers/scsi/fcoe/fcoe_sysfs.c
> > @@ -671,8 +671,19 @@ static const struct device_type fcoe_fcf_device_type = {
> > .release = fcoe_fcf_device_release,
> > };
> > -static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store);
> > -static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store);
> > +static ssize_t ctlr_create_store(struct bus_type *bus, const char *buf,
> > + size_t count)
> > +{
> > + return fcoe_ctlr_create_store(bus, buf, count);
> > +}
> > +static BUS_ATTR_WO(ctlr_create);
> > +
> > +static ssize_t ctlr_destroy_store(struct bus_type *bus, const char *buf,
> > + size_t count)
> > +{
> > + return fcoe_ctlr_destroy_store(bus, buf, count);
> > +}
> > +static BUS_ATTR_WO(ctlr_destroy);
> > static struct attribute *fcoe_bus_attrs[] = {
> > &bus_attr_ctlr_create.attr,
> >
> Why not renaming the functions and drop the wrapper?
I did that in v1 of this patch, but people complained I was messing up
their function namespace :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] SCSI: fcoe: convert to use BUS_ATTR_WO
2019-01-26 10:39 ` Greg Kroah-Hartman
@ 2019-01-26 10:40 ` Hannes Reinecke
0 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2019-01-26 10:40 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Johannes Thumshirn, James E.J. Bottomley, Martin K. Petersen,
linux-kernel, linux-scsi
On 1/26/19 11:39 AM, Greg Kroah-Hartman wrote:
> On Sat, Jan 26, 2019 at 11:26:47AM +0100, Hannes Reinecke wrote:
>> On 1/22/19 3:27 PM, Greg Kroah-Hartman wrote:
>>> We are trying to get rid of BUS_ATTR() and the usage of that in the fcoe
>>> driver can be trivially converted to use BUS_ATTR_WO(), so use that
>>> instead.
>>>
>>> Cc: Johannes Thumshirn <jth@kernel.org>
>>> Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
>>> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
>>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> ---
>>> v2: Made simpler with wrapper functions to call the "real" show/store
>>> functions, thanks to James for the idea.
>>> Removed the EXPORT_SYMBOL() removal line, that belongs in a separate
>>> patch
>>>
>>> drivers/scsi/fcoe/fcoe_sysfs.c | 15 +++++++++++++--
>>> 1 file changed, 13 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
>>> index 5c8310bade61..c3dcbdc3aa64 100644
>>> --- a/drivers/scsi/fcoe/fcoe_sysfs.c
>>> +++ b/drivers/scsi/fcoe/fcoe_sysfs.c
>>> @@ -671,8 +671,19 @@ static const struct device_type fcoe_fcf_device_type = {
>>> .release = fcoe_fcf_device_release,
>>> };
>>> -static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store);
>>> -static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store);
>>> +static ssize_t ctlr_create_store(struct bus_type *bus, const char *buf,
>>> + size_t count)
>>> +{
>>> + return fcoe_ctlr_create_store(bus, buf, count);
>>> +}
>>> +static BUS_ATTR_WO(ctlr_create);
>>> +
>>> +static ssize_t ctlr_destroy_store(struct bus_type *bus, const char *buf,
>>> + size_t count)
>>> +{
>>> + return fcoe_ctlr_destroy_store(bus, buf, count);
>>> +}
>>> +static BUS_ATTR_WO(ctlr_destroy);
>>> static struct attribute *fcoe_bus_attrs[] = {
>>> &bus_attr_ctlr_create.attr,
>>>
>> Why not renaming the functions and drop the wrapper?
>
> I did that in v1 of this patch, but people complained I was messing up
> their function namespace :)
>
Sigh.
Okay, then.
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cheers,
Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] SCSI: fcoe: convert to use BUS_ATTR_WO
2019-01-22 14:27 [PATCH v2] SCSI: fcoe: convert to use BUS_ATTR_WO Greg Kroah-Hartman
2019-01-26 10:26 ` Hannes Reinecke
@ 2019-01-29 5:30 ` Martin K. Petersen
1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2019-01-29 5:30 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Johannes Thumshirn, James E.J. Bottomley, Martin K. Petersen,
linux-kernel, linux-scsi
Greg,
> We are trying to get rid of BUS_ATTR() and the usage of that in the
> fcoe driver can be trivially converted to use BUS_ATTR_WO(), so use
> that instead.
Applied to 5.1/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-01-29 5:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 14:27 [PATCH v2] SCSI: fcoe: convert to use BUS_ATTR_WO Greg Kroah-Hartman
2019-01-26 10:26 ` Hannes Reinecke
2019-01-26 10:39 ` Greg Kroah-Hartman
2019-01-26 10:40 ` Hannes Reinecke
2019-01-29 5:30 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).