lkml.org 
[lkml]   [2017]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] rtc: rtc-max8925: remove redundant check on ret
On Wed, Jun 7, 2017 at 6:26 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The check on ret < 0 is redundant as the goto destination is the
> next statment. Remove this redudant check and goto.
>
> Detected by CoverityScan, CID#1268785 ("Identical code for different
> branches")

> ret = max8925_reg_write(info->rtc, MAX8925_ALARM0_CNTL, 0x77);
> else
> ret = max8925_reg_write(info->rtc, MAX8925_ALARM0_CNTL, 0x0);
> - if (ret < 0)
> - goto out;
> out:
> return ret;

...and label (w/ replacing it by inplace return ret;) ?

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2017-06-12 01:20    [W:0.037 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site