From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tlclk.c: pointers are handled by %p
Date: Thu, 15 Dec 2005 09:57:54 +0000 [thread overview]
Message-ID: <20051215095754.GA32490@flint.arm.linux.org.uk> (raw)
In-Reply-To: <E1EmpFz-00080I-2r@ZenIV.linux.org.uk>
On Thu, Dec 15, 2005 at 09:18:35AM +0000, Al Viro wrote:
> diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
> index 12167c0..e8467dc 100644
> --- a/drivers/char/tlclk.c
> +++ b/drivers/char/tlclk.c
> @@ -776,8 +776,8 @@ static int __init tlclk_init(void)
> tlclk_device = platform_device_register_simple("telco_clock",
> -1, NULL, 0);
> if (!tlclk_device) {
> - printk(KERN_ERR " platform_device_register retruns 0x%X\n",
> - (unsigned int) tlclk_device);
> + printk(KERN_ERR " platform_device_register retruns 0x%p\n",
> + tlclk_device);
This looks really strange - we know what tlclk_device will be at that
printk - it'll be NULL because if it's anything different we wouldn't
be inside this if(){ }.
Moreover, this code is obviously bogus. platform_device_register_simple
does not return NULL for the error case. It should be something like:
if (IS_ERR(tlclk_device)) {
ret = PTR_ERR(tlclk_device);
printk(KERN_ERR "platform_device_register returns %d\n",
ret);
goto out4;
}
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2005-12-15 9:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-15 9:18 [PATCH] tlclk.c: pointers are handled by %p Al Viro
2005-12-15 9:57 ` Russell King [this message]
2005-12-16 6:55 ` Dmitry Torokhov
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=20051215095754.GA32490@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=viro@ftp.linux.org.uk \
/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