From: Goffredo Baroncelli <kreijack@gmail.com>
To: Jean Delvare <jdelvare@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] Add the "verbose" module option.
Date: Thu, 07 Aug 2014 18:52:52 +0200 [thread overview]
Message-ID: <53E3AEE4.1080100@gmail.com> (raw)
In-Reply-To: <20140807184316.6682aa98@endymion.delvare>
On 08/07/2014 06:43 PM, Jean Delvare wrote:
> On Thu, 07 Aug 2014 18:29:23 +0200, Goffredo Baroncelli wrote:
>> On 08/07/2014 10:52 AM, Jean Delvare wrote:
>>> Le Wednesday 06 August 2014 à 21:05 +0000, Goffredo Baroncelli a écrit :
>>>> + */
>>>> + tempchanged = x.temp != temp || x.casetemp != casetemp;
>>>> + if ((verbose > 1 && tempchanged) ||
>>>> + (verbose > 0 && level >= 0)) {
>>>> + printk(KERN_INFO);
>>>> + print_temp("CPU-temp: ", temp);
>>>
>>> This can be written more efficiently as a single statement:
>>>
>>> print_temp(KERN_INFO "CPU-temp: ", temp);
>>
>> I suppose that KERN_* has to be in the beginning of the line.
>
> Correct.
>
>> Because a single line is composed by several prink,
>
> In this case, it is, but FYI, this is generally discouraged. The reason
> is that another piece of the kernel may be calling printk at the same
> time, and then that other message may split your own message into
> pieces. If you run checkpatch.pl on this file, you'll see it complains
> about this.
>
>> KERN_INFO has
>> to be only in the first printk. To me it seems more polite to have
>> one printk for the level, and the others (there are more than one)
>> for the message parts.
>
> The fewer printks is better. Ideally there would be only one to avoid
> the risk of line splitting altogether. I understand this isn't easy to
> achieve in this case, but I still believe that you shouldn't have more
> calls to printk than necessary, to reduce the risk.
>
Ok, now I understand the reason. I will remove the first printk.
--
gpg @keyserver.linux.it: Goffredo Baroncelli (kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5
next prev parent reply other threads:[~2014-08-07 16:47 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 21:04 [PATCH][v3] therm_windtunnel doesn't work properly on PowerMac G4 Goffredo Baroncelli
2014-08-06 21:04 ` [PATCH 1/5] Update drivers names to the ones invoked by i2c-powermac Goffredo Baroncelli
2014-08-06 21:05 ` [PATCH 2/5] Remove attach_method because un-used Goffredo Baroncelli
2014-08-07 8:39 ` Jean Delvare
2014-08-06 21:05 ` [PATCH 3/5] Add the "verbose" module option Goffredo Baroncelli
2014-08-07 8:52 ` Jean Delvare
2014-08-07 16:29 ` Goffredo Baroncelli
2014-08-07 16:43 ` Jean Delvare
2014-08-07 16:52 ` Goffredo Baroncelli [this message]
2014-08-06 21:05 ` [PATCH 4/5] Return the fan speed via sysfs Goffredo Baroncelli
2014-08-06 21:05 ` [PATCH 5/5] Export the temperatures via hwmon Goffredo Baroncelli
2014-08-06 23:18 ` Guenter Roeck
2014-08-07 6:03 ` Goffredo Baroncelli
2014-08-07 6:20 ` Guenter Roeck
2014-08-07 6:52 ` Jean Delvare
2014-08-07 7:36 ` Guenter Roeck
2014-08-07 8:35 ` Jean Delvare
2014-08-07 14:19 ` Guenter Roeck
2014-08-07 17:50 ` Goffredo Baroncelli
2014-08-07 18:16 ` Guenter Roeck
2014-08-07 19:27 ` Goffredo Baroncelli
2014-08-07 21:19 ` Matt Helsley
2014-08-08 14:54 ` Goffredo Baroncelli
2014-08-08 16:30 ` Guenter Roeck
2014-08-08 16:58 ` Goffredo Baroncelli
-- strict thread matches above, loose matches on Subject: below --
2014-08-07 19:08 [PATCH][v4] therm_windtunnel does not work properly on PowerMac G4 Goffredo Baroncelli
2014-08-07 19:08 ` [PATCH 3/5] Add the "verbose" module option Goffredo Baroncelli
2014-08-09 6:49 [PATCH][v5] therm_windtunnel does not work properly on PowerMac G4 Goffredo Baroncelli
2014-08-09 6:50 ` [PATCH 3/5] Add the "verbose" module option Goffredo Baroncelli
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=53E3AEE4.1080100@gmail.com \
--to=kreijack@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=jdelvare@suse.de \
--cc=kreijack@inwind.it \
--cc=linux-kernel@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