staging: comedi: ni_pcimio: remove unused variable 'serial_number'
authorKarthik Nayak <karthik.188@gmail.com>
Thu, 9 Feb 2017 12:06:50 +0000 (17:36 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2017 17:08:30 +0000 (09:08 -0800)
The struct 'ni_private' holds the variable 'serial_number' which post
assignment is never used. Remove the variable and code pertaining to
obtaining its value.

As a side note, this also fixes the following sparse error:
drivers/staging/comedi/drivers//ni_pcimio.c:1229:32: warning: incorrect type in assignment (different base types)
drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:    expected restricted __be32 [usertype] serial_number
drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:    got unsigned int

Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_pcimio.c
drivers/staging/comedi/drivers/ni_stc.h

index cdb66eab1292cb97dd4637dbb0bcd6b486f1374f..3a96913c025e78972dbdeae5e192a79c3748a88b 100644 (file)
@@ -1202,8 +1202,6 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev)
        resource_size_t daq_phys_addr;
        static const int Start_Cal_EEPROM = 0x400;
        static const unsigned int window_size = 10;
-       static const int serial_number_eeprom_offset = 0x4;
-       static const int serial_number_eeprom_length = 0x4;
        unsigned int old_iodwbsr_bits;
        unsigned int old_iodwbsr1_bits;
        unsigned int old_iodwcr1_bits;
@@ -1221,13 +1219,6 @@ 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);
 
-       BUG_ON(serial_number_eeprom_length > sizeof(devpriv->serial_number));
-       for (i = 0; i < serial_number_eeprom_length; ++i) {
-               char *byte_ptr = (char *)&devpriv->serial_number + i;
-               *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i);
-       }
-       devpriv->serial_number = be32_to_cpu(devpriv->serial_number);
-
        for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i)
                devpriv->eeprom_buffer[i] = ni_readb(dev, Start_Cal_EEPROM + i);
 
index f27b545f83ebca7c6ee14278be237436b722a2f7..61138e86a455ff657acd554023351b58545fbcbd 100644 (file)
@@ -1031,7 +1031,6 @@ struct ni_private {
 
        unsigned short ai_fifo_buffer[0x2000];
        u8 eeprom_buffer[M_SERIES_EEPROM_SIZE];
-       __be32 serial_number;
 
        struct mite *mite;
        struct mite_channel *ai_mite_chan;