From: Stephen Boyd <sboyd@codeaurora.org>
To: Venu Byravarasu <vbyravarasu@nvidia.com>
Cc: "a.zummo@towertech.it" <a.zummo@towertech.it>,
"sameo@linux.intel.com" <sameo@linux.intel.com>,
"broonie@opensource.wolfsonmicro.com"
<broonie@opensource.wolfsonmicro.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
"kyle.manna@fuel7.com" <kyle.manna@fuel7.com>,
"rtc-linux@googlegroups.com" <rtc-linux@googlegroups.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rtc: tps65910: Add RTC driver for TPS65910 PMIC RTC
Date: Mon, 30 Jul 2012 10:06:11 -0700 [thread overview]
Message-ID: <5016BF03.70805@codeaurora.org> (raw)
In-Reply-To: <D958900912E20642BCBC71664EFECE3E6DDCAC4244@BGMAIL02.nvidia.com>
On 07/30/12 03:07, Venu Byravarasu wrote:
>
> +
> +static int __devinit tps65910_rtc_probe(struct platform_device *pdev)
> +{
> + struct tps65910 *tps65910 = NULL;
> + struct tps65910_rtc *tps_rtc = NULL;
> + struct tps65910_board *pmic_plat_data;
> + int ret = -EINVAL;
> + int irq = 0;
> + u32 rtc_reg;
>> It seems like all the above assignments are useless as they're
>> overwritten later in this function. Can you remove the assignments?
>>
> Some of the non-intelligent compilers/tools complain as variables
> may get used uninitialized. Hence to avoid such complaints, initialized
> them to some default values.
> What harm do you see if I have local variables initialized during their declaration?
If you return early from a function and forget to give a variable a
value you actually want, you may use it pre-initialized with a bad
value. I would be surprised if a compiler complained about these ones
because they are simple assignments and they aren't under conditional
paths. If there is still a problem, you can use the uninitialized_var()
macro but I don't see why you would need to.
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2012-07-30 17:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 6:35 [PATCH] rtc: tps65910: Add RTC driver for TPS65910 PMIC RTC Venu Byravarasu
2012-07-27 13:28 ` Samuel Ortiz
2012-07-30 9:16 ` Stephen Boyd
2012-07-30 10:07 ` Venu Byravarasu
2012-07-30 17:06 ` Stephen Boyd [this message]
2012-08-14 23:52 ` Andrew Morton
2012-08-16 5:48 ` Venu Byravarasu
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=5016BF03.70805@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=a.zummo@towertech.it \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=kyle.manna@fuel7.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
--cc=sameo@linux.intel.com \
--cc=vbyravarasu@nvidia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.