public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Joe Perches <joe@perches.com>
Cc: Nicolas Thery <nthery@gmail.com>,
	marek.belisko@gmail.com, me@aldo.io, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: ft1000: fix some checkpatch complaints
Date: Sun, 27 Jul 2014 10:35:38 -0700	[thread overview]
Message-ID: <20140727173538.GA27056@kroah.com> (raw)
In-Reply-To: <1406481833.5285.6.camel@joe-AO725>

On Sun, Jul 27, 2014 at 10:23:53AM -0700, Joe Perches wrote:
> On Sun, 2014-07-27 at 19:08 +0200, Nicolas Thery wrote:
> > This patch fixes the following errors and warnings:
> []
> > diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c
> []
> > @@ -23,34 +23,38 @@
> []
> > -#define seq_putx(m, message, size, var) \
> > +#define seq_putx(m, message, size, var) do { \
> >  	seq_printf(m, message);	\
> >  	for (i = 0; i < (size - 1); i++) { \
> >  		seq_printf(m, "%02x:", var[i]); \
> >  	} \
> > -	seq_printf(m, "%02x\n", var[i])
> > +	seq_printf(m, "%02x\n", var[i]); \
> > +} while (0)
> 
> Ideally, these wouldn't depend on an external
> i variable.
> 
> Maybe something like:
> 
> #define seq_putx(m, message, size, var) \
> do { \
> 	int _i; \
>  	seq_printf(m, message);	\
>  	for (_i = 0; _i < (size - 1); _i++) \
>  		seq_printf(m, "%02x:", var[_i]); \
> 	seq_printf(m, "%02x\n", var[_i]); \
> } while (0)
>  
> > -#define seq_putd(m, message, size, var) \
> > +#define seq_putd(m, message, size, var) do { \
> >  	seq_printf(m, message); \
> >  	for (i = 0; i < (size - 1); i++) { \
> >  		seq_printf(m, "%d.", var[i]); \
> >  	} \
> > -	seq_printf(m, "%d\n", var[i])
> > +	seq_printf(m, "%d\n", var[i]); \
> > +} while (0)
> 
> Maybe later change these to use the recently introduced
> seq_hex_dump: https://lkml.org/lkml/2014/7/11/269
> 

How about removing the proc files entirely, as I doubt they are really
needed :)

thanks,

greg k-h

  reply	other threads:[~2014-07-27 17:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-27 17:08 [PATCH] staging: ft1000: fix some checkpatch complaints Nicolas Thery
2014-07-27 17:23 ` Joe Perches
2014-07-27 17:35   ` Greg KH [this message]
2014-07-27 17:40     ` Joe Perches
2014-07-27 17:40     ` Nicolas Thery

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=20140727173538.GA27056@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.belisko@gmail.com \
    --cc=me@aldo.io \
    --cc=nthery@gmail.com \
    /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