lkml.org 
[lkml]   [2016]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/6] staging: comedi: ni_at_a2150.c: Fix checkpatch warning
On Thu, Aug 25, 2016 at 11:16:13AM -0400, Anson Jacob wrote:
> Fix checkpatch.pl warning 'line over 80 characters'
>
> Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com>
> ---
> drivers/staging/comedi/drivers/ni_at_a2150.c | 82 ++++++++++++++++------------
> 1 file changed, 46 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c
> index 957fb9f..3c00de1 100644
> --- a/drivers/staging/comedi/drivers/ni_at_a2150.c
> +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
> @@ -58,41 +58,49 @@
>
> /* Registers and bits */
> #define CONFIG_REG 0x0
> -#define CHANNEL_BITS(x) ((x) & 0x7)
> -#define CHANNEL_MASK 0x7
> -#define CLOCK_SELECT_BITS(x) (((x) & 0x3) << 3)

You have lost this treeish look which carried information about thing
being a register or a field.

> +#define CHANNEL_BITS(x) ((x) & 0x7)
> +#define CHANNEL_MASK 0x7

No uniform alignment. Please get everything in a row.
If it's hard or this part of driver is expected to have a lot of changes
in near future, then I'd remove any whitespace over single space between
name and value.

> +#define ENABLE0_BIT 0x80 /* enable (don't internally ground)
> + * channels 0 and 1
> + */
> +#define ENABLE1_BIT 0x100 /* enable (don't internally ground)
> + * channels 2 and 3
> + */

This commenting style is discouraged (Linus has even stated explicitly
that he dislikes it, even for pieces of code which historically had this
style everywhere). Opening "/*" should not be followed by text.

Also, In my personal experience, it is more stable to have these
comments on previous line, not at end of the line. This way you always
have enough space for both a comment and a macro.

\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.045 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site