Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1475788 > unrolled thread

[PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check.

Started byAmit Ghadge <amitg.b14@gmail.com>
First post2016-09-03 22:20 +0200
Last post2016-09-05 16:20 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check. Amit Ghadge <amitg.b14@gmail.com> - 2016-09-03 22:20 +0200
    Re: [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check. Greg KH <gregkh@linuxfoundation.org> - 2016-09-04 10:40 +0200
      Re: [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check. Amit Ghadge <amitg.b14@gmail.com> - 2016-09-04 12:20 +0200
        Re: [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check. Ian Abbott <abbotti@mev.co.uk> - 2016-09-05 15:30 +0200
    Re: [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check. Ian Abbott <abbotti@mev.co.uk> - 2016-09-05 15:40 +0200
      Re: [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check. Amit Ghadge <amitg.b14@gmail.com> - 2016-09-05 16:20 +0200

#1475788 — [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check.

FromAmit Ghadge <amitg.b14@gmail.com>
Date2016-09-03 22:20 +0200
Subject[PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check.
Message-ID<sdpzY-1pL-9@gated-at.bofh.it>
Fixes checkpatch warning:
WARNING: Block comments use * on subsequent lines

Replace (1<<7) by BIT(7) in the file ni_670x.c to get rid
of checkpatch.pl "CHECK" output "Prefer using the BIT macro".
Replace Avoid CamelCase range_0_20mA to range_0_20ma.

Signed-off-by: Amit Ghadge <amitg.b14@gmail.com>
---
 drivers/staging/comedi/drivers/ni_670x.c | 66 ++++++++++++++++----------------
 1 file changed, 32 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_670x.c b/drivers/staging/comedi/drivers/ni_670x.c
index 3e7271880..86d26aa 100644
--- a/drivers/staging/comedi/drivers/ni_670x.c
+++ b/drivers/staging/comedi/drivers/ni_670x.c
@@ -1,40 +1,38 @@
 /*
-    comedi/drivers/ni_670x.c
-    Hardware driver for NI 670x devices
-
-    COMEDI - Linux Control and Measurement Device Interface
-    Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-*/
+ * comedi/drivers/ni_670x.c
+ * Hardware driver for NI 670x devices
+
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
+
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
 /*
-Driver: ni_670x
-Description: National Instruments 670x
-Author: Bart Joris <bjoris@advalvas.be>
-Updated: Wed, 11 Dec 2002 18:25:35 -0800
-Devices: [National Instruments] PCI-6703 (ni_670x), PCI-6704
-Status: unknown
-
-Commands are not supported.
-*/
-
+ * Driver: ni_670x
+ * Description: National Instruments 670x
+ * Author: Bart Joris <bjoris@advalvas.be>
+ * Updated: Wed, 11 Dec 2002 18:25:35 -0800
+ * Devices: [National Instruments] PCI-6703 (ni_670x), PCI-6704
+ * Status: unknown
+
+ * Commands are not supported.
+ */
 /*
-	Bart Joris <bjoris@advalvas.be> Last updated on 20/08/2001
-
-	Manuals:
+ * Bart Joris <bjoris@advalvas.be> Last updated on 20/08/2001
 
-	322110a.pdf	PCI/PXI-6704 User Manual
-	322110b.pdf	PCI/PXI-6703/6704 User Manual
+ * Manuals:
 
-*/
+ * 322110a.pdf	PCI/PXI-6704 User Manual
+ * 322110b.pdf	PCI/PXI-6703/6704 User Manual
+ */
 
 #include <linux/module.h>
 #include <linux/interrupt.h>
@@ -147,7 +145,7 @@ static int ni_670x_dio_insn_config(struct comedi_device *dev,
 
 /* ripped from mite.h and mite_setup2() to avoid mite dependency */
 #define MITE_IODWBSR	0xc0	 /* IO Device Window Base Size Register */
-#define WENAB		(1 << 7) /* window enable */
+#define WENAB		BIT(7) /* window enable */
 
 static int ni_670x_mite_init(struct pci_dev *pcidev)
 {
@@ -222,7 +220,7 @@ static int ni_670x_auto_attach(struct comedi_device *dev,
 		s->range_table_list = range_table_list;
 		for (i = 0; i < 16; i++) {
 			range_table_list[i] = &range_bipolar10;
-			range_table_list[16 + i] = &range_0_20mA;
+			range_table_list[16 + i] = &range_0_20ma;
 		}
 	} else {
 		s->range_table = &range_bipolar10;
-- 
2.5.5

[toc] | [next] | [standalone]


#1475884

FromGreg KH <gregkh@linuxfoundation.org>
Date2016-09-04 10:40 +0200
Message-ID<sdB85-6mo-5@gated-at.bofh.it>
In reply to#1475788
On Sun, Sep 04, 2016 at 01:41:03AM +0530, Amit Ghadge wrote:
> Fixes checkpatch warning:
> WARNING: Block comments use * on subsequent lines
> 
> Replace (1<<7) by BIT(7) in the file ni_670x.c to get rid
> of checkpatch.pl "CHECK" output "Prefer using the BIT macro".
> Replace Avoid CamelCase range_0_20mA to range_0_20ma.

That's multiple things in the same patch, and you didn't even test build
your change :(

Please do better than this in the future.

greg k-h

[toc] | [prev] | [next] | [standalone]


#1475907

FromAmit Ghadge <amitg.b14@gmail.com>
Date2016-09-04 12:20 +0200
Message-ID<sdCGS-5AL-13@gated-at.bofh.it>
In reply to#1475884
I will be send individual patches.

I was try,
 make M=drivers/staging/comedi/

No issue generated, Is there have any other option to test these changes?


Amit G

On Sun, Sep 4, 2016 at 2:05 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sun, Sep 04, 2016 at 01:41:03AM +0530, Amit Ghadge wrote:
>> Fixes checkpatch warning:
>> WARNING: Block comments use * on subsequent lines
>>
>> Replace (1<<7) by BIT(7) in the file ni_670x.c to get rid
>> of checkpatch.pl "CHECK" output "Prefer using the BIT macro".
>> Replace Avoid CamelCase range_0_20mA to range_0_20ma.
>
> That's multiple things in the same patch, and you didn't even test build
> your change :(
>
> Please do better than this in the future.
>
> greg k-h

[toc] | [prev] | [next] | [standalone]


#1476422

FromIan Abbott <abbotti@mev.co.uk>
Date2016-09-05 15:30 +0200
Message-ID<se28i-4is-9@gated-at.bofh.it>
In reply to#1475907
On 04/09/16 11:15, Amit Ghadge wrote:
> I will be send individual patches.
>
> I was try,
>  make M=drivers/staging/comedi/
>
> No issue generated, Is there have any other option to test these changes?

You need to configure the kernel to build the drivers you are changing.

Also, please don't top-post!

>
>
> Amit G
>
> On Sun, Sep 4, 2016 at 2:05 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> On Sun, Sep 04, 2016 at 01:41:03AM +0530, Amit Ghadge wrote:
>>> Fixes checkpatch warning:
>>> WARNING: Block comments use * on subsequent lines
>>>
>>> Replace (1<<7) by BIT(7) in the file ni_670x.c to get rid
>>> of checkpatch.pl "CHECK" output "Prefer using the BIT macro".
>>> Replace Avoid CamelCase range_0_20mA to range_0_20ma.
>>
>> That's multiple things in the same patch, and you didn't even test build
>> your change :(
>>
>> Please do better than this in the future.
>>
>> greg k-h


-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

[toc] | [prev] | [next] | [standalone]


#1476463

FromIan Abbott <abbotti@mev.co.uk>
Date2016-09-05 15:40 +0200
Message-ID<se2i3-4lH-17@gated-at.bofh.it>
In reply to#1475788
On 03/09/16 21:11, Amit Ghadge wrote:
> Fixes checkpatch warning:
> WARNING: Block comments use * on subsequent lines
>
> Replace (1<<7) by BIT(7) in the file ni_670x.c to get rid
> of checkpatch.pl "CHECK" output "Prefer using the BIT macro".
> Replace Avoid CamelCase range_0_20mA to range_0_20ma.
>
> Signed-off-by: Amit Ghadge <amitg.b14@gmail.com>
> ---
>  drivers/staging/comedi/drivers/ni_670x.c | 66 ++++++++++++++++----------------
>  1 file changed, 32 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_670x.c b/drivers/staging/comedi/drivers/ni_670x.c
> index 3e7271880..86d26aa 100644
> --- a/drivers/staging/comedi/drivers/ni_670x.c
> +++ b/drivers/staging/comedi/drivers/ni_670x.c
> @@ -1,40 +1,38 @@
>  /*
> -    comedi/drivers/ni_670x.c
> -    Hardware driver for NI 670x devices
> -
> -    COMEDI - Linux Control and Measurement Device Interface
> -    Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
> -
> -    This program is free software; you can redistribute it and/or modify
> -    it under the terms of the GNU General Public License as published by
> -    the Free Software Foundation; either version 2 of the License, or
> -    (at your option) any later version.
> -
> -    This program is distributed in the hope that it will be useful,
> -    but WITHOUT ANY WARRANTY; without even the implied warranty of
> -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -    GNU General Public License for more details.
> -*/
> + * comedi/drivers/ni_670x.c
> + * Hardware driver for NI 670x devices
> +
> + * COMEDI - Linux Control and Measurement Device Interface
> + * Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
> +
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> +
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
>  /*
> -Driver: ni_670x
> -Description: National Instruments 670x
> -Author: Bart Joris <bjoris@advalvas.be>
> -Updated: Wed, 11 Dec 2002 18:25:35 -0800
> -Devices: [National Instruments] PCI-6703 (ni_670x), PCI-6704
> -Status: unknown
> -
> -Commands are not supported.
> -*/
> -
> + * Driver: ni_670x
> + * Description: National Instruments 670x
> + * Author: Bart Joris <bjoris@advalvas.be>
> + * Updated: Wed, 11 Dec 2002 18:25:35 -0800
> + * Devices: [National Instruments] PCI-6703 (ni_670x), PCI-6704
> + * Status: unknown
> +
> + * Commands are not supported.
> + */
>  /*
> -	Bart Joris <bjoris@advalvas.be> Last updated on 20/08/2001
> -
> -	Manuals:
> + * Bart Joris <bjoris@advalvas.be> Last updated on 20/08/2001
>
> -	322110a.pdf	PCI/PXI-6704 User Manual
> -	322110b.pdf	PCI/PXI-6703/6704 User Manual
> + * Manuals:
>
> -*/
> + * 322110a.pdf	PCI/PXI-6704 User Manual
> + * 322110b.pdf	PCI/PXI-6703/6704 User Manual
> + */

In addition to the problems mentioned by Greg, the blank lines in those 
comment blocks also need a " *" to give an unbroken line of "*" down the 
left hand side of the comment block.

>  #include <linux/module.h>
>  #include <linux/interrupt.h>
> @@ -147,7 +145,7 @@ static int ni_670x_dio_insn_config(struct comedi_device *dev,
>
>  /* ripped from mite.h and mite_setup2() to avoid mite dependency */
>  #define MITE_IODWBSR	0xc0	 /* IO Device Window Base Size Register */
> -#define WENAB		(1 << 7) /* window enable */
> +#define WENAB		BIT(7) /* window enable */
>
>  static int ni_670x_mite_init(struct pci_dev *pcidev)
>  {
> @@ -222,7 +220,7 @@ static int ni_670x_auto_attach(struct comedi_device *dev,
>  		s->range_table_list = range_table_list;
>  		for (i = 0; i < 16; i++) {
>  			range_table_list[i] = &range_bipolar10;
> -			range_table_list[16 + i] = &range_0_20mA;
> +			range_table_list[16 + i] = &range_0_20ma;

You can't just rename variables shared by other modules like that. 
Besides, the "mA" suffix is perfectly fine here, because it is the 
correct S.I. suffix for "milliamps".  (Comedi doesn't bother adding a 
"V" suffix for voltage range variables, as in the "range_bipolar10" 
variable below, but it does add a suffix for the less common units such 
as milliamps.)

>  		}
>  	} else {
>  		s->range_table = &range_bipolar10;
>


-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

[toc] | [prev] | [next] | [standalone]


#1476486

FromAmit Ghadge <amitg.b14@gmail.com>
Date2016-09-05 16:20 +0200
Message-ID<se2UG-4Qu-25@gated-at.bofh.it>
In reply to#1476463
On Mon, Sep 5, 2016 at 7:02 PM, Ian Abbott <abbotti@mev.co.uk> wrote:
> On 03/09/16 21:11, Amit Ghadge wrote:
>>
>> Fixes checkpatch warning:
>> WARNING: Block comments use * on subsequent lines
>>
>> Replace (1<<7) by BIT(7) in the file ni_670x.c to get rid
>> of checkpatch.pl "CHECK" output "Prefer using the BIT macro".
>> Replace Avoid CamelCase range_0_20mA to range_0_20ma.
>>
>> Signed-off-by: Amit Ghadge <amitg.b14@gmail.com>
>> ---
>>  drivers/staging/comedi/drivers/ni_670x.c | 66
>> ++++++++++++++++----------------
>>  1 file changed, 32 insertions(+), 34 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/drivers/ni_670x.c
>> b/drivers/staging/comedi/drivers/ni_670x.c
>> index 3e7271880..86d26aa 100644
>> --- a/drivers/staging/comedi/drivers/ni_670x.c
>> +++ b/drivers/staging/comedi/drivers/ni_670x.c
>> @@ -1,40 +1,38 @@
>>  /*
>> -    comedi/drivers/ni_670x.c
>> -    Hardware driver for NI 670x devices
>> -
>> -    COMEDI - Linux Control and Measurement Device Interface
>> -    Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
>> -
>> -    This program is free software; you can redistribute it and/or modify
>> -    it under the terms of the GNU General Public License as published by
>> -    the Free Software Foundation; either version 2 of the License, or
>> -    (at your option) any later version.
>> -
>> -    This program is distributed in the hope that it will be useful,
>> -    but WITHOUT ANY WARRANTY; without even the implied warranty of
>> -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> -    GNU General Public License for more details.
>> -*/
>> + * comedi/drivers/ni_670x.c
>> + * Hardware driver for NI 670x devices
>> +
>> + * COMEDI - Linux Control and Measurement Device Interface
>> + * Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
>> +
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> +
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + */
>>  /*
>> -Driver: ni_670x
>> -Description: National Instruments 670x
>> -Author: Bart Joris <bjoris@advalvas.be>
>> -Updated: Wed, 11 Dec 2002 18:25:35 -0800
>> -Devices: [National Instruments] PCI-6703 (ni_670x), PCI-6704
>> -Status: unknown
>> -
>> -Commands are not supported.
>> -*/
>> -
>> + * Driver: ni_670x
>> + * Description: National Instruments 670x
>> + * Author: Bart Joris <bjoris@advalvas.be>
>> + * Updated: Wed, 11 Dec 2002 18:25:35 -0800
>> + * Devices: [National Instruments] PCI-6703 (ni_670x), PCI-6704
>> + * Status: unknown
>> +
>> + * Commands are not supported.
>> + */
>>  /*
>> -       Bart Joris <bjoris@advalvas.be> Last updated on 20/08/2001
>> -
>> -       Manuals:
>> + * Bart Joris <bjoris@advalvas.be> Last updated on 20/08/2001
>>
>> -       322110a.pdf     PCI/PXI-6704 User Manual
>> -       322110b.pdf     PCI/PXI-6703/6704 User Manual
>> + * Manuals:
>>
>> -*/
>> + * 322110a.pdf PCI/PXI-6704 User Manual
>> + * 322110b.pdf PCI/PXI-6703/6704 User Manual
>> + */
>
>
> In addition to the problems mentioned by Greg, the blank lines in those
> comment blocks also need a " *" to give an unbroken line of "*" down the
> left hand side of the comment block.
>
>>  #include <linux/module.h>
>>  #include <linux/interrupt.h>
>> @@ -147,7 +145,7 @@ static int ni_670x_dio_insn_config(struct
>> comedi_device *dev,
>>
>>  /* ripped from mite.h and mite_setup2() to avoid mite dependency */
>>  #define MITE_IODWBSR   0xc0     /* IO Device Window Base Size Register */
>> -#define WENAB          (1 << 7) /* window enable */
>> +#define WENAB          BIT(7) /* window enable */
>>
>>  static int ni_670x_mite_init(struct pci_dev *pcidev)
>>  {
>> @@ -222,7 +220,7 @@ static int ni_670x_auto_attach(struct comedi_device
>> *dev,
>>                 s->range_table_list = range_table_list;
>>                 for (i = 0; i < 16; i++) {
>>                         range_table_list[i] = &range_bipolar10;
>> -                       range_table_list[16 + i] = &range_0_20mA;
>> +                       range_table_list[16 + i] = &range_0_20ma;
>
>
> You can't just rename variables shared by other modules like that. Besides,
> the "mA" suffix is perfectly fine here, because it is the correct S.I.
> suffix for "milliamps".  (Comedi doesn't bother adding a "V" suffix for
> voltage range variables, as in the "range_bipolar10" variable below, but it
> does add a suffix for the less common units such as milliamps.)
>

Hi Ian,

Thanks, for response. I never do that changes.

This patch is failed, please ignore this.


>>                 }
>>         } else {
>>                 s->range_table = &range_bipolar10;
>>
>
>
> --
> -=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
> -=(                          Web: http://www.mev.co.uk/  )=-



Amit G

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web