diff mbox series

HID: core: clean up indentation issue

Message ID 20190922115054.10880-1-colin.king@canonical.com (mailing list archive)
State Rejected, archived
Delegated to: Jiri Kosina
Headers show
Series HID: core: clean up indentation issue | expand

Commit Message

Colin King Sept. 22, 2019, 11:50 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

There is an if statement that is indented by one extra space,
fix this by removing the extraneous space.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/hid/hid-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jiri Kosina Sept. 23, 2019, 11:04 a.m. UTC | #1
On Sun, 22 Sep 2019, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> There is an if statement that is indented by one extra space,
> fix this by removing the extraneous space.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/hid/hid-core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 3eaee2c37931..9469c382a182 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -2329,10 +2329,10 @@ int hid_add_device(struct hid_device *hdev)
>  	/*
>  	 * Check for the mandatory transport channel.
>  	 */
> -	 if (!hdev->ll_driver->raw_request) {
> +	if (!hdev->ll_driver->raw_request) {
>  		hid_err(hdev, "transport driver missing .raw_request()\n");
>  		return -EINVAL;
> -	 }
> +	}

Let's not pollute git blame and wait for an ocasion when we need to touch 
the code for some more valid reason.

Thanks,
Dan Carpenter Sept. 25, 2019, 11:47 a.m. UTC | #2
On Mon, Sep 23, 2019 at 01:04:13PM +0200, Jiri Kosina wrote:
> On Sun, 22 Sep 2019, Colin King wrote:
> 
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > There is an if statement that is indented by one extra space,
> > fix this by removing the extraneous space.
> > 
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >  drivers/hid/hid-core.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> > index 3eaee2c37931..9469c382a182 100644
> > --- a/drivers/hid/hid-core.c
> > +++ b/drivers/hid/hid-core.c
> > @@ -2329,10 +2329,10 @@ int hid_add_device(struct hid_device *hdev)
> >  	/*
> >  	 * Check for the mandatory transport channel.
> >  	 */
> > -	 if (!hdev->ll_driver->raw_request) {
> > +	if (!hdev->ll_driver->raw_request) {
> >  		hid_err(hdev, "transport driver missing .raw_request()\n");
> >  		return -EINVAL;
> > -	 }
> > +	}
> 
> Let's not pollute git blame and wait for an ocasion when we need to touch 
> the code for some more valid reason.

Just use `git blame -w`.

This probably came from a Smatch warning.  Smatch warns very seldom
warns about style issues, but in this case the indenting is legitimately
bad.

regards,
dan carpenter
Benjamin Tissoires Sept. 27, 2019, 10:04 a.m. UTC | #3
On Wed, Sep 25, 2019 at 1:48 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Mon, Sep 23, 2019 at 01:04:13PM +0200, Jiri Kosina wrote:
> > On Sun, 22 Sep 2019, Colin King wrote:
> >
> > > From: Colin Ian King <colin.king@canonical.com>
> > >
> > > There is an if statement that is indented by one extra space,
> > > fix this by removing the extraneous space.
> > >
> > > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > > ---
> > >  drivers/hid/hid-core.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> > > index 3eaee2c37931..9469c382a182 100644
> > > --- a/drivers/hid/hid-core.c
> > > +++ b/drivers/hid/hid-core.c
> > > @@ -2329,10 +2329,10 @@ int hid_add_device(struct hid_device *hdev)
> > >     /*
> > >      * Check for the mandatory transport channel.
> > >      */
> > > -    if (!hdev->ll_driver->raw_request) {
> > > +   if (!hdev->ll_driver->raw_request) {
> > >             hid_err(hdev, "transport driver missing .raw_request()\n");
> > >             return -EINVAL;
> > > -    }
> > > +   }
> >
> > Let's not pollute git blame and wait for an ocasion when we need to touch
> > the code for some more valid reason.
>
> Just use `git blame -w`.
>
> This probably came from a Smatch warning.  Smatch warns very seldom
> warns about style issues, but in this case the indenting is legitimately
> bad.

Well, I tend to agree with Jiri here. Yes, you can use a particular
flag in a tool to 'solve' the git blame/history issue, but this is
putting the workload on the user, while tthe code is fine, in this
case. Why do we need to pollute the history of a file for no good
reasons?

Cheers,
Benjamin
diff mbox series

Patch

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 3eaee2c37931..9469c382a182 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2329,10 +2329,10 @@  int hid_add_device(struct hid_device *hdev)
 	/*
 	 * Check for the mandatory transport channel.
 	 */
-	 if (!hdev->ll_driver->raw_request) {
+	if (!hdev->ll_driver->raw_request) {
 		hid_err(hdev, "transport driver missing .raw_request()\n");
 		return -EINVAL;
-	 }
+	}
 
 	/*
 	 * Read the device report descriptor once and use as template