lkml.org 
[lkml]   [2022]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/4] pwm: sysfs: Return directly from the for-loop in PM callbacks
On Fri, Aug 26, 2022 at 08:07:14PM +0300, Andy Shevchenko wrote:
> There is no need to assign ret to 0 and then break the loop just
> for returning the error to the caller. Instead, return directly
> from the for-loop, and 0 otherwise.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> v2: added tag (Uwe)
> drivers/pwm/sysfs.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)

I fail to see how this is an improvement. The outcome is exactly the
same and this doesn't even make the code shorter. Why bother?

Thierry
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-09-28 14:32    [W:1.532 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site