lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4E27039C-DE6B-4C90-ADC5-68D3B30F75E6@gmail.com>
Date:	Tue, 26 Oct 2010 18:28:19 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Jiri Kosina <trivial@...nel.org>,
	"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/10] drivers/input/serio/i8042: Use pr_<level>, pr_fmt. Fix dbg and __FILE__ use

On Oct 26, 2010, at 6:10 PM, Joe Perches <joe@...ches.com> wrote:

> On Tue, 2010-10-26 at 18:00 -0700, Dmitry Torokhov wrote:
>> On Oct 26, 2010, at 5:46 PM, Joe Perches <joe@...ches.com> wrote:
>>> On Tue, 2010-10-26 at 17:40 -0700, Dmitry Torokhov wrote:
>>>>> Mind if I move the time to the front like this?
>>>>> +#define dbg(format, arg...)                                            \
>>>>> +do {                                    \
>>>>> +    if (i8042_debug)                        \
>>>>> +        printk(KERN_DEBUG KBUILD_MODNAME ": [%d]" format),    \
>>>>> +                      (int)(jiffies - i8042_start_time), ##arg);    \
>>>>> +} while (0)
>>>> Another option would be to leave '\n' in dbg() and leave most of the
>>>> callers as is.
>>> That's really error prone though.
>> In what way?
> 
> $ grep -w dbg drivers/input/serio/i8042.c | cat -n
>     1            dbg("%02x <- i8042 (flush, %s)", data,
>     2        dbg("%02x -> i8042 (command)", command & 0xff);
>     3            dbg("%02x -> i8042 (parameter)", param[i]);
>     4                dbg("     -- i8042 (timeout)");
>     5                dbg("     -- i8042 (auxerr)");
>     6            dbg("%02x <- i8042 (return)", param[i]);
>     7            dbg("%02x -> i8042 (kbd-data)", c);
>     8                dbg("Extra keyboard ACK - filtered out\n");
>     9            dbg("Filtered out by platform filter\n");
>    10            if (irq) dbg("Interrupt %d, without any data", irq);
>    11                dbg("MUX error, status is %02x, data is %02x", str, data);
>    12        dbg("%02x <- i8042 (interrupt, %d, %d%s%s)",
>    13            dbg("%02x <- i8042 (aux_test_irq, %s)",
>    14            dbg("     -- i8042 (aux irq test timeout)");
>    15        dbg("%02x -> i8042 (panic blink)", 0xed);
>    16        dbg("%02x -> i8042 (panic blink)", led);
> 
> I think 2 defects in 16 uses is a pretty high error rate.

But how not adding /n is it much better than having it if some later change will forget to add it to the message?

-- 
Dmitry


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ