lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210127161916.GL4903@dell>
Date:   Wed, 27 Jan 2021 16:19:16 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andreas Noever <andreas.noever@...il.com>,
        Michael Jamet <michael.jamet@...el.com>,
        Mika Westerberg <mika.westerberg@...ux.intel.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'

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.

> > Cc: Andreas Noever <andreas.noever@...il.com>
> > Cc: Michael Jamet <michael.jamet@...el.com>
> > Cc: Mika Westerberg <mika.westerberg@...ux.intel.com>
> > Cc: Yehezkel Bernat <YehezkelShB@...il.com>
> > Cc: linux-usb@...r.kernel.org
> > Signed-off-by: Lee Jones <lee.jones@...aro.org>
> > ---
> >  drivers/thunderbolt/dma_port.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/thunderbolt/dma_port.c b/drivers/thunderbolt/dma_
> > port.c
> > index 847dd07a7b172..5aced91e17dc4 100644
> > --- a/drivers/thunderbolt/dma_port.c
> > +++ b/drivers/thunderbolt/dma_port.c
> > @@ -328,13 +328,12 @@ static int dma_port_flash_write_block(struct
> > tb_dma_port *dma, u32 address,
> >  {
> >         struct tb_switch *sw = dma->sw;
> >         u32 in, dwaddress, dwords;
> > -       int ret;
> >
> >         dwords = size / 4;
> >
> >         /* Write the block to MAIL_DATA registers */
> > -       ret = dma_port_write(sw->tb->ctl, buf, tb_route(sw), dma->port,
> > -                           dma->base + MAIL_DATA, dwords,
> > DMA_PORT_TIMEOUT);
> > +       dma_port_write(sw->tb->ctl, buf, tb_route(sw), dma->port,
> > +                      dma->base + MAIL_DATA, dwords, DMA_PORT_TIMEOUT);
> >
> >         in = MAIL_IN_CMD_FLASH_WRITE << MAIL_IN_CMD_SHIFT;
> >
> >
> >
> 

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ