From: Jean Delvare <khali@linux-fr.org>
To: Joe Perches <joe@perches.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>,
lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 32/32] drivers/hwmon/w83781d.c: Use pr_fmt and pr_<level>
Date: Tue, 9 Nov 2010 10:39:48 +0100 [thread overview]
Message-ID: <20101109103948.25919efe@endymion.delvare> (raw)
In-Reply-To: <1ce82b2a1c726d252483c508053eff046abcf132.1287556801.git.joe@perches.com>
Hi Joe,
On Tue, 19 Oct 2010 23:51:56 -0700, Joe Perches wrote:
> Added #define pr_fmt KBUILD_MODNAME ": " fmt
> Converted printks to pr_<level>
> Coalesced any long formats
> Removed prefixes from formats
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/hwmon/w83781d.c | 29 ++++++++++++++---------------
> 1 files changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
> index c84b9b4..d452a20 100644
> --- a/drivers/hwmon/w83781d.c
> +++ b/drivers/hwmon/w83781d.c
> @@ -33,6 +33,8 @@
>
> */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> #include <linux/module.h>
> #include <linux/init.h>
> #include <linux/slab.h>
> @@ -1798,8 +1800,7 @@ w83781d_isa_found(unsigned short address)
> * individually for the probing phase. */
> for (port = address; port < address + W83781D_EXTENT; port++) {
> if (!request_region(port, 1, "w83781d")) {
> - pr_debug("w83781d: Failed to request port 0x%x\n",
> - port);
> + pr_debug("Failed to request port 0x%x\n", port);
> goto release;
> }
> }
> @@ -1811,7 +1812,7 @@ w83781d_isa_found(unsigned short address)
> if (inb_p(address + 2) != val
> || inb_p(address + 3) != val
> || inb_p(address + 7) != val) {
> - pr_debug("w83781d: Detection failed at step 1\n");
> + pr_debug("Detection failed at step 1\n");
I think this would be the right time to change this to:
pr_debug("Detection failed at step %d\n", 1);
and do the same for all 6 messages below, so that the compiler can
store the string only once in the binary.
> goto release;
> }
> #undef REALLY_SLOW_IO
> @@ -1820,14 +1821,14 @@ w83781d_isa_found(unsigned short address)
> MSB (busy flag) should be clear initially, set after the write. */
> save = inb_p(address + W83781D_ADDR_REG_OFFSET);
> if (save & 0x80) {
> - pr_debug("w83781d: Detection failed at step 2\n");
> + pr_debug("Detection failed at step 2\n");
> goto release;
> }
> val = ~save & 0x7f;
> outb_p(val, address + W83781D_ADDR_REG_OFFSET);
> if (inb_p(address + W83781D_ADDR_REG_OFFSET) != (val | 0x80)) {
> outb_p(save, address + W83781D_ADDR_REG_OFFSET);
> - pr_debug("w83781d: Detection failed at step 3\n");
> + pr_debug("Detection failed at step 3\n");
> goto release;
> }
>
> @@ -1835,7 +1836,7 @@ w83781d_isa_found(unsigned short address)
> outb_p(W83781D_REG_CONFIG, address + W83781D_ADDR_REG_OFFSET);
> val = inb_p(address + W83781D_DATA_REG_OFFSET);
> if (val & 0x80) {
> - pr_debug("w83781d: Detection failed at step 4\n");
> + pr_debug("Detection failed at step 4\n");
> goto release;
> }
> outb_p(W83781D_REG_BANK, address + W83781D_ADDR_REG_OFFSET);
> @@ -1844,19 +1845,19 @@ w83781d_isa_found(unsigned short address)
> val = inb_p(address + W83781D_DATA_REG_OFFSET);
> if ((!(save & 0x80) && (val != 0xa3))
> || ((save & 0x80) && (val != 0x5c))) {
> - pr_debug("w83781d: Detection failed at step 5\n");
> + pr_debug("Detection failed at step 5\n");
> goto release;
> }
> outb_p(W83781D_REG_I2C_ADDR, address + W83781D_ADDR_REG_OFFSET);
> val = inb_p(address + W83781D_DATA_REG_OFFSET);
> if (val < 0x03 || val > 0x77) { /* Not a valid I2C address */
> - pr_debug("w83781d: Detection failed at step 6\n");
> + pr_debug("Detection failed at step 6\n");
> goto release;
> }
>
> /* The busy flag should be clear again */
> if (inb_p(address + W83781D_ADDR_REG_OFFSET) & 0x80) {
> - pr_debug("w83781d: Detection failed at step 7\n");
> + pr_debug("Detection failed at step 7\n");
> goto release;
> }
>
> @@ -1871,7 +1872,7 @@ w83781d_isa_found(unsigned short address)
> found = 1;
>
> if (found)
> - pr_info("w83781d: Found a %s chip at %#x\n",
> + pr_info("Found a %s chip at %#x\n",
> val == 0x30 ? "W83782D" : "W83781D", (int)address);
>
> release:
> @@ -1894,21 +1895,19 @@ w83781d_isa_device_add(unsigned short address)
> pdev = platform_device_alloc("w83781d", address);
> if (!pdev) {
> err = -ENOMEM;
> - printk(KERN_ERR "w83781d: Device allocation failed\n");
> + pr_err("Device allocation failed\n");
> goto exit;
> }
>
> err = platform_device_add_resources(pdev, &res, 1);
> if (err) {
> - printk(KERN_ERR "w83781d: Device resource addition failed "
> - "(%d)\n", err);
> + pr_err("Device resource addition failed (%d)\n", err);
> goto exit_device_put;
> }
>
> err = platform_device_add(pdev);
> if (err) {
> - printk(KERN_ERR "w83781d: Device addition failed (%d)\n",
> - err);
> + pr_err("Device addition failed (%d)\n", err);
> goto exit_device_put;
> }
>
--
Jean Delvare
next prev parent reply other threads:[~2010-11-09 9:40 UTC|newest]
Thread overview: 104+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 23:13 [PATCH] drivers/hwmon: Use pr_fmt and pr_<level> Joe Perches
2010-10-20 3:29 ` Guenter Roeck
2010-10-20 3:34 ` Joe Perches
2010-10-20 3:53 ` Guenter Roeck
2010-10-20 4:07 ` Joe Perches
2010-10-20 6:04 ` Henrik Rydberg
2010-10-20 7:34 ` Jean Delvare
2010-10-20 14:46 ` Guenter Roeck
2010-10-20 16:08 ` Joe Perches
2010-10-20 16:45 ` Jean Delvare
2010-10-20 16:38 ` Jean Delvare
2010-10-20 16:43 ` Guenter Roeck
2010-10-20 16:46 ` Jean Delvare
2010-10-20 18:03 ` Guenter Roeck
2010-10-20 16:27 ` Joe Perches
2010-10-20 16:42 ` Jean Delvare
2010-10-20 6:51 ` [PATCH 00/32] " Joe Perches
2010-10-20 6:51 ` [PATCH 01/32] drivers/hwmon/abituguru.c: " Joe Perches
2010-11-09 16:25 ` [01/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 02/32] drivers/hwmon/abituguru3.c: " Joe Perches
2010-11-09 16:28 ` [02/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 03/32] drivers/hwmon/adt7470.c: " Joe Perches
2010-11-09 16:29 ` [03/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 04/32] drivers/hwmon/applesmc.c: " Joe Perches
2010-10-20 9:54 ` Henrik Rydberg
2010-11-09 16:35 ` [04/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 05/32] drivers/hwmon/asb100.c: " Joe Perches
2010-11-09 16:35 ` [05/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 06/32] drivers/hwmon/asus_atk0110.c: " Joe Perches
2010-11-09 16:37 ` [06/32] " Guenter Roeck
2010-11-09 20:15 ` Luca Tettamanti
2010-11-09 20:34 ` Guenter Roeck
2010-10-20 6:51 ` [PATCH 07/32] drivers/hwmon/coretemp.c: " Joe Perches
2010-11-09 16:38 ` [07/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 08/32] drivers/hwmon/dme1737.c: " Joe Perches
2010-11-09 16:39 ` [08/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 09/32] drivers/hwmon/f71805f.c: " Joe Perches
2010-11-09 16:40 ` [09/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 10/32] drivers/hwmon/f71882fg.c: " Joe Perches
2010-11-09 16:41 ` [10/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 11/32] drivers/hwmon/hp_accel.c: " Joe Perches
2010-11-09 16:42 ` [11/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 12/32] drivers/hwmon/hwmon-vid.c: " Joe Perches
2010-11-09 16:43 ` [12/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 13/32] drivers/hwmon/hwmon.c: " Joe Perches
2010-11-09 16:44 ` [13/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 14/32] drivers/hwmon/ibmaem.c: " Joe Perches
2010-11-09 16:44 ` [14/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 15/32] drivers/hwmon/it87.c: " Joe Perches
2010-11-09 9:21 ` Jean Delvare
2010-10-20 6:51 ` [PATCH 16/32] drivers/hwmon/lis3lv02d.c: " Joe Perches
2010-11-09 16:46 ` [16/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 17/32] drivers/hwmon/lm70.c: " Joe Perches
2010-11-09 16:47 ` [17/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 18/32] drivers/hwmon/lm78.c: " Joe Perches
2010-11-09 9:25 ` Jean Delvare
2010-10-20 6:51 ` [PATCH 19/32] drivers/hwmon/pc87360.c: " Joe Perches
2010-11-09 9:31 ` Jean Delvare
2010-11-09 9:59 ` Joe Perches
2010-11-09 12:08 ` Jean Delvare
2010-10-20 6:51 ` [PATCH 20/32] drivers/hwmon/pc87427.c: " Joe Perches
2010-11-09 9:35 ` Jean Delvare
2010-10-20 6:51 ` [PATCH 21/32] drivers/hwmon/pcf8591.c: " Joe Perches
2010-11-09 16:49 ` [21/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 22/32] drivers/hwmon/pkgtemp.c: " Joe Perches
2010-11-09 16:50 ` [22/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 23/32] drivers/hwmon/sis5595.c: " Joe Perches
2010-11-09 16:51 ` [23/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 24/32] drivers/hwmon/smsc47b397.c: " Joe Perches
2010-11-09 16:51 ` [24/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 25/32] drivers/hwmon/smsc47m1.c: " Joe Perches
2010-11-09 16:52 ` [25/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 26/32] drivers/hwmon/via-cputemp.c: " Joe Perches
2010-11-09 16:53 ` [26/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 27/32] drivers/hwmon/via686a.c: " Joe Perches
2010-11-09 16:54 ` [27/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 28/32] drivers/hwmon/vt1211.c: " Joe Perches
2010-11-09 16:57 ` [28/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 29/32] drivers/hwmon/vt8231.c: " Joe Perches
2010-11-09 16:58 ` [29/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 30/32] drivers/hwmon/w83627ehf.c: " Joe Perches
2010-11-09 16:59 ` [30/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 31/32] drivers/hwmon/w83627hf.c: " Joe Perches
2010-11-09 17:00 ` [31/32] " Guenter Roeck
2010-10-20 6:51 ` [PATCH 32/32] drivers/hwmon/w83781d.c: " Joe Perches
2010-11-09 9:39 ` Jean Delvare [this message]
2010-11-09 10:04 ` Joe Perches
2010-10-20 7:42 ` [PATCH] drivers/hwmon: " Jean Delvare
2010-10-20 15:59 ` Joe Perches
2010-10-20 16:49 ` Guenter Roeck
2010-10-20 16:54 ` Joe Perches
2010-10-20 17:18 ` Guenter Roeck
2010-10-20 17:28 ` Joe Perches
2010-10-20 17:48 ` Guenter Roeck
2010-10-20 18:02 ` Joe Perches
2010-10-20 18:35 ` Guenter Roeck
2010-10-20 19:08 ` Joe Perches
2010-10-20 19:57 ` Jean Delvare
2010-10-20 19:19 ` Davidlohr Bueso
2010-10-20 19:38 ` Jean Delvare
2010-10-20 19:52 ` Joe Perches
2010-10-20 19:59 ` Joe Perches
2010-10-20 20:36 ` Jim Cromie
2010-10-20 20:13 ` Jean Delvare
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=20101109103948.25919efe@endymion.delvare \
--to=khali@linux-fr.org \
--cc=guenter.roeck@ericsson.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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