linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Borislav Petkov <bbpetkov@yahoo.de>
Cc: linux-ide <linux-ide@vger.kernel.org>, Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [PATCH 1/9] libata: change debugging macros/adjust dbg levels
Date: Fri, 30 Jun 2006 03:09:16 +0900	[thread overview]
Message-ID: <44A4174C.7020109@gmail.com> (raw)
In-Reply-To: <20060629172715.GA21339@gollum.tnic>

Borislav Petkov wrote:
> On Fri, Jun 30, 2006 at 01:27:30AM +0900, Tejun Heo wrote:
> <snip>
>>> @@ -805,11 +807,16 @@ extern void ata_do_eh(struct ata_port *a
>>> /*
>>>  * printk helpers
>>>  */
>>> -#define ata_port_printk(ap, lv, fmt, args...) \
>>> -	printk(lv"ata%u: "fmt, (ap)->id , ##args)
>>> +#define ata_port_printk(ap, lv, fmt, args...) do { \
>>> +	if (unlikely((ap)->msg_enable & (0xFF & (lv)))) \
>>                                          ^^^^why?
> Because the decimal value of ATA_MSG_TRACE, for example, is 128 (hex 0x80) and
> when i shift a 1 128 time to the left, the datatype, in our case an int, i
> think (dunno what gcc does exactly here) is too small for the shift. Besides,
> ap->msg_enable is an u32 so that if would never be true for something bigger
> than 0x20.

Please make

+	ATA_MSG_ERR	= 0,
+	ATA_MSG_WARN	= 1,
+	ATA_MSG_DRV	= 2,
+	ATA_MSG_INFO	= 3, /* revalidation messages, EH progress */
+	ATA_MSG_VDEBUG	= 4, /* verbose hot path */
+	ATA_MSG_CMD	= 5, /* issue / completion */
+	ATA_MSG_SG	= 6, /* SG map/unmap handling */
+	ATA_MSG_TRACE	= 7, /* function tracing, e.g. enter/exit */

And test for msg_enable & (1 << (lv)).  Otherwise the array will be 
unnecessarily large.

-- 
tejun

  reply	other threads:[~2006-06-29 18:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 16:09 [PATCH 1/9] libata: change debugging macros/adjust dbg levels Borislav Petkov
2006-06-29 16:27 ` Tejun Heo
2006-06-29 17:27   ` Borislav Petkov
2006-06-29 18:09     ` Tejun Heo [this message]
2006-06-29 20:53       ` Borislav Petkov
2006-06-29 21:19         ` Tejun Heo
2006-06-29 21:22           ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2006-06-30  6:45 Borislav Petkov

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=44A4174C.7020109@gmail.com \
    --to=htejun@gmail.com \
    --cc=bbpetkov@yahoo.de \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).