lkml.org 
[lkml]   [2019]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] scsi: sym53c8xx_2: remove redundant assignment to retv
On Fri, Aug 09, 2019 at 11:17:33AM -0700, Matthew Wilcox wrote:
> On Fri, Aug 09, 2019 at 06:59:32PM +0100, Colin King wrote:
> > Variable retv is initialized to a value that is never read and it
> > is re-assigned later. The initialization is redundant and can be
> > removed.
>
> Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>
> Seems like a bit of a pointless class of warnings, given that gcc now
> initialises all locals. But I'm happy for James or Martin to pick it up.

GCC doesn't initialize all locals. Just some depending on the
optimization level. It's related to a bug that's several years old.

This warning does find some bugs. The common one is where people forget
to check the return.

ret = something();
// blank line here indicates that ret is never checked again.

regards,
dan carpenter

\
 
 \ /
  Last update: 2019-08-13 15:21    [W:0.036 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site