From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 22 Jul 2014 16:17:11 -0700 From: Greg KH Subject: Re: [PATCH 4/8 v2] staging: unisys: move chipsetready to sysfs Message-ID: <20140722231711.GD1806@kroah.com> References: <1406037392-31030-1-git-send-email-benjamin.romer@unisys.com> <1406037392-31030-5-git-send-email-benjamin.romer@unisys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406037392-31030-5-git-send-email-benjamin.romer@unisys.com> List-ID: To: Benjamin Romer Cc: jkc@redhat.com, driverdev-devel@linuxdriverproject.org, sparmaintainer@unisys.com On Tue, Jul 22, 2014 at 09:56:28AM -0400, Benjamin Romer wrote: > Move the chipsetready proc entry to sysfs under a new directory guest. This > entry is used by Unisys application software on the guest to acknowledge > completion of specific events for integration purposes, but these > acknowledgements are not required for the guest to operate correctly. > > The store function is simplified as well, to use scanf() instead of copying > the buffer and using strsep(). > > Signed-off-by: Benjamin Romer > --- > v2: attribute creation was fixed and checks for controlvm_channel pointer were > removed. The off-by-one error in the sscanf() was fixed. Error -1 that was > being returned was changed to -EINVAL. > > .../unisys/visorchipset/visorchipset_main.c | 88 ++++++++-------------- > 1 file changed, 33 insertions(+), 55 deletions(-) > > diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c > index a20e21b..74ab15b 100644 > --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c > +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c > @@ -129,9 +129,6 @@ static MYPROCTYPE *PartitionType; > #define VISORCHIPSET_DIAG_PROC_ENTRY_FN "diagdump" > static struct proc_dir_entry *diag_proc_dir; > > -#define VISORCHIPSET_CHIPSET_PROC_ENTRY_FN "chipsetready" > -static struct proc_dir_entry *chipset_proc_dir; > - > #define VISORCHIPSET_PARAHOTPLUG_PROC_ENTRY_FN "parahotplug" > static struct proc_dir_entry *parahotplug_proc_dir; > > @@ -323,6 +320,10 @@ static ssize_t remaining_steps_store(struct device *dev, > struct device_attribute *attr, const char *buf, size_t count); > static DEVICE_ATTR_RW(remaining_steps); > > +static ssize_t chipsetready_store(struct device *dev, > + struct device_attribute *attr, const char *buf, size_t count); > +static DEVICE_ATTR_WO(chipsetready); > + > static struct attribute *visorchipset_install_attrs[] = { > &dev_attr_toolaction.attr, > &dev_attr_boottotool.attr, > @@ -337,8 +338,19 @@ static struct attribute_group visorchipset_install_group = { > .attrs = visorchipset_install_attrs > }; > > +static struct attribute *visorchipset_guest_attrs[] = { > + &dev_attr_chipsetready.attr, > + NULL > +}; > + > +static struct attribute_group visorchipset_guest_group = { > + .name = "guest", > + .attrs = visorchipset_guest_attrs > +}; > + > static const struct attribute_group *visorchipset_dev_groups[] = { > &visorchipset_install_group, > + &visorchipset_guest_group, > NULL > }; > > @@ -2369,49 +2381,27 @@ visorchipset_cache_free(struct kmem_cache *pool, void *p, char *fn, int ln) > kmem_cache_free(pool, p); > } > > -#define gettoken(bufp) strsep(bufp, " -\t\n") > - > -static ssize_t > -chipset_proc_write(struct file *file, const char __user *buffer, > - size_t count, loff_t *ppos) > +ssize_t chipsetready_store(struct device *dev, struct device_attribute *attr, > + const char *buf, size_t count) Shouldn't this, and your other sysfs file attribute functions, be static? You said they were above, but not here, so, which does the compiler decide to use? I think the last one, but please be consistant. Same goes for all of the patches in this series... thanks, greg k-h