From: Joe Perches <joe@perches.com>
To: Przemo Firszt <przemo@firszt.eu>
Cc: Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com,
greg@kroah.com, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] rtl8712: replace printk with better solutions
Date: Sun, 09 Dec 2012 03:47:30 -0800 [thread overview]
Message-ID: <1355053650.5901.44.camel@joe-AO722> (raw)
In-Reply-To: <1355048110-10859-3-git-send-email-przemo@firszt.eu>
On Sun, 2012-12-09 at 10:15 +0000, Przemo Firszt wrote:
> Replace printk with netdev_printk helpers, dev_printk helpers or
> pr_err/warn/info if there is no device info available.
Here's a few trivial comments
> @@ -84,8 +83,8 @@ static u32 rtl871x_open_fw(struct _adapter *padapter, const u8 **ppmappedfw)
> const struct firmware **praw = &padapter->fw;
>
> if (padapter->fw->size > 200000) {
> - printk(KERN_ERR "r8172u: Badfw->size of %d\n",
> - (int)padapter->fw->size);
> + dev_err(&padapter->pnetdev->dev, "r8172u: Badfw->size of %d\n",
> + (int)padapter->fw->size);
Please align arguments to the open parenthesis
like this:
dev_err(dev, format,
args);
If you are using checkpatch, add --strict to get the
script to tell you when the alignment isn't correct.
> diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
[]
> @@ -829,8 +826,7 @@ static int r871x_wx_set_pmkid(struct net_device *dev,
> strIssueBssid, ETH_ALEN)) {
> /* BSSID is matched, the same AP => rewrite
> * with new PMKID. */
> - printk(KERN_INFO "r8712u: r871x_wx_set_pmkid:"
> - " BSSID exists in the PMKList.\n");
> + netdev_info(dev, "r8712u: r871x_wx_set_pmkid: BSSID exists in the PMKList.\n");
when the format contains the function name, convert
it to use %s, ... __func__
Remove unnecessary trailing periods from the formats.
netdev_info(dev, "%s: BSSID exists in the PMKList\n",
__func__);
> diff --git a/drivers/staging/rtl8712/usb_ops_linux.c b/drivers/staging/rtl8712/usb_ops_linux.c
[]
> @@ -243,8 +243,7 @@ static void r8712_usb_read_port_complete(struct urb *purb)
> (unsigned char *)precvbuf);
> break;
> case -EINPROGRESS:
> - printk(KERN_ERR "r8712u: ERROR: URB IS IN"
> - " PROGRESS!/n");
> + netdev_err(padapter->pnetdev, "ERROR: URB IS IN PROGRESS!/n");
newlines are \n not /n
> diff --git a/drivers/staging/rtl8712/xmit_linux.c b/drivers/staging/rtl8712/xmit_linux.c
[]
> @@ -134,8 +134,7 @@ int r8712_xmit_resource_alloc(struct _adapter *padapter,
> for (i = 0; i < 8; i++) {
> pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
> if (pxmitbuf->pxmit_urb[i] == NULL) {
> - printk(KERN_ERR "r8712u: pxmitbuf->pxmit_urb[i]"
> - " == NULL");
> + netdev_err(padapter->pnetdev, "pxmitbuf->pxmit_urb[i] == NULL");
Make sure message formats are newline terminated.
next prev parent reply other threads:[~2012-12-09 11:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-09 10:15 [PATCH 1/5] rtl8712: code clean up Przemo Firszt
2012-12-09 10:15 ` [PATCH 2/5] rtl8712: remove unused macros from rtl8712/wifi.h Przemo Firszt
2012-12-09 10:15 ` [PATCH 3/5] rtl8712: replace printk with better solutions Przemo Firszt
2012-12-09 11:47 ` Joe Perches [this message]
2012-12-09 10:15 ` [PATCH 4/5] rtl8712: replace min with min_t Przemo Firszt
2012-12-10 9:41 ` Dan Carpenter
2012-12-10 22:21 ` Przemo Firszt
2012-12-10 22:49 ` Dan Carpenter
2012-12-10 23:20 ` Przemo Firszt
2012-12-09 10:15 ` [PATCH 5/5] rtl8712: replace leading spaces with tab Przemo Firszt
2012-12-10 9:46 ` Dan Carpenter
2012-12-10 11:49 ` Joe Perches
2012-12-10 12:21 ` Dan Carpenter
2012-12-10 13:47 ` Joe Perches
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=1355053650.5901.44.camel@joe-AO722 \
--to=joe@perches.com \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=florian.c.schilhabel@googlemail.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=przemo@firszt.eu \
/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
all inboxes | Powered by JetHome®