All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <jbottomley@parallels.com>
To: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	target-devel <target-devel@vger.kernel.org>,
	Andrew Vasquez <andrew.vasquez@qlogic.com>,
	Giridhar Malavali <giridhar.malavali@qlogic.com>,
	Roland Dreier <roland@purestorage.com>,
	Joern Engel <joern@logfs.org>
Subject: Re: [PATCH] qla2xxx: Don't memset buffer unless debug level is enabled
Date: Thu, 1 Dec 2011 18:07:43 +0000	[thread overview]
Message-ID: <1322762860.6920.47.camel@dabdike> (raw)
In-Reply-To: <alpine.WNT.2.00.1112011259150.1224@N5102REMCQXM4BS.qlogic.org>

On Thu, 2011-12-01 at 13:01 -0500, Chad Dupuis wrote:
> 
> On Thu, 1 Dec 2011, Nicholas A. Bellinger wrote:
> 
> > On Thu, 2011-12-01 at 09:12 +0100, Sebastian Andrzej Siewior wrote:
> >> On 11/30/2011 11:03 PM, Nicholas A. Bellinger wrote:
> >>> diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
> >>> index 07372de..cc32ec8 100644
> >>> --- a/drivers/scsi/qla2xxx/qla_dbg.c
> >>> +++ b/drivers/scsi/qla2xxx/qla_dbg.c
> >>> @@ -1676,11 +1676,11 @@ ql_dbg(uint32_t level, scsi_qla_host_t *vha, int32_t id, char *msg, ...) {
> >>>     uint32_t len;
> >>>     struct pci_dev *pdev = NULL;
> >>>
> >>> -   memset(pbuf, 0, QL_DBG_BUF_LEN);
> >>> -
> >>>     va_start(ap, msg);
> >>>
> >>>     if ((level&  ql2xextended_error_logging) == level) {
> >>> +           memset(pbuf, 0, QL_DBG_BUF_LEN);
> >>> +
> >>
> >> 512bytes on the stack is brave.
> >
> > ...
> >
> >>  Anyway, why do you memset the whole
> >> buffer? As far the string processing is concerned, setting the first
> >> byte to zero is enough.
> >>
> >
> > After converting qla_target.c in a few hundred locations to use
> > qla_dbg() my wrists are still hurting, so you can imagine I'm not real
> > eager to look into this code.  ;)
> >
> > Anyways, memset of the whole buffer is overkill.  Since sprintf() is
> > being used for qla_dbg.c cases, even the 1 byte memset is unnecessary.
> 
> I do want to note that there is a patch posted already that removes the
> memset as well:
> http://marc.info/?l=linux-scsi&m=132163664809856&w=2.

So since that one came from you as part of a series, I was originally
planning to merge it before you acked this one, which basically makes
this one redundant (and conflicting), doesn't it?  Which patch did you
want me to take, since I can't take both?

James


  reply	other threads:[~2011-12-01 18:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30 22:03 [PATCH] qla2xxx: Don't memset buffer unless debug level is enabled Nicholas A. Bellinger
2011-11-30 22:33 ` Chad Dupuis
2011-12-01  8:12 ` Sebastian Andrzej Siewior
2011-12-01  9:21   ` Nicholas A. Bellinger
2011-12-01 18:01     ` Chad Dupuis
2011-12-01 18:07       ` James Bottomley [this message]
2011-12-01 18:43         ` Chad Dupuis

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=1322762860.6920.47.camel@dabdike \
    --to=jbottomley@parallels.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=bigeasy@linutronix.de \
    --cc=chad.dupuis@qlogic.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=joern@logfs.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=roland@purestorage.com \
    --cc=target-devel@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 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.