public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>,
	linux-driver@qlogic.com,
	"James E.J. Bottomley" <jbottomley@parallels.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] qla2xxx: Rewrite logging functions to use %pV
Date: Sun, 31 Jul 2011 01:08:50 -0700	[thread overview]
Message-ID: <1312099730.1558.7.camel@Joe-Laptop> (raw)
In-Reply-To: <256822902b9b2221e206b75f384bdc68.squirrel@webmail.sf-mail.de>

On Sun, 2011-07-31 at 10:02 +0200, Rolf Eike Beer wrote:
> > +	if (vha != NULL) {
> > +		const struct pci_dev *pdev = vha->hw->pdev;
> > +		/* <module-name> <pci-name> <msg-id>:<host> Message */
> > +		pr_warn("%s [%s]-%04x:%ld: %pV",
> > +			QL_MSGHDR, dev_name(&(pdev->dev)), id + ql_dbg_offset,
> > +			vha->host_no, &vaf);
> > +	} else {
> > +		pr_warn("%s [%s]-%04x: : %pV",
> > +			QL_MSGHDR, "0000:00:00.0", id + ql_dbg_offset, &vaf);
> >  	}
> If I would see 0000:00:00.0 in the logmessage I would become scared that
> something is dereferencing cleared memory, use after free or whatever.
> Only by looking into the code I could see that this code simply has no
> idea which device it is on. Well, then don't print an address when you
> don't have one instead of inventing one.

I don't disagree, but that's for Andrew to figure out
in a separate patch.

I just want to make the code smaller.

The output of the new code is the same as the old code.


  reply	other threads:[~2011-07-31  8:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-30 23:05 [PATCH 0/2] qla2xxx: logging functions fixups Joe Perches
2011-07-30 23:05 ` [PATCH 1/2] qla2xxx: Rewrite logging functions to use %pV Joe Perches
2011-07-31  8:02   ` Rolf Eike Beer
2011-07-31  8:08     ` Joe Perches [this message]
2011-08-09 20:54   ` Saurav Kashyap
2011-07-30 23:05 ` [PATCH 2/2] qla2xxx: Add __attribute__((format(printf... and fix fallout Joe Perches
2011-08-09 20:55   ` Saurav Kashyap

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=1312099730.1558.7.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=eike-kernel@sf-tec.de \
    --cc=jbottomley@parallels.com \
    --cc=linux-driver@qlogic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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