lkml.org 
[lkml]   [2018]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: [PATCH] misc: eeprom: assignment outside the if statement
<div dir="ltr"><div class="gmail_default" style="font-family:comic sans ms,sans-serif;font-size:small;color:#0b5394">Hello Jean,</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif;font-size:small;color:#0b5394"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif;font-size:small;color:#0b5394">Thank you for your response.</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif;font-size:small;color:#0b5394"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif;font-size:small;color:#0b5394">So, can we consider this patch?</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif;font-size:small;color:#0b5394"><br></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif;font-size:small;color:#0b5394">Regards,</div><div class="gmail_default" style="font-family:comic sans ms,sans-serif;font-size:small;color:#0b5394">Parth Y Shah<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 3, 2018 at 6:06 PM Jean Delvare &lt;<a href="mailto:jdelvare@suse.de">jdelvare@suse.de</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri,  3 Aug 2018 14:50:43 +0530, Parth Y Shah wrote:<br>
&gt; Assignment of any variable should be kept outside the if statement<br>
<br>
Actually there are exceptions to that rule, but this isn&#39;t one of them.<br>
<br>
&gt; Signed-off-by: Parth Y Shah &lt;<a href="mailto:sparth1292@gmail.com" target="_blank">sparth1292@gmail.com</a>&gt;<br>
&gt; ---<br>
&gt;  drivers/misc/eeprom/max6875.c | 3 ++-<br>
&gt;  1 file changed, 2 insertions(+), 1 deletion(-)<br>
&gt; <br>
&gt; diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c<br>
&gt; index 0e32709..fc0cf9a 100644<br>
&gt; --- a/drivers/misc/eeprom/max6875.c<br>
&gt; +++ b/drivers/misc/eeprom/max6875.c<br>
&gt; @@ -148,7 +148,8 @@ static int max6875_probe(struct i2c_client *client,<br>
&gt;       if (client-&gt;addr &amp; 1)<br>
&gt;               return -ENODEV;<br>
&gt;  <br>
&gt; -     if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL)))<br>
&gt; +     data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL);<br>
&gt; +     if (!data)<br>
&gt;               return -ENOMEM;<br>
&gt;  <br>
&gt;       /* A fake client is created on the odd address */<br>
<br>
Reviewed-by: Jean Delvare &lt;<a href="mailto:jdelvare@suse.de" target="_blank">jdelvare@suse.de</a>&gt;<br>
<br>
Thanks,<br>
-- <br>
Jean Delvare<br>
SUSE L3 Support<br>
</blockquote></div>
\
 
 \ /
  Last update: 2018-08-03 16:19    [W:0.029 / U:1.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site