* [PATCH] mfd: menelaus: use NULL instead of 0
@ 2013-08-02 5:50 Jingoo Han
2013-08-02 5:53 ` Sachin Kamat
0 siblings, 1 reply; 3+ messages in thread
From: Jingoo Han @ 2013-08-02 5:50 UTC (permalink / raw)
To: Samuel Ortiz, Lee Jones; +Cc: linux-kernel, Jingoo Han
'mmc_callback_data' and 'vtg' are pointers.
Fix the following sparse warning:
drivers/mfd/menelaus.c:445:43: warning: Using plain integer as NULL pointer
drivers/mfd/menelaus.c:469:20: warning: Using plain integer as NULL pointer
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/mfd/menelaus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
index 998ce8c..0f62ecd 100644
--- a/drivers/mfd/menelaus.c
+++ b/drivers/mfd/menelaus.c
@@ -442,7 +442,7 @@ void menelaus_unregister_mmc_callback(void)
menelaus_remove_irq_work(MENELAUS_MMC_S2D1_IRQ);
the_menelaus->mmc_callback = NULL;
- the_menelaus->mmc_callback_data = 0;
+ the_menelaus->mmc_callback_data = NULL;
}
EXPORT_SYMBOL(menelaus_unregister_mmc_callback);
@@ -466,7 +466,7 @@ static int menelaus_set_voltage(const struct menelaus_vtg *vtg, int mV,
struct i2c_client *c = the_menelaus->client;
mutex_lock(&the_menelaus->lock);
- if (vtg == 0)
+ if (vtg == NULL)
goto set_voltage;
ret = menelaus_read_reg(vtg->vtg_reg);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: menelaus: use NULL instead of 0
2013-08-02 5:50 [PATCH] mfd: menelaus: use NULL instead of 0 Jingoo Han
@ 2013-08-02 5:53 ` Sachin Kamat
2013-08-02 5:57 ` Jingoo Han
0 siblings, 1 reply; 3+ messages in thread
From: Sachin Kamat @ 2013-08-02 5:53 UTC (permalink / raw)
To: Jingoo Han; +Cc: Samuel Ortiz, Lee Jones, linux-kernel
On 2 August 2013 11:20, Jingoo Han <jg1.han@samsung.com> wrote:
> 'mmc_callback_data' and 'vtg' are pointers.
> Fix the following sparse warning:
>
> drivers/mfd/menelaus.c:445:43: warning: Using plain integer as NULL pointer
> drivers/mfd/menelaus.c:469:20: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
> drivers/mfd/menelaus.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
> index 998ce8c..0f62ecd 100644
> --- a/drivers/mfd/menelaus.c
> +++ b/drivers/mfd/menelaus.c
> @@ -442,7 +442,7 @@ void menelaus_unregister_mmc_callback(void)
> menelaus_remove_irq_work(MENELAUS_MMC_S2D1_IRQ);
>
> the_menelaus->mmc_callback = NULL;
> - the_menelaus->mmc_callback_data = 0;
> + the_menelaus->mmc_callback_data = NULL;
> }
> EXPORT_SYMBOL(menelaus_unregister_mmc_callback);
>
> @@ -466,7 +466,7 @@ static int menelaus_set_voltage(const struct menelaus_vtg *vtg, int mV,
> struct i2c_client *c = the_menelaus->client;
>
> mutex_lock(&the_menelaus->lock);
> - if (vtg == 0)
> + if (vtg == NULL)
Instead you could just make this:
if (!vtg)
> goto set_voltage;
>
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: menelaus: use NULL instead of 0
2013-08-02 5:53 ` Sachin Kamat
@ 2013-08-02 5:57 ` Jingoo Han
0 siblings, 0 replies; 3+ messages in thread
From: Jingoo Han @ 2013-08-02 5:57 UTC (permalink / raw)
To: 'Sachin Kamat'
Cc: 'Samuel Ortiz', 'Lee Jones', linux-kernel, Jingoo Han
On Friday, August 02, 2013 2:53 PM, Sachin Kamat wrote:
> On 2 August 2013 11:20, Jingoo Han <jg1.han@samsung.com> wrote:
[...]
> >
> > mutex_lock(&the_menelaus->lock);
> > - if (vtg == 0)
> > + if (vtg == NULL)
>
> Instead you could just make this:
> if (!vtg)
Thank you for your comment. :)
It looks simpler. So, I will use it as you guide.
Best regards,
Jingoo Han
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-02 5:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-02 5:50 [PATCH] mfd: menelaus: use NULL instead of 0 Jingoo Han
2013-08-02 5:53 ` Sachin Kamat
2013-08-02 5:57 ` Jingoo Han
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).