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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 9 Feb 2017 01:35:55 +0530
From:   Karthik Nayak <karthik.188@...il.com>
To:     Ian Abbott <abbotti@....co.uk>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        devel@...verdev.osuosl.org, hsweeten@...ionengravers.com,
        Nikita Eshkeev <kastolom@...il.com>,
        Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 2/2] staging: comedi: drop unused variable from struct 'ni_private'

Hey,

On Wed, Feb 8, 2017 at 11:10 PM, Ian Abbott <abbotti@....co.uk> wrote:
> On 08/02/2017 16:55, Karthik Nayak wrote:
>>
>> Drop the 'serial_number' variable from the struct 'ni_private' since
>> its never used after assignment.
>>
>> Signed-off-by: Karthik Nayak <Karthik.188@...il.com>
>> ---
>>
>> This is to be based on top of "staging: comedi: Fix incorrect type
>> assignment"
>> to which this is replied to.
>>
>>  drivers/staging/comedi/drivers/ni_pcimio.c | 3 +--
>>  drivers/staging/comedi/drivers/ni_stc.h    | 1 -
>>  2 files changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c
>> b/drivers/staging/comedi/drivers/ni_pcimio.c
>> index 4f45a5c230ad..da4d3da071eb 100644
>> --- a/drivers/staging/comedi/drivers/ni_pcimio.c
>> +++ b/drivers/staging/comedi/drivers/ni_pcimio.c
>> @@ -1222,12 +1222,11 @@ static void m_series_init_eeprom_buffer(struct
>> comedi_device *dev)
>>         writel(0x1 | old_iodwcr1_bits, mite->mmio + MITE_IODWCR_1);
>>         writel(0xf, mite->mmio + 0x30);
>>
>
> I think it would be preferable to remove the code from here ...
>
>> -       BUG_ON(serial_number_eeprom_length >
>> sizeof(devpriv->serial_number));
>> +       BUG_ON(serial_number_eeprom_length > sizeof(serial_number));
>>         for (i = 0; i < serial_number_eeprom_length; ++i) {
>>                 char *byte_ptr = (char *)&serial_number + i;
>>                 *byte_ptr = ni_readb(dev, serial_number_eeprom_offset +
>> i);
>>         }
>> -       devpriv->serial_number = be32_to_cpu(serial_number);
>
>
> ... to here.  And remove the serial_number_eeprom_length,
> serial_number_eeprom_offset, and serial_number variables too.  There is no
> need to continue reading the serial number bytes from the EEPROM.
>

Ah! I'll do that and send a patch, thanks :)

>>
>>         for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i)
>>                 devpriv->eeprom_buffer[i] = ni_readb(dev, Start_Cal_EEPROM
>> + i);
>> diff --git a/drivers/staging/comedi/drivers/ni_stc.h
>> b/drivers/staging/comedi/drivers/ni_stc.h
>> index b5eca0da71eb..61138e86a455 100644
>> --- a/drivers/staging/comedi/drivers/ni_stc.h
>> +++ b/drivers/staging/comedi/drivers/ni_stc.h
>> @@ -1031,7 +1031,6 @@ struct ni_private {
>>
>>         unsigned short ai_fifo_buffer[0x2000];
>>         u8 eeprom_buffer[M_SERIES_EEPROM_SIZE];
>> -       unsigned int serial_number;
>>
>>         struct mite *mite;
>>         struct mite_channel *ai_mite_chan;
>>
>
> --
> -=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@....co.uk> )=-
> -=(                          Web: http://www.mev.co.uk/  )=-



-- 
Regards,
Karthik Nayak

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ