[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210127165718.GF2542@lahna.fi.intel.com>
Date: Wed, 27 Jan 2021 18:57:18 +0200
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Lee Jones <lee.jones@...aro.org>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andreas Noever <andreas.noever@...il.com>,
Michael Jamet <michael.jamet@...el.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
Subject: Re: [PATCH 01/12] thunderbolt: dma_port: Remove unused variable 'ret'
Hi,
On Wed, Jan 27, 2021 at 04:19:16PM +0000, Lee Jones wrote:
> On Wed, 27 Jan 2021, Andy Shevchenko wrote:
>
> > On Wednesday, January 27, 2021, Lee Jones <lee.jones@...aro.org> wrote:
> >
> > > Fixes the following W=1 kernel build warning(s):
> > >
> > > drivers/thunderbolt/dma_port.c: In function ‘dma_port_flash_write_block’:
> > > drivers/thunderbolt/dma_port.c:331:6: warning: variable ‘ret’ set but
> > > not used [-Wunused-but-set-variable]
> > >
> > >
> > Is it scripted somehow?
>
> A script opens up the file on the warning line.
>
> The patch is hand-written.
>
> > Because I am not sure we are okay to simply drop the assignment.
>
> I've been careful not to change the semantics of the code.
>
> The return value has never been checked since the driver's inception 4
> years ago.
>
> However, if this is an oversight and the intention was to check the
> value and error-out during a failure condition, I can make that
> happen.
>
> I would need a nod from the author before I make such a change.
It's actually an oversight from my side. It should do something like:
if (ret)
return ret:
there. Feel free to fix it up :)
Thanks!
Powered by blists - more mailing lists