From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: "Dall, Betty" <betty.dall@hpe.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] ACPI/device_sysfs: Clean up checkpatch errors
Date: Fri, 29 Apr 2016 23:35:18 +0200 [thread overview]
Message-ID: <1944873.kT8hIM6F05@vostro.rjw.lan> (raw)
In-Reply-To: <AT5PR84MB00838E755BEEE2769F1EA5209D660@AT5PR84MB0083.NAMPRD84.PROD.OUTLOOK.COM>
On Friday, April 29, 2016 09:13:28 PM Dall, Betty wrote:
> On 04/29/2016 02:19 PM, Rafael J. Wysocki wrote:
> > On Fri, Apr 29, 2016 at 9:21 PM, Betty Dall <betty.dall@hpe.com> wrote:
> >> Cleaning up five existing checkpatch errors in device_sysfs.c since the
> >> file is being changed.
> >>
> >> Signed-off-by: Betty Dall <betty.dall@hpe.com>
> >> ---
> >> drivers/acpi/device_sysfs.c | 22 ++++++++++++++--------
> >> 1 file changed, 14 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
> >> index e556a3e..5aaebec 100644
> >> --- a/drivers/acpi/device_sysfs.c
> >> +++ b/drivers/acpi/device_sysfs.c
> >> @@ -35,7 +35,7 @@ static ssize_t acpi_object_path(acpi_handle handle, char *buf)
> >> if (result)
> >> return result;
> >>
> >> - result = sprintf(buf, "%s\n", (char*)path.pointer);
> >> + result = sprintf(buf, "%s\n", (char *)path.pointer);
> >
> > OK
> >
> >> kfree(path.pointer);
> >> return result;
> >> }
> >> @@ -81,6 +81,7 @@ static const struct sysfs_ops acpi_data_node_sysfs_ops = {
> >> static void acpi_data_node_release(struct kobject *kobj)
> >> {
> >> struct acpi_data_node *dn = to_data_node(kobj);
> >> +
> >
> > Maybe.
>
> Checkpatch wants a blank line after declarations.
But sometimes they are not really useful. As in this case IMO.
> >> complete(&dn->kobj_done);
> >> }
> >>
> >> @@ -106,7 +107,8 @@ static void acpi_expose_nondev_subnodes(struct kobject *kobj,
> >> ret = kobject_init_and_add(&dn->kobj, &acpi_data_node_ktype,
> >> kobj, "%s", dn->name);
> >> if (ret)
> >> - acpi_handle_err(dn->handle, "Failed to expose (%d)\n", ret);
> >> + acpi_handle_err(dn->handle,
> >> + "Failed to expose (%d)\n", ret);
> >
> > No. checkpatch is wrong here.
>
> Ok - that was just an 80 char warning.
>
> >> else
> >> acpi_expose_nondev_subnodes(&dn->kobj, &dn->data);
> >> }
> >> @@ -333,7 +335,9 @@ int acpi_device_modalias(struct device *dev, char *buf, int size)
> >> EXPORT_SYMBOL_GPL(acpi_device_modalias);
> >>
> >> static ssize_t
> >> -acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, char *buf) {
> >> +acpi_device_modalias_show(struct device *dev,
> >> + struct device_attribute *attr, char *buf)
> >
> > The brace should go to the new line, but it's better if the header
> > takes one line only.
>
> Ok - I was trying to clean up the 80 character warning, but I see your
> point.
>
> >> +{
> >> return __acpi_device_modalias(to_acpi_device(dev), buf, 1024);
> >> }
> >> static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
> >> @@ -397,7 +401,9 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
> >> static DEVICE_ATTR(eject, 0200, NULL, acpi_eject_store);
> >>
> >> static ssize_t
> >> -acpi_device_hid_show(struct device *dev, struct device_attribute *attr, char *buf) {
> >> +acpi_device_hid_show(struct device *dev,
> >> + struct device_attribute *attr, char *buf)
> >
> > Ditto.
>
> OK.
>
> >> +{
> >> struct acpi_device *acpi_dev = to_acpi_device(dev);
> >>
> >> return sprintf(buf, "%s\n", acpi_device_hid(acpi_dev));
> >> @@ -568,10 +574,10 @@ int acpi_device_setup_files(struct acpi_device *dev)
> >> goto end;
> >> }
> >>
> >> - /*
> >> - * If device has _EJ0, 'eject' file is created that is used to trigger
> >> - * hot-removal function from userland.
> >> - */
> >> + /*
> >> + * If device has _EJ0, 'eject' file is created that is used to trigger
> >> + * hot-removal function from userland.
> >> + */
> >
> > What's the problem with this comment?
>
> They were spaces - not a tab.
Ah, whitespace damage. OK
prev parent reply other threads:[~2016-04-29 21:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-29 19:21 [PATCH v2 0/3] ACPI/device_sysfs: Add sysfs support for _HRV hardware revision Betty Dall
2016-04-29 19:21 ` [PATCH v2 1/3] " Betty Dall
2016-04-29 19:21 ` [PATCH v2 2/3] ACPI/device_sysfs: Change _SUN and _STA show functions error return to EIO Betty Dall
2016-04-29 19:21 ` [PATCH v2 3/3] ACPI/device_sysfs: Clean up checkpatch errors Betty Dall
2016-04-29 20:18 ` Rafael J. Wysocki
2016-04-29 21:13 ` Dall, Betty
2016-04-29 21:35 ` Rafael J. Wysocki [this message]
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=1944873.kT8hIM6F05@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=betty.dall@hpe.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.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
all inboxes | Powered by JetHome®