public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: wharms@bfs.de, "Mark A. Grondona" <mgrondona@llnl.gov>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] edac: sb_edac: add sanity check to silence static checker
Date: Tue, 1 Nov 2011 16:59:45 +0300	[thread overview]
Message-ID: <20111101135945.GA4682@mwanda> (raw)
In-Reply-To: <4EAFEBBE.3070604@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]

On Tue, Nov 01, 2011 at 10:53:18AM -0200, Mauro Carvalho Chehab wrote:
> >> --- a/drivers/edac/sb_edac.c
> >> +++ b/drivers/edac/sb_edac.c
> >> @@ -970,6 +970,12 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
> >>  			break;
> >>  		prv = limit;
> >>  	}
> >> +	if (n_tads == MAX_TAD) {
> >> +		sprintf(msg, "Could not discover the memory channel");
> > 
> > why the sprintf() ? can you not simply:
> > 	edac_mc_handle_ce_no_info(mci,"Could not discover the memory channel");
> 
> Yes, please us the edac-specific call. I'm working on some patches that will
> provide an additional functionality to those edac report calls. So, using
> sprintf() won't do the right thing after applying those patches (likely for
> Kernel v3.3).
> 

I did use the edac-specific call.  Walter is saying that the
sprintf() is not needed because I could just pass the string
directly.  That's true enough, but I'd prefer to leave it how I wrote
it so it matches everything else in this file.  Also passing it
directly as edac_mc_handle_ce_no_info(mci,"Could not discover the memory channel");
makes the line too long for the 80 character limit so someone will
complain if I do that.  This isn't a fast path so the sprintf()
doesn't hurt anything.

Also looking at it now, I suspect this patch might be a bug fix
instead of just to silence the warning.  We have a similar check for
the MAX_SAD loop earlier to the check that I added here for MAX_TAD.

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2011-11-01 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01  6:28 [patch] edac: sb_edac: add sanity check to silence static checker Dan Carpenter
2011-11-01 12:32 ` walter harms
2011-11-01 12:53   ` Mauro Carvalho Chehab
2011-11-01 13:59     ` Dan Carpenter [this message]

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=20111101135945.GA4682@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=mgrondona@llnl.gov \
    --cc=wharms@bfs.de \
    /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