From: Andrey Utkin <andrey_utkin@fastmail.com>
To: Anson Jacob <ansonjacob.aj@gmail.com>
Cc: gregkh@linuxfoundation.org, abbotti@mev.co.uk,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] staging: comedi: ni_at_a2150.c: Fix checkpatch warning
Date: Thu, 25 Aug 2016 18:47:08 +0300 [thread overview]
Message-ID: <20160825154708.a55hsffnfdz2zqac@acer> (raw)
In-Reply-To: <b2cf771e244dce8e6b2c40020b637b1fed66f8cd.1472100602.git.ansonjacob.aj@gmail.com>
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.
next prev parent reply other threads:[~2016-08-25 16:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-25 15:14 [PATCH 0/6] staging: comedi: cb_pcidas64.c: " Anson Jacob
2016-08-25 15:15 ` [PATCH 1/6] " Anson Jacob
2016-08-25 15:15 ` [PATCH 2/6] staging: comedi: jr3_pci.h: " Anson Jacob
2016-08-25 15:15 ` [PATCH 3/6] staging: comedi: ni_atmio.c: " Anson Jacob
2016-08-25 15:15 ` [PATCH 4/6] staging: comedi: s626.h: " Anson Jacob
2016-08-25 15:15 ` [PATCH 5/6] staging: comedi: jr3_pci.c: " Anson Jacob
2016-08-25 15:16 ` [PATCH 6/6] staging: comedi: ni_at_a2150.c: " Anson Jacob
2016-08-25 15:47 ` Andrey Utkin [this message]
2016-08-25 16:09 ` Anson Jacob
2016-08-25 16:18 ` Andrey Utkin
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=20160825154708.a55hsffnfdz2zqac@acer \
--to=andrey_utkin@fastmail.com \
--cc=abbotti@mev.co.uk \
--cc=ansonjacob.aj@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.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®