All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Don Brace <don.brace@pmcs.com>
Cc: scott.teel@pmcs.com, Kevin.Barnett@pmcs.com,
	james.bottomley@parallels.com, hch@infradead.org,
	Justin.Lindley@pmcs.com, brace@pmcs.com, keescook@chromium.org,
	linux-scsi@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] hpsa: correct compiler warnings introduced by hpsa-add-local-workqueue patch
Date: Tue, 10 Feb 2015 08:56:30 -0800	[thread overview]
Message-ID: <1423587390.2167.21.camel@HansenPartnership.com> (raw)
In-Reply-To: <20150206234415.23960.78547.stgit@brunhilda>

On Fri, 2015-02-06 at 17:44 -0600, Don Brace wrote:
> Correct compiler warning introduced by hpsa-add-local-workqueue patch
> 6636e7f455b33b957c5ee016daa6de46148026ab hpsa: Use local workqueues
> instead of system workqueues
> 
> Suggested-by: Kees Cook <keescook@chromium.org>
> Reviewed-by: Scott Teel <scott.teel@pmcs.com>
> Reviewed-by: Webb Scales <webbnh@hp.com>
> Signed-off-by: Don Brace <don.brace@pmcs.com>
> ---
>  drivers/scsi/hpsa.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 95d581c..a1cfbd3 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -6831,10 +6831,8 @@ static struct workqueue_struct *hpsa_create_controller_wq(struct ctlr_info *h,
>  						char *name)
>  {
>  	struct workqueue_struct *wq = NULL;
> -	char wq_name[20];
>  
> -	snprintf(wq_name, sizeof(wq_name), "%s_%d_hpsa", name, h->ctlr);
> -	wq = alloc_ordered_workqueue(wq_name, 0);
> +	wq = alloc_ordered_workqueue("%s_%d_hpsa", 0, name, h->ctlr);

It's not an objection to your patch, but what idiot did this?  There's
an extra variable there between the format and the arguments.  That
makes the pattern counterintuitive (i.e. an interface easy to get wrong)
because everywhere else, the arguments immediately follow the format
argument.  Please never, ever do this again.

By the way, the above is rhetorical ... the culprit is in the cc.

James


  reply	other threads:[~2015-02-10 16:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 23:44 [PATCH] hpsa: correct compiler warnings introduced by hpsa-add-local-workqueue patch Don Brace
2015-02-10 16:56 ` James Bottomley [this message]
2015-02-10 17:52   ` Tejun Heo

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=1423587390.2167.21.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=Justin.Lindley@pmcs.com \
    --cc=Kevin.Barnett@pmcs.com \
    --cc=brace@pmcs.com \
    --cc=don.brace@pmcs.com \
    --cc=hch@infradead.org \
    --cc=james.bottomley@parallels.com \
    --cc=keescook@chromium.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=scott.teel@pmcs.com \
    --cc=tj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.