[PATCH] staging: comedi: ni_pcimio: remove unused variable 'serial_number'
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@gmail.com> --- drivers/staging/comedi/drivers/ni_pcimio.c | 9 - drivers/staging/comedi/drivers/ni_stc.h| 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..3a96913c025e 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -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 *)>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); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index f27b545f83eb..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]; - __be32 serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.1
[PATCH] staging: comedi: ni_pcimio: remove unused variable 'serial_number'
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 --- drivers/staging/comedi/drivers/ni_pcimio.c | 9 - drivers/staging/comedi/drivers/ni_stc.h| 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..3a96913c025e 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -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 *)>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); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index f27b545f83eb..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]; - __be32 serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.1
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hello, On Thu, Feb 9, 2017 at 4:34 PM, Greg KH <gre...@linuxfoundation.org> wrote: > On Thu, Feb 09, 2017 at 01:53:56AM +0530, Karthik Nayak wrote: >> This patch 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 >> >> This is done by removing the whole code block, since the variable >> 'serial_number' is only assigned but never used. >> >> Helped-by: Ian Abbott <abbo...@mev.co.uk> > > There's no such tag, sorry :( > Ah! This is common back in the Git community, I shall drop it :) > And does this obsolete all of your other ones? Please make it obvious > what I am supposed to do here. > > I've now dropped all of these patches from my queue. please resend the > proper one. > That works! I'll send the patch again, lets ignore the previous patches. On Thu, Feb 9, 2017 at 4:52 PM, Ian Abbott <abbo...@mev.co.uk> wrote: > To add to that, I think the emphasis of the patch title and description > should now be on the removal of serial_number, with fixing the sparse error > as a useful side-effect/inspiration. The patch title should also mention > ni_pcimio. > > Thanks, > Ian. Makes sense, will make the necessary changes. -- Regards, Karthik Nayak
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hello, On Thu, Feb 9, 2017 at 4:34 PM, Greg KH wrote: > On Thu, Feb 09, 2017 at 01:53:56AM +0530, Karthik Nayak wrote: >> This patch 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 >> >> This is done by removing the whole code block, since the variable >> 'serial_number' is only assigned but never used. >> >> Helped-by: Ian Abbott > > There's no such tag, sorry :( > Ah! This is common back in the Git community, I shall drop it :) > And does this obsolete all of your other ones? Please make it obvious > what I am supposed to do here. > > I've now dropped all of these patches from my queue. please resend the > proper one. > That works! I'll send the patch again, lets ignore the previous patches. On Thu, Feb 9, 2017 at 4:52 PM, Ian Abbott wrote: > To add to that, I think the emphasis of the patch title and description > should now be on the removal of serial_number, with fixing the sparse error > as a useful side-effect/inspiration. The patch title should also mention > ni_pcimio. > > Thanks, > Ian. Makes sense, will make the necessary changes. -- Regards, Karthik Nayak
Re: [PATCH 2/2] staging: comedi: drop unused variable from struct 'ni_private'
Hello, >> >> ... 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 :) > Sorry for the multiple messages, now that we're deleting the whole block, I think it makes sense to squash the commits, so I'll send one single patch. -- Regards, Karthik Nayak
Re: [PATCH 2/2] staging: comedi: drop unused variable from struct 'ni_private'
Hello, >> >> ... 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 :) > Sorry for the multiple messages, now that we're deleting the whole block, I think it makes sense to squash the commits, so I'll send one single patch. -- Regards, Karthik Nayak
[PATCH] staging: comedi: Fix incorrect type assignment
This patch 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 This is done by removing the whole code block, since the variable 'serial_number' is only assigned but never used. Helped-by: Ian Abbott <abbo...@mev.co.uk> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- drivers/staging/comedi/drivers/ni_pcimio.c | 9 - drivers/staging/comedi/drivers/ni_stc.h| 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..3a96913c025e 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -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 *)>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); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index f27b545f83eb..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]; - __be32 serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.1
[PATCH] staging: comedi: Fix incorrect type assignment
This patch 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 This is done by removing the whole code block, since the variable 'serial_number' is only assigned but never used. Helped-by: Ian Abbott Signed-off-by: Karthik Nayak --- drivers/staging/comedi/drivers/ni_pcimio.c | 9 - drivers/staging/comedi/drivers/ni_stc.h| 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..3a96913c025e 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -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 *)>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); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index f27b545f83eb..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]; - __be32 serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.1
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 <abbo...@mev.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@gmail.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 *)_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: <abbo...@mev.co.uk> )=- > -=( Web: http://www.mev.co.uk/ )=- -- Regards, Karthik Nayak
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 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 >> --- >> >> 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 *)_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: )=- > -=( Web: http://www.mev.co.uk/ )=- -- Regards, Karthik Nayak
[PATCH 2/2] staging: comedi: drop unused variable from struct 'ni_private'
Drop the 'serial_number' variable from the struct 'ni_private' since its never used after assignment. Signed-off-by: Karthik Nayak <karthik@gmail.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); - 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 *)_number + i; *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i); } - devpriv->serial_number = be32_to_cpu(serial_number); 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; -- 2.11.1
[PATCH 2/2] staging: comedi: drop unused variable from struct 'ni_private'
Drop the 'serial_number' variable from the struct 'ni_private' since its never used after assignment. Signed-off-by: Karthik Nayak --- 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); - 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 *)_number + i; *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i); } - devpriv->serial_number = be32_to_cpu(serial_number); 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; -- 2.11.1
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hi, On Wed, Feb 8, 2017 at 7:18 PM, Ian Abbott <abbo...@mev.co.uk> wrote: > On 08/02/17 13:26, Karthik Nayak wrote: >> >> Hello, >> >> On Wed, Feb 8, 2017 at 6:43 PM, Ian Abbott <abbo...@mev.co.uk> wrote: >>> >>> On 07/02/17 19:06, Karthik Nayak wrote: >>>> >>>> >>>> This patch 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 >>>> >>>> This is done by introducing a temporary variable which is of type >>>> '__be32' and converting the existing variable to type 'unsigned int'. >>>> >>>> Signed-off-by: Karthik Nayak <karthik@gmail.com> >>>> --- >>>> drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- >>>> drivers/staging/comedi/drivers/ni_stc.h| 2 +- >>>> 2 files changed, 4 insertions(+), 3 deletions(-) > > [snip] > >>> (On a side note, nothing actually uses serial number, so the code that >>> reads >>> it from the EEPROM could just be ripped out.) >>> >>> Reviewed-by: Ian Abbott <abbo...@mev.co.uk> >>> >> >> Yea, I saw that, was assuming there might be a purposed use case scenario. > > > AFAICT it's never been used - not even to print a kernel log message or > anything. > >> Do you want me to send another patch? > > > If you want. If you plan to do so, could you indicate whether you are going > to base the patch on top of this one, or whether this patch should be > discarded. Thanks! > Sure, I'll base it on top of the existing patch. I'll reply to the first patch with the second one. -- Regards, Karthik Nayak
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hi, On Wed, Feb 8, 2017 at 7:18 PM, Ian Abbott wrote: > On 08/02/17 13:26, Karthik Nayak wrote: >> >> Hello, >> >> On Wed, Feb 8, 2017 at 6:43 PM, Ian Abbott wrote: >>> >>> On 07/02/17 19:06, Karthik Nayak wrote: >>>> >>>> >>>> This patch 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 >>>> >>>> This is done by introducing a temporary variable which is of type >>>> '__be32' and converting the existing variable to type 'unsigned int'. >>>> >>>> Signed-off-by: Karthik Nayak >>>> --- >>>> drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- >>>> drivers/staging/comedi/drivers/ni_stc.h| 2 +- >>>> 2 files changed, 4 insertions(+), 3 deletions(-) > > [snip] > >>> (On a side note, nothing actually uses serial number, so the code that >>> reads >>> it from the EEPROM could just be ripped out.) >>> >>> Reviewed-by: Ian Abbott >>> >> >> Yea, I saw that, was assuming there might be a purposed use case scenario. > > > AFAICT it's never been used - not even to print a kernel log message or > anything. > >> Do you want me to send another patch? > > > If you want. If you plan to do so, could you indicate whether you are going > to base the patch on top of this one, or whether this patch should be > discarded. Thanks! > Sure, I'll base it on top of the existing patch. I'll reply to the first patch with the second one. -- Regards, Karthik Nayak
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hello, On Wed, Feb 8, 2017 at 6:43 PM, Ian Abbott <abbo...@mev.co.uk> wrote: > On 07/02/17 19:06, Karthik Nayak wrote: >> >> This patch 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 >> >> This is done by introducing a temporary variable which is of type >> '__be32' and converting the existing variable to type 'unsigned int'. >> >> Signed-off-by: Karthik Nayak <karthik@gmail.com> >> --- >> drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- >> drivers/staging/comedi/drivers/ni_stc.h| 2 +- >> 2 files changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c >> b/drivers/staging/comedi/drivers/ni_pcimio.c >> index cdb66eab1292..4f45a5c230ad 100644 >> --- a/drivers/staging/comedi/drivers/ni_pcimio.c >> +++ b/drivers/staging/comedi/drivers/ni_pcimio.c >> @@ -1207,6 +1207,7 @@ static void m_series_init_eeprom_buffer(struct >> comedi_device *dev) >> unsigned int old_iodwbsr_bits; >> unsigned int old_iodwbsr1_bits; >> unsigned int old_iodwcr1_bits; >> + __be32 serial_number; >> int i; >> >> /* IO Window 1 needs to be temporarily mapped to read the eeprom >> */ >> @@ -1223,10 +1224,10 @@ static void m_series_init_eeprom_buffer(struct >> comedi_device *dev) >> >> BUG_ON(serial_number_eeprom_length > >> sizeof(devpriv->serial_number)); >> for (i = 0; i < serial_number_eeprom_length; ++i) { >> - char *byte_ptr = (char *)>serial_number + i; >> + char *byte_ptr = (char *)_number + i; >> *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + >> i); >> } >> - devpriv->serial_number = be32_to_cpu(devpriv->serial_number); >> + devpriv->serial_number = be32_to_cpu(serial_number); >> >> 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 f27b545f83eb..b5eca0da71eb 100644 >> --- a/drivers/staging/comedi/drivers/ni_stc.h >> +++ b/drivers/staging/comedi/drivers/ni_stc.h >> @@ -1031,7 +1031,7 @@ struct ni_private { >> >> unsigned short ai_fifo_buffer[0x2000]; >> u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; >> - __be32 serial_number; >> + unsigned int serial_number; >> >> struct mite *mite; >> struct mite_channel *ai_mite_chan; >> > > That looks fine, thanks! > > (On a side note, nothing actually uses serial number, so the code that reads > it from the EEPROM could just be ripped out.) > > Reviewed-by: Ian Abbott <abbo...@mev.co.uk> > Yea, I saw that, was assuming there might be a purposed use case scenario. Do you want me to send another patch? -- Regards, Karthik Nayak
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hello, On Wed, Feb 8, 2017 at 6:43 PM, Ian Abbott wrote: > On 07/02/17 19:06, Karthik Nayak wrote: >> >> This patch 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 >> >> This is done by introducing a temporary variable which is of type >> '__be32' and converting the existing variable to type 'unsigned int'. >> >> Signed-off-by: Karthik Nayak >> --- >> drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- >> drivers/staging/comedi/drivers/ni_stc.h| 2 +- >> 2 files changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c >> b/drivers/staging/comedi/drivers/ni_pcimio.c >> index cdb66eab1292..4f45a5c230ad 100644 >> --- a/drivers/staging/comedi/drivers/ni_pcimio.c >> +++ b/drivers/staging/comedi/drivers/ni_pcimio.c >> @@ -1207,6 +1207,7 @@ static void m_series_init_eeprom_buffer(struct >> comedi_device *dev) >> unsigned int old_iodwbsr_bits; >> unsigned int old_iodwbsr1_bits; >> unsigned int old_iodwcr1_bits; >> + __be32 serial_number; >> int i; >> >> /* IO Window 1 needs to be temporarily mapped to read the eeprom >> */ >> @@ -1223,10 +1224,10 @@ static void m_series_init_eeprom_buffer(struct >> comedi_device *dev) >> >> BUG_ON(serial_number_eeprom_length > >> sizeof(devpriv->serial_number)); >> for (i = 0; i < serial_number_eeprom_length; ++i) { >> - char *byte_ptr = (char *)>serial_number + i; >> + char *byte_ptr = (char *)_number + i; >> *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + >> i); >> } >> - devpriv->serial_number = be32_to_cpu(devpriv->serial_number); >> + devpriv->serial_number = be32_to_cpu(serial_number); >> >> 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 f27b545f83eb..b5eca0da71eb 100644 >> --- a/drivers/staging/comedi/drivers/ni_stc.h >> +++ b/drivers/staging/comedi/drivers/ni_stc.h >> @@ -1031,7 +1031,7 @@ struct ni_private { >> >> unsigned short ai_fifo_buffer[0x2000]; >> u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; >> - __be32 serial_number; >> + unsigned int serial_number; >> >> struct mite *mite; >> struct mite_channel *ai_mite_chan; >> > > That looks fine, thanks! > > (On a side note, nothing actually uses serial number, so the code that reads > it from the EEPROM could just be ripped out.) > > Reviewed-by: Ian Abbott > Yea, I saw that, was assuming there might be a purposed use case scenario. Do you want me to send another patch? -- Regards, Karthik Nayak
[PATCH] staging: comedi: Fix incorrect type assignment
This patch 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 This is done by introducing a temporary variable which is of type '__be32' and converting the existing variable to type 'unsigned int'. Signed-off-by: Karthik Nayak <karthik@gmail.com> --- drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- drivers/staging/comedi/drivers/ni_stc.h| 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..4f45a5c230ad 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1207,6 +1207,7 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) unsigned int old_iodwbsr_bits; unsigned int old_iodwbsr1_bits; unsigned int old_iodwcr1_bits; + __be32 serial_number; int i; /* IO Window 1 needs to be temporarily mapped to read the eeprom */ @@ -1223,10 +1224,10 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) BUG_ON(serial_number_eeprom_length > sizeof(devpriv->serial_number)); for (i = 0; i < serial_number_eeprom_length; ++i) { - char *byte_ptr = (char *)>serial_number + i; + char *byte_ptr = (char *)_number + i; *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i); } - devpriv->serial_number = be32_to_cpu(devpriv->serial_number); + devpriv->serial_number = be32_to_cpu(serial_number); 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 f27b545f83eb..b5eca0da71eb 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -1031,7 +1031,7 @@ struct ni_private { unsigned short ai_fifo_buffer[0x2000]; u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; - __be32 serial_number; + unsigned int serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.0
[PATCH] staging: comedi: Fix incorrect type assignment
This patch 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 This is done by introducing a temporary variable which is of type '__be32' and converting the existing variable to type 'unsigned int'. Signed-off-by: Karthik Nayak --- drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- drivers/staging/comedi/drivers/ni_stc.h| 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..4f45a5c230ad 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1207,6 +1207,7 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) unsigned int old_iodwbsr_bits; unsigned int old_iodwbsr1_bits; unsigned int old_iodwcr1_bits; + __be32 serial_number; int i; /* IO Window 1 needs to be temporarily mapped to read the eeprom */ @@ -1223,10 +1224,10 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) BUG_ON(serial_number_eeprom_length > sizeof(devpriv->serial_number)); for (i = 0; i < serial_number_eeprom_length; ++i) { - char *byte_ptr = (char *)>serial_number + i; + char *byte_ptr = (char *)_number + i; *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i); } - devpriv->serial_number = be32_to_cpu(devpriv->serial_number); + devpriv->serial_number = be32_to_cpu(serial_number); 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 f27b545f83eb..b5eca0da71eb 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -1031,7 +1031,7 @@ struct ni_private { unsigned short ai_fifo_buffer[0x2000]; u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; - __be32 serial_number; + unsigned int serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.0
[PATCH] staging: lustre: selftest: Make brw_inject_one_error() static
Since the function brw_inject_one_error() is used only within brw_test.c, make it static. This was reported as a warning by sparse. Signed-off-by: Karthik Nayak <karthik@gmail.com> --- drivers/staging/lustre/lnet/selftest/brw_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c index 67b460f..b9ac34e 100644 --- a/drivers/staging/lustre/lnet/selftest/brw_test.c +++ b/drivers/staging/lustre/lnet/selftest/brw_test.c @@ -136,7 +136,7 @@ brw_client_init(struct sfw_test_instance *tsi) return 0; } -int brw_inject_one_error(void) +static int brw_inject_one_error(void) { struct timespec64 ts; -- 2.10.2
[PATCH] staging: lustre: selftest: Make brw_inject_one_error() static
Since the function brw_inject_one_error() is used only within brw_test.c, make it static. This was reported as a warning by sparse. Signed-off-by: Karthik Nayak --- drivers/staging/lustre/lnet/selftest/brw_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c index 67b460f..b9ac34e 100644 --- a/drivers/staging/lustre/lnet/selftest/brw_test.c +++ b/drivers/staging/lustre/lnet/selftest/brw_test.c @@ -136,7 +136,7 @@ brw_client_init(struct sfw_test_instance *tsi) return 0; } -int brw_inject_one_error(void) +static int brw_inject_one_error(void) { struct timespec64 ts; -- 2.10.2
Re: [PATCH] Staging: rtl8192u: removed an unnecessary else statement
On 12/19/2014 04:08 AM, Jeremiah Mahler wrote: Karthik, On Thu, Dec 18, 2014 at 02:50:11PM +0530, Karthik Nayak wrote: As per checkpatch warning, removed an unnecessary else statement proceeding an if statement with a return. Signed-off-by: Karthik Nayak --- drivers/staging/rtl8192u/r8192U_dm.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 936565d..b3b508c 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -480,15 +480,13 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) if(priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ||!priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable){ return; - }else{ - if(priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 - if(priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) - priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; - }else{//in force send packets in 20 Mhz in 20/40 - if(priv->undecorated_smoothed_pwdb >= priv->ieee80211->bandwidth_auto_switch.threshold_20Mhzto40Mhz) - priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = false; - - } + } + if(priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 + if(priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) + priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; + }else{//in force send packets in 20 Mhz in 20/40 + if(priv->undecorated_smoothed_pwdb >= priv->ieee80211->bandwidth_auto_switch.threshold_20Mhzto40Mhz) + priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = false; } } // dm_BandwidthAutoSwitch [...] Wow, I don't think I have ever seen a file with so many checkpatch errors! Instead of only fixing one instance of one error I would fix all instances of that type of error. Since the changes would be very similar it should still be easy to review. You could even make a whole patch series with each patch fixing one type of error. Although I would keep the series to just a few at first until you are sure you are doing everything right. Hello Jeremiah, I agree, there are a lot of errors, so I fixed a single issue. This is just to get used to checkpatch system. I can write patches to fix the other things, but I rather not. I hope you get the point. Regards Karthik Nayak -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: gdm724x: remove prohibited space before the comma
Remove checkpatch error of prohibited space before the comma. Signed-off-by: Karthik Nayak --- drivers/staging/gdm724x/gdm_mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c index b5b063a..d1ab996 100644 --- a/drivers/staging/gdm724x/gdm_mux.c +++ b/drivers/staging/gdm724x/gdm_mux.c @@ -220,7 +220,7 @@ static int up_to_host(struct mux_rx *r) static void do_rx(struct work_struct *work) { struct mux_dev *mux_dev = - container_of(work, struct mux_dev , work_rx.work); + container_of(work, struct mux_dev, work_rx.work); struct mux_rx *r; struct rx_cxt *rx = (struct rx_cxt *)_dev->rx; unsigned long flags; -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: rtl8192u: removed an unnecessary else statement
As per checkpatch warning, removed an unnecessary else statement proceeding an if statement with a return. Signed-off-by: Karthik Nayak --- drivers/staging/rtl8192u/r8192U_dm.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 936565d..b3b508c 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -480,15 +480,13 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) if(priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ||!priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable){ return; - }else{ - if(priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 - if(priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) - priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; - }else{//in force send packets in 20 Mhz in 20/40 - if(priv->undecorated_smoothed_pwdb >= priv->ieee80211->bandwidth_auto_switch.threshold_20Mhzto40Mhz) - priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = false; - - } + } + if(priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 + if(priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) + priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; + }else{//in force send packets in 20 Mhz in 20/40 + if(priv->undecorated_smoothed_pwdb >= priv->ieee80211->bandwidth_auto_switch.threshold_20Mhzto40Mhz) + priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = false; } } // dm_BandwidthAutoSwitch -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: rtl8192u: removed an unnecessary else statement
As per checkpatch warning, removed an unnecessary else statement proceeding an if statement with a return. Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/rtl8192u/r8192U_dm.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 936565d..b3b508c 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -480,15 +480,13 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) if(priv-CurrentChannelBW == HT_CHANNEL_WIDTH_20 ||!priv-ieee80211-bandwidth_auto_switch.bautoswitch_enable){ return; - }else{ - if(priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 - if(priv-undecorated_smoothed_pwdb = priv-ieee80211-bandwidth_auto_switch.threshold_40Mhzto20Mhz) - priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz = true; - }else{//in force send packets in 20 Mhz in 20/40 - if(priv-undecorated_smoothed_pwdb = priv-ieee80211-bandwidth_auto_switch.threshold_20Mhzto40Mhz) - priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz = false; - - } + } + if(priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 + if(priv-undecorated_smoothed_pwdb = priv-ieee80211-bandwidth_auto_switch.threshold_40Mhzto20Mhz) + priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz = true; + }else{//in force send packets in 20 Mhz in 20/40 + if(priv-undecorated_smoothed_pwdb = priv-ieee80211-bandwidth_auto_switch.threshold_20Mhzto40Mhz) + priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz = false; } } // dm_BandwidthAutoSwitch -- 2.1.3 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: gdm724x: remove prohibited space before the comma
Remove checkpatch error of prohibited space before the comma. Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/gdm724x/gdm_mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c index b5b063a..d1ab996 100644 --- a/drivers/staging/gdm724x/gdm_mux.c +++ b/drivers/staging/gdm724x/gdm_mux.c @@ -220,7 +220,7 @@ static int up_to_host(struct mux_rx *r) static void do_rx(struct work_struct *work) { struct mux_dev *mux_dev = - container_of(work, struct mux_dev , work_rx.work); + container_of(work, struct mux_dev, work_rx.work); struct mux_rx *r; struct rx_cxt *rx = (struct rx_cxt *)mux_dev-rx; unsigned long flags; -- 2.1.3 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Staging: rtl8192u: removed an unnecessary else statement
On 12/19/2014 04:08 AM, Jeremiah Mahler wrote: Karthik, On Thu, Dec 18, 2014 at 02:50:11PM +0530, Karthik Nayak wrote: As per checkpatch warning, removed an unnecessary else statement proceeding an if statement with a return. Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/rtl8192u/r8192U_dm.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 936565d..b3b508c 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -480,15 +480,13 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) if(priv-CurrentChannelBW == HT_CHANNEL_WIDTH_20 ||!priv-ieee80211-bandwidth_auto_switch.bautoswitch_enable){ return; - }else{ - if(priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 - if(priv-undecorated_smoothed_pwdb = priv-ieee80211-bandwidth_auto_switch.threshold_40Mhzto20Mhz) - priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz = true; - }else{//in force send packets in 20 Mhz in 20/40 - if(priv-undecorated_smoothed_pwdb = priv-ieee80211-bandwidth_auto_switch.threshold_20Mhzto40Mhz) - priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz = false; - - } + } + if(priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 + if(priv-undecorated_smoothed_pwdb = priv-ieee80211-bandwidth_auto_switch.threshold_40Mhzto20Mhz) + priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz = true; + }else{//in force send packets in 20 Mhz in 20/40 + if(priv-undecorated_smoothed_pwdb = priv-ieee80211-bandwidth_auto_switch.threshold_20Mhzto40Mhz) + priv-ieee80211-bandwidth_auto_switch.bforced_tx20Mhz = false; } } // dm_BandwidthAutoSwitch [...] Wow, I don't think I have ever seen a file with so many checkpatch errors! Instead of only fixing one instance of one error I would fix all instances of that type of error. Since the changes would be very similar it should still be easy to review. You could even make a whole patch series with each patch fixing one type of error. Although I would keep the series to just a few at first until you are sure you are doing everything right. Hello Jeremiah, I agree, there are a lot of errors, so I fixed a single issue. This is just to get used to checkpatch system. I can write patches to fix the other things, but I rather not. I hope you get the point. Regards Karthik Nayak -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: rtl8712: removed an unnecessary else statement
As per checkpatch warning, removed an unnecessary else statement proceeding an if statement with a return. Signed-off-by: Karthik Nayak --- drivers/staging/rtl8712/rtl8712_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index cd8b444..800b2b3 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -496,8 +496,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, plist = plist->next; else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) return false; - else - break; + break; } list_del_init(&(prframe->u.hdr.list)); list_add_tail(&(prframe->u.hdr.list), plist); -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: rtl8712: removed an unnecessary else statement
As per checkpatch warning, removed an unnecessary else statement proceeding an if statement with a return. Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/rtl8712/rtl8712_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index cd8b444..800b2b3 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -496,8 +496,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, plist = plist-next; else if (SN_EQUAL(pnextattrib-seq_num, pattrib-seq_num)) return false; - else - break; + break; } list_del_init((prframe-u.hdr.list)); list_add_tail((prframe-u.hdr.list), plist); -- 2.1.3 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: bcm: remove unnecessary else statement
Removed the else statement occurring after an if statement with a return value as per checkpatch warning. Signed-off-by: Karthik Nayak --- drivers/staging/bcm/InterfaceMisc.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c index e5bcfec..1f31b8f 100644 --- a/drivers/staging/bcm/InterfaceMisc.c +++ b/drivers/staging/bcm/InterfaceMisc.c @@ -102,12 +102,11 @@ int InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter, DBG_LVL_ALL, "WRM failed status :%d", retval); psIntfAdapter->psAdapter->DeviceAccess = false; return retval; - } else { - psIntfAdapter->psAdapter->DeviceAccess = false; - BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, WRM, - DBG_LVL_ALL, "WRM sent %d", retval); - return STATUS_SUCCESS; } + psIntfAdapter->psAdapter->DeviceAccess = false; + BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, WRM, + DBG_LVL_ALL, "WRM sent %d", retval); + return STATUS_SUCCESS; } int BcmRDM(void *arg, -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: et131x: remove unneccessary 'out of memory' message
Removes the 'out of memory' warning issued by checkpatch Signed-off-by: Karthik Nayak --- drivers/staging/et131x/et131x.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 41fcaa0..f92cceb 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -2422,10 +2422,8 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) rfd->len = len; skb = dev_alloc_skb(rfd->len + 2); - if (!skb) { - dev_err(>pdev->dev, "Couldn't alloc an SKB for Rx\n"); + if (!skb) return NULL; - } adapter->netdev->stats.rx_bytes += rfd->len; -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] staging: et131x: remove unneccessary 'out of memory' message
Oops, i sent the old commit again, sorry! Regards, Karthik Nayak On Tue, Sep 30, 2014 at 11:10 PM, Fabio Estevam wrote: > On Tue, Sep 30, 2014 at 2:19 PM, Karthik Nayak wrote: >> Removes the 'out of memory' warning issues by checkpatch >> >> Signed-off-by: Karthik Nayak >> --- >> drivers/staging/et131x/et131x.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/drivers/staging/et131x/et131x.c >> b/drivers/staging/et131x/et131x.c >> index 41fcaa0..f1a9296 100644 >> --- a/drivers/staging/et131x/et131x.c >> +++ b/drivers/staging/et131x/et131x.c >> @@ -2423,7 +2423,6 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter >> *adapter) >> >> skb = dev_alloc_skb(rfd->len + 2); >> if (!skb) { >> - dev_err(>pdev->dev, "Couldn't alloc an SKB for >> Rx\n"); >> return NULL; >> } > > Then you could also remove the braces: > > if (!skb) > return NULL; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: bcm: multiple checkpatch fixes for InterfaceIdleMode.c
1. WARNING: else is not generally useful after a break or return 2. WARNING: quoted string split across lines 3. WARNING: break quoted strings at a space character Signed-off-by: Karthik Nayak --- drivers/staging/bcm/InterfaceIdleMode.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/bcm/InterfaceIdleMode.c b/drivers/staging/bcm/InterfaceIdleMode.c index c84ee49..9a77a98 100644 --- a/drivers/staging/bcm/InterfaceIdleMode.c +++ b/drivers/staging/bcm/InterfaceIdleMode.c @@ -188,10 +188,9 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, 5000); if (status) return status; - else - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, - IDLE_MODE, DBG_LVL_ALL, - "NOB Sent down :%d", lenwritten); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, + IDLE_MODE, DBG_LVL_ALL, + "NOB Sent down :%d", lenwritten); /* mdelay(25); */ @@ -211,8 +210,8 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, else BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, - "Number of completed iteration to" - "read chip-id :%lu", itr); + "Number of completed iteration to read chip-id :%lu", + itr); status = wrmalt(Adapter, SW_ABORT_IDLEMODE_LOC, , sizeof(status)); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: et131x: remove unneccessary 'out of memory' message
Removes the 'out of memory' warning issues by checkpatch Signed-off-by: Karthik Nayak --- drivers/staging/et131x/et131x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 41fcaa0..f1a9296 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -2423,7 +2423,6 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) skb = dev_alloc_skb(rfd->len + 2); if (!skb) { - dev_err(>pdev->dev, "Couldn't alloc an SKB for Rx\n"); return NULL; } -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: et131x: remove unneccessary 'out of memory' message
Removes the 'out of memory' warning issues by checkpatch Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/et131x/et131x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 41fcaa0..f1a9296 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -2423,7 +2423,6 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) skb = dev_alloc_skb(rfd-len + 2); if (!skb) { - dev_err(adapter-pdev-dev, Couldn't alloc an SKB for Rx\n); return NULL; } -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: bcm: multiple checkpatch fixes for InterfaceIdleMode.c
1. WARNING: else is not generally useful after a break or return 2. WARNING: quoted string split across lines 3. WARNING: break quoted strings at a space character Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/bcm/InterfaceIdleMode.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/bcm/InterfaceIdleMode.c b/drivers/staging/bcm/InterfaceIdleMode.c index c84ee49..9a77a98 100644 --- a/drivers/staging/bcm/InterfaceIdleMode.c +++ b/drivers/staging/bcm/InterfaceIdleMode.c @@ -188,10 +188,9 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, 5000); if (status) return status; - else - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, - IDLE_MODE, DBG_LVL_ALL, - NOB Sent down :%d, lenwritten); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, + IDLE_MODE, DBG_LVL_ALL, + NOB Sent down :%d, lenwritten); /* mdelay(25); */ @@ -211,8 +210,8 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, else BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, - Number of completed iteration to - read chip-id :%lu, itr); + Number of completed iteration to read chip-id :%lu, + itr); status = wrmalt(Adapter, SW_ABORT_IDLEMODE_LOC, Pattern, sizeof(status)); -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] staging: et131x: remove unneccessary 'out of memory' message
Oops, i sent the old commit again, sorry! Regards, Karthik Nayak On Tue, Sep 30, 2014 at 11:10 PM, Fabio Estevam feste...@gmail.com wrote: On Tue, Sep 30, 2014 at 2:19 PM, Karthik Nayak karthik@gmail.com wrote: Removes the 'out of memory' warning issues by checkpatch Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/et131x/et131x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 41fcaa0..f1a9296 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -2423,7 +2423,6 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) skb = dev_alloc_skb(rfd-len + 2); if (!skb) { - dev_err(adapter-pdev-dev, Couldn't alloc an SKB for Rx\n); return NULL; } Then you could also remove the braces: if (!skb) return NULL; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: et131x: remove unneccessary 'out of memory' message
Removes the 'out of memory' warning issued by checkpatch Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/et131x/et131x.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 41fcaa0..f92cceb 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -2422,10 +2422,8 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) rfd-len = len; skb = dev_alloc_skb(rfd-len + 2); - if (!skb) { - dev_err(adapter-pdev-dev, Couldn't alloc an SKB for Rx\n); + if (!skb) return NULL; - } adapter-netdev-stats.rx_bytes += rfd-len; -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: bcm: remove unnecessary else statement
Removed the else statement occurring after an if statement with a return value as per checkpatch warning. Signed-off-by: Karthik Nayak karthik@gmail.com --- drivers/staging/bcm/InterfaceMisc.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c index e5bcfec..1f31b8f 100644 --- a/drivers/staging/bcm/InterfaceMisc.c +++ b/drivers/staging/bcm/InterfaceMisc.c @@ -102,12 +102,11 @@ int InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter, DBG_LVL_ALL, WRM failed status :%d, retval); psIntfAdapter-psAdapter-DeviceAccess = false; return retval; - } else { - psIntfAdapter-psAdapter-DeviceAccess = false; - BCM_DEBUG_PRINT(psIntfAdapter-psAdapter, DBG_TYPE_OTHERS, WRM, - DBG_LVL_ALL, WRM sent %d, retval); - return STATUS_SUCCESS; } + psIntfAdapter-psAdapter-DeviceAccess = false; + BCM_DEBUG_PRINT(psIntfAdapter-psAdapter, DBG_TYPE_OTHERS, WRM, + DBG_LVL_ALL, WRM sent %d, retval); + return STATUS_SUCCESS; } int BcmRDM(void *arg, -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/