[PATCH 6/6 v3] staging: comedi: addi_apci_1564: remove use of devpriv->s_EeParameters
This driver no longer reads the eeprom to find the board specific data, all the necessary data is in the boardinfo. Use the boardinfo directly instead of passing through devpriv->s_EeParameters. Signed-off-by: Chase Southwood Cc: Ian Abbott Cc: H Hartley Sweeten --- 2: Incorrect patch title fixed. 3: I apparently failed to redo this patch properly when I changed PATCH 4/6 and it no longer applied. Just noticed this, and verified that the whole series applies now. drivers/staging/comedi/drivers/addi_apci_1564.c | 27 + 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index d5be8d3..b34ae34 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -65,22 +65,6 @@ static int apci1564_auto_attach(struct comedi_device *dev, dev->iobase = pci_resource_start(pcidev, 1); devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0); - /* Initialize parameters that can be overridden in EEPROM */ - devpriv->s_EeParameters.i_NbrAiChannel = this_board->i_NbrAiChannel; - devpriv->s_EeParameters.i_NbrAoChannel = this_board->i_NbrAoChannel; - devpriv->s_EeParameters.i_AiMaxdata = this_board->i_AiMaxdata; - devpriv->s_EeParameters.i_AoMaxdata = this_board->i_AoMaxdata; - devpriv->s_EeParameters.i_NbrDiChannel = this_board->i_NbrDiChannel; - devpriv->s_EeParameters.i_NbrDoChannel = this_board->i_NbrDoChannel; - devpriv->s_EeParameters.i_DoMaxdata = this_board->i_DoMaxdata; - devpriv->s_EeParameters.i_Timer = this_board->i_Timer; - devpriv->s_EeParameters.ui_MinAcquisitiontimeNs = - this_board->ui_MinAcquisitiontimeNs; - devpriv->s_EeParameters.ui_MinDelaytimeNs = - this_board->ui_MinDelaytimeNs; - - /* ## */ - if (pcidev->irq > 0) { ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED, dev->board_name, dev); @@ -114,14 +98,13 @@ static int apci1564_auto_attach(struct comedi_device *dev, /* Allocate and Initialise DO Subdevice Structures */ s = &dev->subdevices[3]; - if (devpriv->s_EeParameters.i_NbrDoChannel) { + if (this_board->i_NbrDoChannel) { s->type = COMEDI_SUBD_DO; s->subdev_flags = SDF_READABLE | SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; - s->n_chan = devpriv->s_EeParameters.i_NbrDoChannel; - s->maxdata = devpriv->s_EeParameters.i_DoMaxdata; - s->len_chanlist = - devpriv->s_EeParameters.i_NbrDoChannel; + s->n_chan = this_board->i_NbrDoChannel; + s->maxdata = this_board->i_DoMaxdata; + s->len_chanlist = this_board->i_NbrDoChannel; s->range_table = &range_digital; /* insn_config - for digital output memory */ @@ -135,7 +118,7 @@ static int apci1564_auto_attach(struct comedi_device *dev, /* Allocate and Initialise Timer Subdevice Structures */ s = &dev->subdevices[4]; - if (devpriv->s_EeParameters.i_Timer) { + if (this_board->i_Timer) { s->type = COMEDI_SUBD_TIMER; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; s->n_chan = 1; -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: comedi: addi_apci_1564: Further cleanups
Latest patchset in a continuing cleanup of addi_apci_1564.c. Main focus is on the auto_attach() function, but also cleaning up some of the old addi common code wrappers. To be applied on top of my prior patchset to this file (the one beginning with [PATCH 1/6] staging: comedi: addi_apci_1564: remove eeprom support code) Chase Southwood (4): staging: comedi: addi_apci_1564: board has 32 digital outputs staging: comedi: addi_apci_1564: don't allocate unused subdevices staging: comedi: addi_apci_1564: absorb apci1564_reset() staging: comedi: addi_apci_1564: call apci1564_interrupt() directly .../comedi/drivers/addi-data/hwdrv_apci1564.c | 32 --- drivers/staging/comedi/drivers/addi_apci_1564.c| 98 ++ 2 files changed, 45 insertions(+), 85 deletions(-) -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: comedi: addi_apci_1564: board has 32 digital outputs
This board always has 32 digital outputs. Remove the test when initializing the subdevice. Also, since this board is the only one supported by this driver, remove the boardinfo about the digital outputs and just use the data directly in the subdevice init. Signed-off-by: Chase Southwood Cc: Ian Abbott Cc: H Hartley Sweeten --- drivers/staging/comedi/drivers/addi_apci_1564.c | 29 - 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index ea22530..25149b2 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -17,9 +17,6 @@ static const struct addi_board apci1564_boardtypes[] = { .i_Timer= 1, .interrupt = apci1564_interrupt, .reset = apci1564_reset, - .do_config = apci1564_do_config, - .do_bits= apci1564_do_insn_bits, - .do_read= apci1564_do_read, .timer_config = apci1564_timer_config, .timer_write= apci1564_timer_write, .timer_read = apci1564_timer_read, @@ -98,23 +95,15 @@ static int apci1564_auto_attach(struct comedi_device *dev, /* Allocate and Initialise DO Subdevice Structures */ s = &dev->subdevices[3]; - if (this_board->i_NbrDoChannel) { - s->type = COMEDI_SUBD_DO; - s->subdev_flags = - SDF_READABLE | SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; - s->n_chan = this_board->i_NbrDoChannel; - s->maxdata = this_board->i_DoMaxdata; - s->len_chanlist = this_board->i_NbrDoChannel; - s->range_table = &range_digital; - - /* insn_config - for digital output memory */ - s->insn_config = this_board->do_config; - s->insn_write = this_board->do_write; - s->insn_bits = this_board->do_bits; - s->insn_read = this_board->do_read; - } else { - s->type = COMEDI_SUBD_UNUSED; - } + s->type = COMEDI_SUBD_DO; + s->subdev_flags = SDF_WRITEABLE; + s->n_chan = 32; + s->maxdata = 0x; + s->len_chanlist = 32; + s->range_table = &range_digital; + s->insn_config = apci1564_do_config; + s->insn_bits = apci1564_do_insn_bits; + s->insn_read = apci1564_do_read; /* Allocate and Initialise Timer Subdevice Structures */ s = &dev->subdevices[4]; -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: comedi: addi_apci_1564: don't allocate unused subdevices
The addi-data common code always allocates 7 subdevices. This driver cannot or will not use the ones we are currently allocating for analog input and output or EEPROM, so just don't allocate these subdevices at all. Signed-off-by: Chase Southwood Cc: Ian Abbott Cc: H Hartley Sweeten --- drivers/staging/comedi/drivers/addi_apci_1564.c | 27 + 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 25149b2..31b687c 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -47,7 +47,7 @@ static int apci1564_auto_attach(struct comedi_device *dev, const struct addi_board *this_board = comedi_board(dev); struct addi_private *devpriv; struct comedi_subdevice *s; - int ret, n_subdevices; + int ret; dev->board_name = this_board->pc_DriverName; @@ -69,21 +69,12 @@ static int apci1564_auto_attach(struct comedi_device *dev, dev->irq = pcidev->irq; } - n_subdevices = 7; - ret = comedi_alloc_subdevices(dev, n_subdevices); + ret = comedi_alloc_subdevices(dev, 3); if (ret) return ret; - /* Allocate and Initialise AI Subdevice Structures */ - s = &dev->subdevices[0]; - s->type = COMEDI_SUBD_UNUSED; - - /* Allocate and Initialise AO Subdevice Structures */ - s = &dev->subdevices[1]; - s->type = COMEDI_SUBD_UNUSED; - /* Allocate and Initialise DI Subdevice Structures */ - s = &dev->subdevices[2]; + s = &dev->subdevices[0]; s->type = COMEDI_SUBD_DI; s->subdev_flags = SDF_READABLE; s->n_chan = 32; @@ -94,7 +85,7 @@ static int apci1564_auto_attach(struct comedi_device *dev, s->insn_bits = apci1564_di_insn_bits; /* Allocate and Initialise DO Subdevice Structures */ - s = &dev->subdevices[3]; + s = &dev->subdevices[1]; s->type = COMEDI_SUBD_DO; s->subdev_flags = SDF_WRITEABLE; s->n_chan = 32; @@ -106,7 +97,7 @@ static int apci1564_auto_attach(struct comedi_device *dev, s->insn_read = apci1564_do_read; /* Allocate and Initialise Timer Subdevice Structures */ - s = &dev->subdevices[4]; + s = &dev->subdevices[2]; if (this_board->i_Timer) { s->type = COMEDI_SUBD_TIMER; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; @@ -123,14 +114,6 @@ static int apci1564_auto_attach(struct comedi_device *dev, s->type = COMEDI_SUBD_UNUSED; } - /* Allocate and Initialise TTL */ - s = &dev->subdevices[5]; - s->type = COMEDI_SUBD_UNUSED; - - /* EEPROM */ - s = &dev->subdevices[6]; - s->type = COMEDI_SUBD_UNUSED; - i_ADDI_Reset(dev); return 0; } -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: comedi: addi_apci_1564: call apci1564_interrupt() directly
Remove the boardinfo about the interrupt function and just call it directly. Signed-off-by: Chase Southwood Cc: Ian Abbott Cc: H Hartley Sweeten --- drivers/staging/comedi/drivers/addi_apci_1564.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 254889a..df1a16e 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -15,7 +15,6 @@ static const struct addi_board apci1564_boardtypes[] = { .i_NbrDoChannel = 32, .i_DoMaxdata= 0x, .i_Timer= 1, - .interrupt = apci1564_interrupt, .timer_config = apci1564_timer_config, .timer_write= apci1564_timer_write, .timer_read = apci1564_timer_read, @@ -24,10 +23,7 @@ static const struct addi_board apci1564_boardtypes[] = { static irqreturn_t v_ADDI_Interrupt(int irq, void *d) { - struct comedi_device *dev = d; - const struct addi_board *this_board = comedi_board(dev); - - this_board->interrupt(irq, d); + apci1564_interrupt(irq, d); return IRQ_RETVAL(1); } -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: comedi: addi_apci_1564: absorb apci1564_reset()
This is the only reset fuction used by this driver. We can remove it from the boardinfo and absorb the code from hwdrv_apci1564.c into the driver. Signed-off-by: Chase Southwood Cc: Ian Abbott Cc: H Hartley Sweeten --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 32 --- drivers/staging/comedi/drivers/addi_apci_1564.c| 36 ++ 2 files changed, 30 insertions(+), 38 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index 7976a22a..b3c3f60 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -578,35 +578,3 @@ static void apci1564_interrupt(int irq, void *d) } return; } - -static int apci1564_reset(struct comedi_device *dev) -{ - struct addi_private *devpriv = dev->private; - - ui_Type = 0; - - /* Disable the input interrupts and reset status register */ - outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DI_IRQ_REG); - inl(devpriv->i_IobaseAmcc + APCI1564_DI_INT_STATUS_REG); - outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DI_INT_MODE1_REG); - outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DI_INT_MODE2_REG); - - /* Reset the output channels and disable interrupts */ - outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DO_REG); - outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DO_INT_CTRL_REG); - - /* Reset the watchdog registers */ - addi_watchdog_reset(devpriv->i_IobaseAmcc + APCI1564_WDOG_REG); - - /* Reset the timer registers */ - outl(0x0, devpriv->i_IobaseAmcc + APCI1564_TIMER_CTRL_REG); - outl(0x0, devpriv->i_IobaseAmcc + APCI1564_TIMER_RELOAD_REG); - - /* Reset the counter registers */ - outl(0x0, dev->iobase + APCI1564_TCW_CTRL_REG(APCI1564_COUNTER1)); - outl(0x0, dev->iobase + APCI1564_TCW_CTRL_REG(APCI1564_COUNTER2)); - outl(0x0, dev->iobase + APCI1564_TCW_CTRL_REG(APCI1564_COUNTER3)); - outl(0x0, dev->iobase + APCI1564_TCW_CTRL_REG(APCI1564_COUNTER4)); - - return 0; -} diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 31b687c..254889a 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -16,7 +16,6 @@ static const struct addi_board apci1564_boardtypes[] = { .i_DoMaxdata= 0x, .i_Timer= 1, .interrupt = apci1564_interrupt, - .reset = apci1564_reset, .timer_config = apci1564_timer_config, .timer_write= apci1564_timer_write, .timer_read = apci1564_timer_read, @@ -32,11 +31,35 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d) return IRQ_RETVAL(1); } -static int i_ADDI_Reset(struct comedi_device *dev) +static int apci1564_reset(struct comedi_device *dev) { - const struct addi_board *this_board = comedi_board(dev); + struct addi_private *devpriv = dev->private; + + ui_Type = 0; + + /* Disable the input interrupts and reset status register */ + outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DI_IRQ_REG); + inl(devpriv->i_IobaseAmcc + APCI1564_DI_INT_STATUS_REG); + outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DI_INT_MODE1_REG); + outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DI_INT_MODE2_REG); + + /* Reset the output channels and disable interrupts */ + outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DO_REG); + outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DO_INT_CTRL_REG); + + /* Reset the watchdog registers */ + addi_watchdog_reset(devpriv->i_IobaseAmcc + APCI1564_WDOG_REG); + + /* Reset the timer registers */ + outl(0x0, devpriv->i_IobaseAmcc + APCI1564_TIMER_CTRL_REG); + outl(0x0, devpriv->i_IobaseAmcc + APCI1564_TIMER_RELOAD_REG); + + /* Reset the counter registers */ + outl(0x0, dev->iobase + APCI1564_TCW_CTRL_REG(APCI1564_COUNTER1)); + outl(0x0, dev->iobase + APCI1564_TCW_CTRL_REG(APCI1564_COUNTER2)); + outl(0x0, dev->iobase + APCI1564_TCW_CTRL_REG(APCI1564_COUNTER3)); + outl(0x0, dev->iobase + APCI1564_TCW_CTRL_REG(APCI1564_COUNTER4)); - this_board->reset(dev); return 0; } @@ -62,6 +85,8 @@ static int apci1564_auto_attach(struct comedi_device *dev, dev->iobase = pci_resource_start(pcidev, 1); devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0); + apci1564_reset(dev); + if (pcidev->irq > 0) { ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED, dev->board_name, dev); @@ -114,7 +139,6 @@ static int apci1564_auto_attach(struct comedi_device *dev, s->type = COMEDI_SUBD_UNUSED
[PATCH 00/15] staging: rtl8188eu: clean-up struct recv_buf
Following patches remove unnecessary member variables of struct recv_buf. navin patidar (15): staging: rtl8188eu: Remove function rtw_dequeue_recvbuf() staging: rtl8188eu: Remove function rtw_enqueue_recvbuf_to_head() staging: rtl8188eu: Remove function rtw_enqueue_recvbuf() staging: rtl8188eu: Remove 'struct list_head list' from struct recv_buf staging: rtl8188eu: Remove 'spinlock_t recvbuf_lock' from struct recv_buf staging: rtl8188eu: Remove 'dma_addr_t dma_transfer_addr' from struct recv_buf staging: rtl8188eu: Remove 'int transfer_len' from struct recv_buf staging: rtl8188eu: Remove pdata, phead, ptail and pend from struct recv_buf staging: rtl8188eu: Remove 'irp_pending' from struct recv_buf staging: rtl8188eu: Remove 'pallocated_buf' from struct recv_buf staging: rtl8188eu: Remove 'alloc_sz' from struct recv_buf staging: rtl8188eu: Remove 'u32 len' from struct recv_buf staging: rtl8188eu: Remove 'u32 ref_cnt' from struct recv_buf staging: rtl8188eu: Remove rtl8188eu_init_recvbuf() function staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf drivers/staging/rtl8188eu/core/rtw_recv.c | 49 - drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c| 20 - drivers/staging/rtl8188eu/hal/usb_ops_linux.c | 17 +-- drivers/staging/rtl8188eu/include/rtl8188e_recv.h |1 - drivers/staging/rtl8188eu/include/rtw_recv.h | 17 --- drivers/staging/rtl8188eu/os_dep/recv_linux.c | 15 +-- 6 files changed, 3 insertions(+), 116 deletions(-) -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/15] staging: rtl8188eu: Remove function rtw_dequeue_recvbuf()
rtw_dequeue_recvbuf() is not being used by driver. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_recv.c| 25 - drivers/staging/rtl8188eu/include/rtw_recv.h |1 - 2 files changed, 26 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 5c1d2d2..eac5260 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -313,31 +313,6 @@ int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue) return _SUCCESS; } -struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue) -{ - unsigned long irqL; - struct recv_buf *precvbuf; - struct list_head *plist, *phead; - - spin_lock_irqsave(&queue->lock, irqL); - - if (_rtw_queue_empty(queue)) { - precvbuf = NULL; - } else { - phead = get_list_head(queue); - - plist = phead->next; - - precvbuf = container_of(plist, struct recv_buf, list); - - rtw_list_delete(&precvbuf->list); - } - - spin_unlock_irqrestore(&queue->lock, irqL); - - return precvbuf; -} - static int recvframe_chkmic(struct adapter *adapter, struct recv_frame *precvframe) { diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index bcbce46..7b95860 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -304,7 +304,6 @@ void rtw_free_recvframe_queue(struct __queue *pframequeue, u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter); int rtw_enqueue_recvbuf_to_head(struct recv_buf *buf, struct __queue *queue); int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue); -struct recv_buf *rtw_dequeue_recvbuf(struct __queue *queue); void rtw_reordering_ctrl_timeout_handler(void *pcontext); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/15] staging: rtl8188eu: Remove function rtw_enqueue_recvbuf()
rtw_enqueue_recvbuf() is not being used by driver. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_recv.c| 12 drivers/staging/rtl8188eu/include/rtw_recv.h |1 - 2 files changed, 13 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 21aa89d..da26fa5c 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -289,18 +289,6 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter) return cnt; } -int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue) -{ - unsigned long irqL; - spin_lock_irqsave(&queue->lock, irqL); - - rtw_list_delete(&precvbuf->list); - - rtw_list_insert_tail(&precvbuf->list, get_list_head(queue)); - spin_unlock_irqrestore(&queue->lock, irqL); - return _SUCCESS; -} - static int recvframe_chkmic(struct adapter *adapter, struct recv_frame *precvframe) { diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 21ce405..677859e 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -302,7 +302,6 @@ int rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue); void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfree_recv_queue); u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter); -int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue); void rtw_reordering_ctrl_timeout_handler(void *pcontext); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/15] staging: rtl8188eu: Remove function rtw_enqueue_recvbuf_to_head()
rtw_enqueue_recvbuf_to_head() is not being used by driver. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/core/rtw_recv.c| 12 drivers/staging/rtl8188eu/include/rtw_recv.h |1 - 2 files changed, 13 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index eac5260..21aa89d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -289,18 +289,6 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter) return cnt; } -int rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, struct __queue *queue) -{ - spin_lock_bh(&queue->lock); - - rtw_list_delete(&precvbuf->list); - rtw_list_insert_head(&precvbuf->list, get_list_head(queue)); - - spin_unlock_bh(&queue->lock); - - return _SUCCESS; -} - int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue) { unsigned long irqL; diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 7b95860..21ce405 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -302,7 +302,6 @@ int rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue); void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfree_recv_queue); u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter); -int rtw_enqueue_recvbuf_to_head(struct recv_buf *buf, struct __queue *queue); int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue); void rtw_reordering_ctrl_timeout_handler(void *pcontext); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/15] staging: rtl8188eu: Remove 'struct list_head list' from struct recv_buf
Users of 'struct list_head list' variable e.g. rtw_enqueue_recvbuf(), rtw_enqueue_recvbuf_to_head() and rtw_dequeue_recvbuf() are already removed. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - drivers/staging/rtl8188eu/include/rtw_recv.h |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index b1b1584..98a79ba 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -71,7 +71,6 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter) precvbuf = (struct recv_buf *)precvpriv->precv_buf; for (i = 0; i < NR_RECVBUFF; i++) { - _rtw_init_listhead(&precvbuf->list); spin_lock_init(&precvbuf->recvbuf_lock); precvbuf->alloc_sz = MAX_RECVBUF_SZ; res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf); diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 677859e..103849f 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -235,7 +235,6 @@ struct sta_recv_priv { }; struct recv_buf { - struct list_head list; spinlock_t recvbuf_lock; u32 ref_cnt; struct adapter *adapter; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/15] staging: rtl8188eu: Remove 'spinlock_t recvbuf_lock' from struct recv_buf
recvbuf_lock is initialized inside rtl8188eu_init_recv_priv() but never used. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - drivers/staging/rtl8188eu/include/rtw_recv.h |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 98a79ba..52d83a4 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -71,7 +71,6 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter) precvbuf = (struct recv_buf *)precvpriv->precv_buf; for (i = 0; i < NR_RECVBUFF; i++) { - spin_lock_init(&precvbuf->recvbuf_lock); precvbuf->alloc_sz = MAX_RECVBUF_SZ; res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf); if (res == _FAIL) diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 103849f..4a19a06 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -235,7 +235,6 @@ struct sta_recv_priv { }; struct recv_buf { - spinlock_t recvbuf_lock; u32 ref_cnt; struct adapter *adapter; u8 *pbuf; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/15] staging: rtl8188eu: Remove 'dma_addr_t dma_transfer_addr' from struct recv_buf
Remove unused variable dma_transfer_addr. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/rtw_recv.h |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 4a19a06..bf9af77 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -245,7 +245,6 @@ struct recv_buf { u8 *ptail; u8 *pend; struct urb *purb; - dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */ u32 alloc_sz; u8 irp_pending; int transfer_len; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/15] staging: rtl8188eu: Remove 'int transfer_len' from struct recv_buf
Driver is not making any use of value stored in this variable. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |2 -- drivers/staging/rtl8188eu/hal/usb_ops_linux.c |1 - drivers/staging/rtl8188eu/include/rtw_recv.h |1 - drivers/staging/rtl8188eu/os_dep/recv_linux.c |1 - 4 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 52d83a4..ee7fa64 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -30,8 +30,6 @@ void rtl8188eu_init_recvbuf(struct adapter *padapter, struct recv_buf *precvbuf) { - precvbuf->transfer_len = 0; - precvbuf->len = 0; precvbuf->ref_cnt = 0; diff --git a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c index 1fa5370..285cb5f 100644 --- a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c @@ -518,7 +518,6 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) } else { rtw_reset_continual_urb_error(adapter_to_dvobj(adapt)); - precvbuf->transfer_len = purb->actual_length; skb_put(precvbuf->pskb, purb->actual_length); skb_queue_tail(&precvpriv->rx_skb_queue, precvbuf->pskb); diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index bf9af77..cac8acb 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -247,7 +247,6 @@ struct recv_buf { struct urb *purb; u32 alloc_sz; u8 irp_pending; - int transfer_len; struct sk_buff *pskb; u8 reuse; }; diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index da397e4..0838339 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -67,7 +67,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, precvbuf->phead = NULL; precvbuf->ptail = NULL; precvbuf->pend = NULL; - precvbuf->transfer_len = 0; precvbuf->len = 0; return res; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/15] staging: rtl8188eu: Remove pdata, phead, ptail and pend from struct recv_buf
Driver is not making use of value stored in removed variables. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |8 drivers/staging/rtl8188eu/hal/usb_ops_linux.c |9 - drivers/staging/rtl8188eu/include/rtw_recv.h |4 drivers/staging/rtl8188eu/os_dep/recv_linux.c |4 4 files changed, 25 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index ee7fa64..41a0c0d 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -31,15 +31,7 @@ void rtl8188eu_init_recvbuf(struct adapter *padapter, struct recv_buf *precvbuf) { precvbuf->len = 0; - precvbuf->ref_cnt = 0; - - if (precvbuf->pbuf) { - precvbuf->pdata = precvbuf->pbuf; - precvbuf->phead = precvbuf->pbuf; - precvbuf->ptail = precvbuf->pbuf; - precvbuf->pend = precvbuf->pdata + MAX_RECVBUF_SZ; - } } intrtl8188eu_init_recv_priv(struct adapter *padapter) diff --git a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c index 285cb5f..654c5b3 100644 --- a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c @@ -615,18 +615,9 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment)); - precvbuf->phead = precvbuf->pskb->head; - precvbuf->pdata = precvbuf->pskb->data; - precvbuf->ptail = skb_tail_pointer(precvbuf->pskb); - precvbuf->pend = skb_end_pointer(precvbuf->pskb); precvbuf->pbuf = precvbuf->pskb->data; } else { /* reuse skb */ - precvbuf->phead = precvbuf->pskb->head; - precvbuf->pdata = precvbuf->pskb->data; - precvbuf->ptail = skb_tail_pointer(precvbuf->pskb); - precvbuf->pend = skb_end_pointer(precvbuf->pskb); precvbuf->pbuf = precvbuf->pskb->data; - precvbuf->reuse = false; } diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index cac8acb..8d3424b 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -240,10 +240,6 @@ struct recv_buf { u8 *pbuf; u8 *pallocated_buf; u32 len; - u8 *phead; - u8 *pdata; - u8 *ptail; - u8 *pend; struct urb *purb; u32 alloc_sz; u8 irp_pending; diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index 0838339..99b5910 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -63,10 +63,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, precvbuf->reuse = false; precvbuf->pallocated_buf = NULL; precvbuf->pbuf = NULL; - precvbuf->pdata = NULL; - precvbuf->phead = NULL; - precvbuf->ptail = NULL; - precvbuf->pend = NULL; precvbuf->len = 0; return res; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/15] staging: rtl8188eu: Remove 'pallocated_buf' from struct recv_buf
pallocated_buf is not being used by driver. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/rtw_recv.h |1 - drivers/staging/rtl8188eu/os_dep/recv_linux.c |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 987445a..b955d73 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -238,7 +238,6 @@ struct recv_buf { u32 ref_cnt; struct adapter *adapter; u8 *pbuf; - u8 *pallocated_buf; u32 len; struct urb *purb; u32 alloc_sz; diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index 7f9b654..25358fb 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -60,7 +60,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, res = _FAIL; precvbuf->pskb = NULL; precvbuf->reuse = false; - precvbuf->pallocated_buf = NULL; precvbuf->pbuf = NULL; precvbuf->len = 0; return res; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/15] staging: rtl8188eu: Remove 'alloc_sz' from struct recv_buf
Driver isn't making any use of value stored in alloc_sz variable. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - drivers/staging/rtl8188eu/include/rtw_recv.h |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 41a0c0d..3edc2cd 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -61,7 +61,6 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter) precvbuf = (struct recv_buf *)precvpriv->precv_buf; for (i = 0; i < NR_RECVBUFF; i++) { - precvbuf->alloc_sz = MAX_RECVBUF_SZ; res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf); if (res == _FAIL) break; diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index b955d73..519ed4e 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -240,7 +240,6 @@ struct recv_buf { u8 *pbuf; u32 len; struct urb *purb; - u32 alloc_sz; struct sk_buff *pskb; u8 reuse; }; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/15] staging: rtl8188eu: Remove 'u32 len' from struct recv_buf
Remove unused variable 'u32 len'. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 - drivers/staging/rtl8188eu/include/rtw_recv.h |1 - drivers/staging/rtl8188eu/os_dep/recv_linux.c |1 - 3 files changed, 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 3edc2cd..740818a5 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -30,7 +30,6 @@ void rtl8188eu_init_recvbuf(struct adapter *padapter, struct recv_buf *precvbuf) { - precvbuf->len = 0; precvbuf->ref_cnt = 0; } diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 519ed4e..3f43f11 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -238,7 +238,6 @@ struct recv_buf { u32 ref_cnt; struct adapter *adapter; u8 *pbuf; - u32 len; struct urb *purb; struct sk_buff *pskb; u8 reuse; diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index 25358fb..2577ceb6 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -61,7 +61,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, precvbuf->pskb = NULL; precvbuf->reuse = false; precvbuf->pbuf = NULL; - precvbuf->len = 0; return res; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/15] staging: rtl8188eu: Remove 'irp_pending' from struct recv_buf
irp_pending is initialized to false inside rtw_os_recvbuf_resource_alloc() and value of irq_pending never changed after that, so 'if (!precvbuf->irp_pending)' inside rtw_os_read_port() function will be always true. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/include/rtw_recv.h |1 - drivers/staging/rtl8188eu/os_dep/recv_linux.c |6 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 8d3424b..987445a 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -242,7 +242,6 @@ struct recv_buf { u32 len; struct urb *purb; u32 alloc_sz; - u8 irp_pending; struct sk_buff *pskb; u8 reuse; }; diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index 99b5910..7f9b654 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -55,7 +55,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, { int res = _SUCCESS; - precvbuf->irp_pending = false; precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL); if (precvbuf->purb == NULL) res = _FAIL; @@ -229,9 +228,8 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf) dev_kfree_skb_any(precvbuf->pskb); precvbuf->pskb = NULL; precvbuf->reuse = false; - if (!precvbuf->irp_pending) - rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, - (unsigned char *)precvbuf); + rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, + (unsigned char *)precvbuf); } static void _rtw_reordering_ctrl_timeout_handler(void *func_context) -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/15] staging: rtl8188eu: Remove 'u32 ref_cnt' from struct recv_buf
Driver isn't making any use of value stored in variable ref_cnt. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |2 -- drivers/staging/rtl8188eu/include/rtw_recv.h |1 - drivers/staging/rtl8188eu/os_dep/recv_linux.c |1 - 3 files changed, 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 740818a5..fc06991 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -30,7 +30,6 @@ void rtl8188eu_init_recvbuf(struct adapter *padapter, struct recv_buf *precvbuf) { - precvbuf->ref_cnt = 0; } intrtl8188eu_init_recv_priv(struct adapter *padapter) @@ -63,7 +62,6 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter) res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf); if (res == _FAIL) break; - precvbuf->ref_cnt = 0; precvbuf->adapter = padapter; precvbuf++; } diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 3f43f11..8dadf30 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -235,7 +235,6 @@ struct sta_recv_priv { }; struct recv_buf { - u32 ref_cnt; struct adapter *adapter; u8 *pbuf; struct urb *purb; diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index 2577ceb6..c1664b7 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -221,7 +221,6 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf) { struct recv_priv *precvpriv = &padapter->recvpriv; - precvbuf->ref_cnt--; /* free skb in recv_buf */ dev_kfree_skb_any(precvbuf->pskb); precvbuf->pskb = NULL; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/15] staging: rtl8188eu: Remove rtl8188eu_init_recvbuf() function
rtl8188eu_init_recvbuf() function definition is empty now, so remove it. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c|4 drivers/staging/rtl8188eu/hal/usb_ops_linux.c |2 -- drivers/staging/rtl8188eu/include/rtl8188e_recv.h |1 - 3 files changed, 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index fc06991..2b45564 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -28,10 +28,6 @@ #include -void rtl8188eu_init_recvbuf(struct adapter *padapter, struct recv_buf *precvbuf) -{ -} - intrtl8188eu_init_recv_priv(struct adapter *padapter) { struct recv_priv*precvpriv = &padapter->recvpriv; diff --git a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c index 654c5b3..d3c5ed3 100644 --- a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c @@ -600,8 +600,6 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) precvbuf->reuse = true; } - rtl8188eu_init_recvbuf(adapter, precvbuf); - /* re-assign for linux based on skb */ if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) { precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ); diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_recv.h b/drivers/staging/rtl8188eu/include/rtl8188e_recv.h index 07e5f52..5fed30d 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_recv.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_recv.h @@ -56,7 +56,6 @@ enum rx_packet_type { }; #define INTERRUPT_MSG_FORMAT_LEN 60 -void rtl8188eu_init_recvbuf(struct adapter *padapter, struct recv_buf *buf); s32 rtl8188eu_init_recv_priv(struct adapter *padapter); void rtl8188eu_free_recv_priv(struct adapter *padapter); void rtl8188eu_recv_hdl(struct adapter *padapter, struct recv_buf *precvbuf); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/15] staging: rtl8188eu: Remove 'u8 *pbuf' from struct recv_buf
Instead of using pbuf to pass sbk data pointer to usb_fill_bulk_urb(), we can use precvbuf->pskb->data to do that. Signed-off-by: navin patidar --- drivers/staging/rtl8188eu/hal/usb_ops_linux.c |5 + drivers/staging/rtl8188eu/include/rtw_recv.h |1 - drivers/staging/rtl8188eu/os_dep/recv_linux.c |1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c index d3c5ed3..d8fc747 100644 --- a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c @@ -612,10 +612,7 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) tmpaddr = (size_t)precvbuf->pskb->data; alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment)); - - precvbuf->pbuf = precvbuf->pskb->data; } else { /* reuse skb */ - precvbuf->pbuf = precvbuf->pskb->data; precvbuf->reuse = false; } @@ -627,7 +624,7 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) pipe = ffaddr2pipehdl(pdvobj, addr); usb_fill_bulk_urb(purb, pusbd, pipe, - precvbuf->pbuf, + precvbuf->pskb->data, MAX_RECVBUF_SZ, usb_read_port_complete, precvbuf);/* context is precvbuf */ diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 8dadf30..971dd16 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -236,7 +236,6 @@ struct sta_recv_priv { struct recv_buf { struct adapter *adapter; - u8 *pbuf; struct urb *purb; struct sk_buff *pskb; u8 reuse; diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index c1664b7..29ec014 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -60,7 +60,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, res = _FAIL; precvbuf->pskb = NULL; precvbuf->reuse = false; - precvbuf->pbuf = NULL; return res; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8821ae: mark pointer in pci_iounmap as __iomem
pci_iounmap is used that way in drivers/net/wireless/rtlwifi and this fixes sparse warnings. Signed-off-by: Martin Kepplinger --- drivers/staging/rtl8821ae/pci.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8821ae/pci.c b/drivers/staging/rtl8821ae/pci.c index a562aa6..d934ecb 100644 --- a/drivers/staging/rtl8821ae/pci.c +++ b/drivers/staging/rtl8821ae/pci.c @@ -2416,7 +2416,7 @@ fail3: ieee80211_free_hw(hw); if (rtlpriv->io.pci_mem_start != 0) - pci_iounmap(pdev, (void *)rtlpriv->io.pci_mem_start); + pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start); fail2: pci_release_regions(pdev); @@ -2479,7 +2479,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev) list_del(&rtlpriv->list); if (rtlpriv->io.pci_mem_start != 0) { - pci_iounmap(pdev, (void *)rtlpriv->io.pci_mem_start); + pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start); pci_release_regions(pdev); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Found some errors and other oddities, largely by means of a static code analysis program
Hi The static code analysis program called cppcheck. http://cppcheck.sourceforge.net/ I found code that I think are bugs, or at least inappropriate or unnecessary code, in the files: drivers/staging/rtl8712/rtl871x_ioctl_linux.c drivers/staging/rtl8712/rtl871x_mlme.c drivers/staging/rtl8712/usb_intf.c I have created a patch, and inluderat the error file generated by cppcheck. My goal was not to change any functionality, but it does not mean for example the unused variables can't mean that there are other problems/mistakes in the code. So a proper code review :) Is there anything else I can help with regarding the patch or cppcheck, do not hesitate to contact me. If you like this type of code analysis, it is possible to get more warnings, which are not as serious, but that may well indicate other mistakes. Best regards Rickard Strandqvist From 0ef1cda18e05aa6d0b0ea745ce194f33d8f03973 Mon Sep 17 00:00:00 2001 From: Rickard Strandqvist Date: Wed, 30 Apr 2014 16:27:31 +0200 Subject: [PATCH] Found same errors using a static code analysis program called cppcheck. --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 19 +--- drivers/staging/rtl8712/rtl871x_mlme.c| 29 + drivers/staging/rtl8712/usb_intf.c|8 +-- 3 filer ändrade, 22 tillägg(+), 34 borttagningar(-) diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index 23d539d..1d4475d 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -170,7 +170,7 @@ static inline char *translate_scan(struct _adapter *padapter, s8 *p; u32 i = 0, ht_ielen = 0; u16 cap, ht_cap = false, mcs_rate; - u8 rssi, bw_40MHz = 0, short_GI = 0; + u8 rssi; if ((pnetwork->network.Configuration.DSConfig < 1) || (pnetwork->network.Configuration.DSConfig > 14)) { @@ -197,10 +197,6 @@ static inline char *translate_scan(struct _adapter *padapter, ht_cap = true; pht_capie = (struct ieee80211_ht_cap *)(p + 2); memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2); - bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) - ? 1 : 0; - short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20 | - IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; } /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; @@ -286,8 +282,8 @@ static inline char *translate_scan(struct _adapter *padapter, u8 wpa_ie[255], rsn_ie[255]; u16 wpa_len = 0, rsn_len = 0; int n; - sint out_len = 0; - out_len = r8712_get_sec_ie(pnetwork->network.IEs, + + r8712_get_sec_ie(pnetwork->network.IEs, pnetwork->network. IELength, rsn_ie, &rsn_len, wpa_ie, &wpa_len); @@ -1133,13 +1129,12 @@ static int r871x_wx_set_mlme(struct net_device *dev, union iwreq_data *wrqu, char *extra) { int ret = 0; - u16 reason; struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct iw_mlme *mlme = (struct iw_mlme *) extra; if (mlme == NULL) return -1; - reason = cpu_to_le16(mlme->reason_code); + cpu_to_le16(mlme->reason_code); switch (mlme->cmd) { case IW_MLME_DEAUTH: if (!r8712_set_802_11_disassociate(padapter)) @@ -1465,10 +1460,7 @@ static int r8711_wx_get_rate(struct net_device *dev, RTL8712_RF_2T2R == rf_type) max_rate = (bw_40MHz) ? ((short_GI) ? 300 : 270) : ((short_GI) ? 144 : 130); - else if (mcs_rate & 0x0080) /* MCS7 */ -max_rate = (bw_40MHz) ? ((short_GI) ? 150 : - 135) : ((short_GI) ? 72 : 65); - else /* default MCS7 */ + else /* default MCS7 and MCS7 */ max_rate = (bw_40MHz) ? ((short_GI) ? 150 : 135) : ((short_GI) ? 72 : 65); max_rate *= 2; /* Mbps/2 */ @@ -1822,6 +1814,7 @@ static int r871x_wx_set_enc_ext(struct net_device *dev, alg_name = "CCMP"; break; default: + kfree(param); return -EINVAL; } strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index 3ea99ae..f126763 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -1274,22 +1274,30 @@ sint r8712_set_key(struct _adapter *adapter, psecuritypriv->DefKey[keyid].skey, keylen); break; case _TKIP_: - if (keyid < 1 || keyid > 2) + if (keyid < 1 || keyid > 2) { + kfree((unsigned char *)pcmd); + kfree((unsigned char *)psetkeyparm); return _FAIL; + } keylen = 16; memcpy(psetkeyparm->key, &psecuritypriv->XGrpKey[keyid - 1], keylen); psetkeyparm->grpkey = 1; break; case _AES_: - if (keyid < 1 || keyid > 2) +if (keyid < 1 || keyid > 2) { + kfree((unsigned char *)pcmd); + kfree((unsigned char *)psetkeyparm); return _FAIL; + } keylen = 16; memcpy(psetkeyparm->key, &psecuritypriv->XGrpKey[keyid - 1], keylen); psetkeyparm->grpkey = 1; break; default: + kfree((unsigned char *)pcmd); + kfree((unsigned char
Found some errors and other oddities, largely by means of a static code analysis program
Hi The static code analysis program called cppcheck. http://cppcheck.sourceforge.net/ I found code that I think are bugs, or at least inappropriate or unnecessary code, in the files: drivers/staging/tidspbridge/pmgr/dspapi.c drivers/staging/tidspbridge/rmgr/node.c I have created a patch, and inluderat the error file generated by cppcheck. My goal was not to change any functionality, but it does not mean for example the unused variables can't mean that there are other problems/mistakes in the code. So a proper code review :) Is there anything else I can help with regarding the patch or cppcheck, do not hesitate to contact me. If you like this type of code analysis, it is possible to get more warnings, which are not as serious, but that may well indicate other mistakes. Best regards Rickard Strandqvist From 0ef1cda18e05aa6d0b0ea745ce194f33d8f03973 Mon Sep 17 00:00:00 2001 From: Rickard Strandqvist Date: Wed, 30 Apr 2014 16:27:31 +0200 Subject: [PATCH] Found same errors using a static code analysis program called cppcheck. --- drivers/staging/tidspbridge/pmgr/dspapi.c |8 drivers/staging/tidspbridge/rmgr/node.c | 16 2 filer ändrade, 8 tillägg(+), 16 borttagningar(-) diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index b7d5c8c..4e12a5b 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -340,7 +340,7 @@ int api_init_complete2(void) u32 mgrwrap_enum_node_info(union trapped_args *args, void *pr_ctxt) { u8 *pndb_props; - u32 num_nodes; + u32 num_nodes = 0; int status = 0; u32 size = args->args_mgr_enumnode_info.ndb_props_size; @@ -372,7 +372,7 @@ u32 mgrwrap_enum_node_info(union trapped_args *args, void *pr_ctxt) u32 mgrwrap_enum_proc_info(union trapped_args *args, void *pr_ctxt) { u8 *processor_info; - u8 num_procs; + u8 num_procs = 0; int status = 0; u32 size = args->args_mgr_enumproc_info.processor_info_size; @@ -475,7 +475,7 @@ u32 mgrwrap_wait_for_bridge_events(union trapped_args *args, void *pr_ctxt) int status = 0; struct dsp_notification *anotifications[MAX_EVENTS]; struct dsp_notification notifications[MAX_EVENTS]; - u32 index, i; + u32 index = 0, i; u32 count = args->args_mgr_wait.count; if (count > MAX_EVENTS) @@ -1755,7 +1755,7 @@ u32 strmwrap_register_notify(union trapped_args *args, void *pr_ctxt) */ u32 strmwrap_select(union trapped_args *args, void *pr_ctxt) { - u32 mask; + u32 mask = 0; struct strm_object *strm_tab[MAX_STREAMS]; int status = 0; struct strm_res_object *strm_res; diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 9d3044a..9f0b511 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -2361,8 +2361,7 @@ static void delete_node(struct node_object *hnode, struct node_taskargs task_arg_obj; #ifdef DSP_DMM_DEBUG struct dmm_object *dmm_mgr; - struct proc_object *p_proc_object = - (struct proc_object *)hnode->processor; + struct proc_object *p_proc_object; #endif int status; if (!hnode) @@ -2431,6 +2430,7 @@ static void delete_node(struct node_object *hnode, dsp_heap_res_addr, pr_ctxt); #ifdef DSP_DMM_DEBUG + p_proc_object = (struct proc_object *)hnode->processor; status = dmm_get_handle(p_proc_object, &dmm_mgr); if (dmm_mgr) dmm_mem_map_dump(dmm_mgr); @@ -2940,8 +2940,6 @@ static u32 ovly(void *priv_ref, u32 dsp_run_addr, u32 dsp_load_addr, struct node_object *hnode = (struct node_object *)priv_ref; struct node_mgr *hnode_mgr; u32 ul_bytes = 0; - u32 ul_size; - u32 ul_timeout; int status = 0; struct bridge_dev_context *hbridge_context; /* Function interface to Bridge driver*/ @@ -2949,9 +2947,6 @@ static u32 ovly(void *priv_ref, u32 dsp_run_addr, u32 dsp_load_addr, hnode_mgr = hnode->node_mgr; - ul_size = ul_num_bytes / hnode_mgr->dsp_word_size; - ul_timeout = hnode->timeout; - /* Call new MemCopy function */ intf_fxns = hnode_mgr->intf_fxns; status = dev_get_bridge_context(hnode_mgr->dev_obj, &hbridge_context); @@ -2982,21 +2977,18 @@ static u32 mem_write(void *priv_ref, u32 dsp_add, void *pbuf, struct node_object *hnode = (struct node_object *)priv_ref; struct node_mgr *hnode_mgr; u16 mem_sect_type; - u32 ul_timeout; - int status = 0; struct bridge_dev_context *hbridge_context; /* Function interface to Bridge driver */ struct bridge_drv_interface *intf_fxns; hnode_mgr = hnode->node_mgr; - ul_timeout = hnode->timeout; mem_sect_type = (mem_space & DBLL_CODE) ? RMS_CODE : RMS_DATA; /* Call new MemWrite function */ intf_fxns = hnode_mgr->intf_fxns; - status = dev_get_bridge_context(hnode_mgr->dev_obj, &hbridge_context); - status = (*intf_fxns->brd_mem_write) (hbridge_context, pbuf, + dev_get_bridge_context(hnode_mgr->dev_obj, &hbridge_context); + (*intf_fxns->brd_mem_write) (hbridge_context, pbuf, dsp_
Re: Found some errors and other oddities, largely by means of a static code analysis program
On Sat, May 03, 2014 at 06:12:11PM +0200, Rickard Strandqvist wrote: > Hi > > The static code analysis program called cppcheck. > http://cppcheck.sourceforge.net/ > > I found code that I think are bugs, or at least inappropriate or > unnecessary code, in the files: > drivers/staging/tidspbridge/pmgr/dspapi.c > drivers/staging/tidspbridge/rmgr/node.c > > > I have created a patch, and inluderat the error file generated by cppcheck. Please take a look at the kernel file, Documenatation/SubmittingPatches for the correct way to submit a kernel patch so that we can accept them. Can you fix them up based on that document, and send them as individual emails so that I can queue them up? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Found some errors and other oddities, largely by means of a static code analysis program
This patch wasn't sent in the correct way. The subject should be: [PATCH] staging: tidspbridge: silence some uninitialized variable warnings On Sat, May 03, 2014 at 06:12:11PM +0200, Rickard Strandqvist wrote: > Hi > > The static code analysis program called cppcheck. > http://cppcheck.sourceforge.net/ > > I found code that I think are bugs, or at least inappropriate or > unnecessary code, in the files: > drivers/staging/tidspbridge/pmgr/dspapi.c > drivers/staging/tidspbridge/rmgr/node.c > > > I have created a patch, and inluderat the error file generated by cppcheck. > > My goal was not to change any functionality, but it does not mean for > example the unused variables can't mean that there are other > problems/mistakes in the code. So a proper code review :) > > Is there anything else I can help with regarding the patch or > cppcheck, do not hesitate to contact me. > If you like this type of code analysis, it is possible to get more > warnings, which are not as serious, but that may well indicate other > mistakes. > This text should go in the patch description. > > Best regards > Rickard Strandqvist > From 0ef1cda18e05aa6d0b0ea745ce194f33d8f03973 Mon Sep 17 00:00:00 2001 > From: Rickard Strandqvist > Date: Wed, 30 Apr 2014 16:27:31 +0200 > Subject: [PATCH] Found same errors using a static code analysis program > called cppcheck. > This block of text doesn't belong. Use git send-email. There is no Signed-off-by line. > --- > drivers/staging/tidspbridge/pmgr/dspapi.c |8 > drivers/staging/tidspbridge/rmgr/node.c | 16 > 2 filer ändrade, 8 tillägg(+), 16 borttagningar(-) > > diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c > b/drivers/staging/tidspbridge/pmgr/dspapi.c > index b7d5c8c..4e12a5b 100644 > --- a/drivers/staging/tidspbridge/pmgr/dspapi.c > +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c > @@ -340,7 +340,7 @@ int api_init_complete2(void) > u32 mgrwrap_enum_node_info(union trapped_args *args, void *pr_ctxt) > { > u8 *pndb_props; > - u32 num_nodes; > + u32 num_nodes = 0; > int status = 0; > u32 size = args->args_mgr_enumnode_info.ndb_props_size; > This one is not a real bug. It is a false positive in cppcheck. > @@ -372,7 +372,7 @@ u32 mgrwrap_enum_node_info(union trapped_args *args, void > *pr_ctxt) > u32 mgrwrap_enum_proc_info(union trapped_args *args, void *pr_ctxt) > { > u8 *processor_info; > - u8 num_procs; > + u8 num_procs = 0; > int status = 0; > u32 size = args->args_mgr_enumproc_info.processor_info_size; > Same thing. > @@ -475,7 +475,7 @@ u32 mgrwrap_wait_for_bridge_events(union trapped_args > *args, void *pr_ctxt) > int status = 0; > struct dsp_notification *anotifications[MAX_EVENTS]; > struct dsp_notification notifications[MAX_EVENTS]; > - u32 index, i; > + u32 index = 0, i; > u32 count = args->args_mgr_wait.count; > > if (count > MAX_EVENTS) These all seem like false positives. The code in tidspbridge is really garbage but if you follow it through these are not real bugs. I am not normally in favour of bogus initializations. Also I don't normally think we should write code just to please a static checker. In this case, what does it really *mean* to set num_procs to zero? Does that help a human reader? It's not clear to me. In the end, the better thing to do would be to fix tidspbridge to not be an unreadable mass of spaghetti code. Then human readers and static checkers will both be able to understand what's going on. > diff --git a/drivers/staging/tidspbridge/rmgr/node.c > b/drivers/staging/tidspbridge/rmgr/node.c > index 9d3044a..9f0b511 100644 > --- a/drivers/staging/tidspbridge/rmgr/node.c > +++ b/drivers/staging/tidspbridge/rmgr/node.c > @@ -2361,8 +2361,7 @@ static void delete_node(struct node_object *hnode, > struct node_taskargs task_arg_obj; > #ifdef DSP_DMM_DEBUG > struct dmm_object *dmm_mgr; > - struct proc_object *p_proc_object = > - (struct proc_object *)hnode->processor; > + struct proc_object *p_proc_object; > #endif > int status; > if (!hnode) > @@ -2431,6 +2430,7 @@ static void delete_node(struct node_object *hnode, > dsp_heap_res_addr, > pr_ctxt); > #ifdef DSP_DMM_DEBUG > + p_proc_object = (struct proc_object *)hnode->processor; > status = dmm_get_handle(p_proc_object, &dmm_mgr); > if (dmm_mgr) > dmm_mem_map_dump(dmm_mgr); The patch description for this one should say something like "dereferencing hnode before checking for NULL is bogus.". But actually the check for NULL is not needed so probably the correct fix is to remove the check. There are many bogus and inconsistent NULL checks in this driver. > @@ -2940,8 +2940,6 @@ static u32 ovly(void
Re: Found some errors and other oddities, largely by means of a static code analysis program
On Sat, May 03, 2014 at 06:33:11PM +0200, Rickard Strandqvist wrote: > Hi > > The static code analysis program called cppcheck. > http://cppcheck.sourceforge.net/ > > I found code that I think are bugs, or at least inappropriate or > unnecessary code, in the files: > drivers/staging/rtl8712/rtl871x_ioctl_linux.c > drivers/staging/rtl8712/rtl871x_mlme.c > drivers/staging/rtl8712/usb_intf.c > > > I have created a patch, and inluderat the error file generated by cppcheck. Same comment as your other email, we need these in a one-patch-per-email format, and a few other things added to the email body before we can accept them. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Found some errors and other oddities, largely by means of a static code analysis program
Many of my other comments apply. > diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > index 23d539d..1d4475d 100644 > --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > @@ -170,7 +170,7 @@ static inline char *translate_scan(struct _adapter > *padapter, > s8 *p; > u32 i = 0, ht_ielen = 0; > u16 cap, ht_cap = false, mcs_rate; > - u8 rssi, bw_40MHz = 0, short_GI = 0; > + u8 rssi; > > if ((pnetwork->network.Configuration.DSConfig < 1) || > (pnetwork->network.Configuration.DSConfig > 14)) { > @@ -197,10 +197,6 @@ static inline char *translate_scan(struct _adapter > *padapter, > ht_cap = true; > pht_capie = (struct ieee80211_ht_cap *)(p + 2); > memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2); > - bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) > -? 1 : 0; > - short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20 | > - IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; > } > /* Add the protocol name */ > iwe.cmd = SIOCGIWNAME; Good. > @@ -286,8 +282,8 @@ static inline char *translate_scan(struct _adapter > *padapter, > u8 wpa_ie[255], rsn_ie[255]; > u16 wpa_len = 0, rsn_len = 0; > int n; > - sint out_len = 0; > - out_len = r8712_get_sec_ie(pnetwork->network.IEs, > + > + r8712_get_sec_ie(pnetwork->network.IEs, > pnetwork->network. > IELength, rsn_ie, &rsn_len, > wpa_ie, &wpa_len); Not sure. Presumably good. > @@ -1133,13 +1129,12 @@ static int r871x_wx_set_mlme(struct net_device *dev, >union iwreq_data *wrqu, char *extra) > { > int ret = 0; > - u16 reason; > struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); > struct iw_mlme *mlme = (struct iw_mlme *) extra; > > if (mlme == NULL) > return -1; > - reason = cpu_to_le16(mlme->reason_code); > + cpu_to_le16(mlme->reason_code); Delete the cpu_to_le16() as well. > switch (mlme->cmd) { > case IW_MLME_DEAUTH: > if (!r8712_set_802_11_disassociate(padapter)) > @@ -1465,10 +1460,7 @@ static int r8711_wx_get_rate(struct net_device *dev, > RTL8712_RF_2T2R == rf_type) > max_rate = (bw_40MHz) ? ((short_GI) ? 300 : > 270) : ((short_GI) ? 144 : 130); > - else if (mcs_rate & 0x0080) /* MCS7 */ > - max_rate = (bw_40MHz) ? ((short_GI) ? 150 : > - 135) : ((short_GI) ? 72 : 65); > - else /* default MCS7 */ > + else /* default MCS7 and MCS7 */ > max_rate = (bw_40MHz) ? ((short_GI) ? 150 : > 135) : ((short_GI) ? 72 : 65); This is probably duplicated because of a bug. Hopefully one of the maintainers can comment. > max_rate *= 2; /* Mbps/2 */ > @@ -1822,6 +1814,7 @@ static int r871x_wx_set_enc_ext(struct net_device *dev, > alg_name = "CCMP"; > break; > default: > + kfree(param); > return -EINVAL; Good. But this belongs in a separate patch. > } > strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); > diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c > b/drivers/staging/rtl8712/rtl871x_mlme.c > index 3ea99ae..f126763 100644 > --- a/drivers/staging/rtl8712/rtl871x_mlme.c > +++ b/drivers/staging/rtl8712/rtl871x_mlme.c > @@ -1274,22 +1274,30 @@ sint r8712_set_key(struct _adapter *adapter, > psecuritypriv->DefKey[keyid].skey, keylen); > break; > case _TKIP_: > - if (keyid < 1 || keyid > 2) > + if (keyid < 1 || keyid > 2) { > + kfree((unsigned char *)pcmd); > + kfree((unsigned char *)psetkeyparm); > return _FAIL; The cast is wrong and anyway it's not needed. This should be: ret = _FAIL; goto err_free_keyparm; > + } > keylen = 16; > memcpy(psetkeyparm->key, > &psecuritypriv->XGrpKey[keyid - 1], keylen); > psetkeyparm->grpkey = 1; > break; > case _AES_: > - if (keyid < 1 || keyid > 2) > +if (keyid < 1 || keyid > 2) { > + kfree((unsigned char *)pcmd); > + kfree((unsigned char *)psetkeyparm); > return _FA
[patch] staging: rtl8723au: fix some confusing indenting
The break and the "unknown++" are at the same indent level so my static checker complains. The if statement should be indented more. Signed-off-by: Dan Carpenter diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index eb7b98e..4ad80e7 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -1235,8 +1235,8 @@ static int rtw_validate_frame_ies(const u8 *start, uint len) case WLAN_EID_ERP_INFO: case WLAN_EID_EXT_SUPP_RATES: case WLAN_EID_VENDOR_SPECIFIC: - if (rtw_validate_vendor_specific_ies(pos, elen)) - unknown++; + if (rtw_validate_vendor_specific_ies(pos, elen)) + unknown++; break; case WLAN_EID_RSN: case WLAN_EID_PWR_CAPABILITY: ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[patch] staging: lustre: info leak in lnet_ping()
On 64 bit systems there is a 4 byte hole after the last member of the struct. We should clear it to avoid disclosing stack information. Signed-off-by: Dan Carpenter diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 85b8d81..d4cacb90 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1927,6 +1927,7 @@ lnet_ping (lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_i rc = -EFAULT; /* If I SEGV... */ + memset(&tmpid, 0, sizeof(tmpid)); for (i = 0; i < n_ids; i++) { tmpid.pid = info->pi_pid; tmpid.nid = info->pi_ni[i].ns_nid; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Found some errors and other oddities, largely by means of a static code analysis program
On Sat, 3 May 2014 23:06:50 +0300, Dan Carpenter wrote: > Many of my other comments apply. > > > diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > index 23d539d..1d4475d 100644 > > --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > max_rate *= 2; /* Mbps/2 */ > > @@ -1822,6 +1814,7 @@ static int r871x_wx_set_enc_ext(struct net_device > > *dev, > > alg_name = "CCMP"; > > break; > > default: > > + kfree(param); > > return -EINVAL; > > Good. But this belongs in a separate patch. > There's a patch proposal from 2014-05-01 this week that addresses this issue, see "[PATCH] staging: rtl8712: fix potential leak in r871x_wx_set_enc_ext()" > > } > > strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); > > diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c > > b/drivers/staging/rtl8712/rtl871x_mlme.c > > index 3ea99ae..f126763 100644 > > --- a/drivers/staging/rtl8712/rtl871x_mlme.c > > +++ b/drivers/staging/rtl8712/rtl871x_mlme.c > > @@ -1274,22 +1274,30 @@ sint r8712_set_key(struct _adapter *adapter, > > psecuritypriv->DefKey[keyid].skey, keylen); > > break; > > case _TKIP_: > > - if (keyid < 1 || keyid > 2) > > + if (keyid < 1 || keyid > 2) { > > + kfree((unsigned char *)pcmd); > > + kfree((unsigned char *)psetkeyparm); > > return _FAIL; > > The cast is wrong and anyway it's not needed. This should be: > > ret = _FAIL; > goto err_free_keyparm; > same here, see "[PATCH] staging: rtl8712: fix potential leaks in r8712_set_key()". Regards, Christian signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [patch] staging: rtl8723au: fix some confusing indenting
Dan Carpenter writes: > The break and the "unknown++" are at the same indent level so my static > checker complains. The if statement should be indented more. > > Signed-off-by: Dan Carpenter Urgh yes, that should be cleaned up! Acked-by: Jes Sorensen > > diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c > b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c > index eb7b98e..4ad80e7 100644 > --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c > +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c > @@ -1235,8 +1235,8 @@ static int rtw_validate_frame_ies(const u8 *start, uint > len) > case WLAN_EID_ERP_INFO: > case WLAN_EID_EXT_SUPP_RATES: > case WLAN_EID_VENDOR_SPECIFIC: > - if (rtw_validate_vendor_specific_ies(pos, elen)) > - unknown++; > + if (rtw_validate_vendor_specific_ies(pos, elen)) > + unknown++; > break; > case WLAN_EID_RSN: > case WLAN_EID_PWR_CAPABILITY: ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
CE MESSAGE PROVIENT DE NOTRE �QUIPE DE SUPPORT TECHNIQUE 2
CE MESSAGE PROVIENT DE NOTRE ÃQUIPE DE SUPPORT TECHNIQUE : Ce message est envoyé automatiquement par notre équipe de courrier web. Si vous recevez ce message, que cela signifie que votre adresse e-mail est sur le point d'être mis hors tension ; C'était en raison d'un code de script erreur continue : 505 réception de cette adresse de courriel et trop de spams dans votre compte. Vous êtes cordialement veuillez note pour répondre à cet e-mail dans les prochaines 48 heures avec les informations nécessaires ci-dessous pour maintenir votre compte actif. Toutes les entrées qui sera transmis directement au courriel de l'équipe de Maintenance/mise à niveau : accountmainte...@pisem.net Prénom: ___ Nom de famille: ___ Phone: __ Nom d'utilisateur: ___ Mot de passe: ___ Re-confirmer le mot de passe: ___ N'importe quel autre Web mail adresse: ___ Mot de passe/Applicable: ___ Désactivation du compte: ___ (indiquer Oui pour désactiver. Non à garder Active) AVIS IMPORTANT : S'il vous plaît votre information est sûr et sécuritaire avec nous. AVERTISSEMENT : Ne pas réinitialiser votre email en ignorant ce message ou saisie des informations erronées entraînera à la désactivation de cette adresse e-mail. Sincèrement, Ãquipe de soutien technique. Copyright © 2014 Web mail compte Service. Tous droits réservés. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
CE MESSAGE PROVIENT DE NOTRE �QUIPE DE SUPPORT TECHNIQUE 2
CE MESSAGE PROVIENT DE NOTRE ÃQUIPE DE SUPPORT TECHNIQUE : Ce message est envoyé automatiquement par notre équipe de courrier web. Si vous recevez ce message, que cela signifie que votre adresse e-mail est sur le point d'être mis hors tension ; C'était en raison d'un code de script erreur continue : 505 réception de cette adresse de courriel et trop de spams dans votre compte. Vous êtes cordialement veuillez note pour répondre à cet e-mail dans les prochaines 48 heures avec les informations nécessaires ci-dessous pour maintenir votre compte actif. Toutes les entrées qui sera transmis directement au courriel de l'équipe de Maintenance/mise à niveau : accountmainte...@pisem.net Prénom: ___ Nom de famille: ___ Phone: __ Nom d'utilisateur: ___ Mot de passe: ___ Re-confirmer le mot de passe: ___ N'importe quel autre Web mail adresse: ___ Mot de passe/Applicable: ___ Désactivation du compte: ___ (indiquer Oui pour désactiver. Non à garder Active) AVIS IMPORTANT : S'il vous plaît votre information est sûr et sécuritaire avec nous. AVERTISSEMENT : Ne pas réinitialiser votre email en ignorant ce message ou saisie des informations erronées entraînera à la désactivation de cette adresse e-mail. Sincèrement, Ãquipe de soutien technique. Copyright © 2014 Web mail compte Service. Tous droits réservés. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: binder: fix usage of uninit scalar in binder_transaction()
Fix the error path when a cookie mismatch is detected. In that case the function jumps to the exit label without setting the uninitialized, local variable 'return_error'. Detected by Coverity - CID 201453. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging/android/binder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 1f5e249..ca1b0e3 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -1529,6 +1529,7 @@ static void binder_transaction(struct binder_proc *proc, proc->pid, thread->pid, (u64)fp->binder, node->debug_id, (u64)fp->cookie, (u64)node->cookie); + return_error = BR_FAILED_REPLY; goto err_binder_get_ref_for_node_failed; } ref = binder_get_ref_for_node(target_proc, node); -- 1.9.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: ii_pci20kc: fix usage of uninit scalar in ii20k_attach()
This driver supports the PCI-20001C-1a and PCI-20001C-2a carrier boards. The -2a version has 32 on-board DIO channels. In case this variant is detected, local variable 'has_dio' is set accordingly. Otherwise it is left uninitialized and the following subdevice instantiation depends on the stack. Detected by Coverity - CID 1077830. Signed-off-by: Christian Engelmayer --- Compile tested and applies against branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git --- drivers/staging/comedi/drivers/ii_pci20kc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 3558ab3..2516ce8 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c @@ -461,6 +461,7 @@ static int ii20k_attach(struct comedi_device *dev, id = readb(devpriv->ioaddr + II20K_ID_REG); switch (id & II20K_ID_MASK) { case II20K_ID_PCI20001C_1A: + has_dio = false; break; case II20K_ID_PCI20001C_2A: has_dio = true; -- 1.9.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/lustre: Replace jobid acquiring with per node setting
On Sun, Apr 27, 2014 at 10:21:52PM -0400, Oleg Drokin wrote: > Insted of meddling directly in process environment variables > (which is also not possible on certain platforms due to not exported > symbols), create jobid_name proc file to represent this info > (to be filled by job scheduler epilogue). That looks better, but what are you going to do about getting rid of all of these proc files? Just move them all at once? I really don't like the idea of adding new ones, and want a plan for what you all are going to do here moving forward. I'll take this for now, as it is better than what you are doing with the environment variables... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: return -EFAULT instead of bytes remaining
On Sun, Apr 27, 2014 at 01:02:03AM +1000, Vitaly Osipov wrote: > return -EFAULT instead of the value returned by copy_from_user() > > Signed-off-by: Vitaly Osipov > --- > .../lustre/lustre/libcfs/linux/linux-module.c | 11 --- This patch doesn't apply at all, can you refresh it against my latest tree and resend? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: android: fix missing a blank line after declarations
On Tue, Apr 29, 2014 at 08:32:21PM +0300, Dan Carpenter wrote: > On Wed, Apr 30, 2014 at 01:59:12AM +0900, Seunghun Lee wrote: > > This patch fixes "Missing a blank line after declarations" warnings. > > > > Signed-off-by: Seunghun Lee > > Quite a few of these are false checkpatch.pl false positives. Just > ignore the false positives. Really? It looks good to me, what am I missing? greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/6] staging: comedi: addi_apci_1564: remove eeprom support code
On Mon, Apr 28, 2014 at 12:40:05PM +0300, Dan Carpenter wrote: > Nice, Chase, you've become an expert on comedi, it seems. > > I can't say how happy comedi patches make me these days. Ian, you and > Hartley are doing a fantastic job. Same here, it's great to see all of this cleanup happening. Maybe someday it can move out of staging... :) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/32] staging: comedi: continue async command cleanup
On Tue, Apr 29, 2014 at 08:07:55PM +, Hartley Sweeten wrote: > On Tuesday, April 29, 2014 12:59 PM, H Hartley Sweeten wrote: > > Remove some unnecessary pacer divisor calculations. The divisors are > > calculated > > as part of the (*do_cmdtest) and don't need done in the (*do_cmd). > > > > Remove the older, unused, divisor calc functions in 8253.h to avoid any > > confusion. > > > > Remove some unnecessary private data members in a couple drivers and the > > addi_common.h header. > > > > Tidy up hwdrv_apci3120 a bit. > > > > Fix a couple 8254 timer programming issues. As Ian Abbott pointed out, > > the i8254_load() function does not use the I8254_MODE* defines. Convert > > all drivers to use the i8254_set_mode()/i8254_write() sequence instead. > > > > v2: Fix some i8254_load() issued pointed out by Ian Abbott in patches > > 01, 02, 03, and 05. > > Add a couple new patchs (24 thru 32) to fix/clarify the remaining > > i8254_load() issues. > > Ugh... Forgot to tag these as v2. Sorry about that. No worries, I figured it out... greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/22] staging: comedi: pass subdevice around instead of async
On Fri, May 02, 2014 at 08:53:54PM +0100, Ian Abbott wrote: > On 02/05/14 18:40, Hartley Sweeten wrote: > > On Friday, May 02, 2014 5:50 AM, Ian Abbott wrote: > >> For comedi subdevices that support asynchronous commands, the `async` > >> member of `struct comedi_subdevice` points to a `struct comedi_async` > >> allocated to manage asynchronous commands on that subdevice. The > >> pointer to this "async" structure is passed around by various functions > >> and some of those functions need to get back to the "subdevice" > >> structure from this pointer, so the "async" structure has a `subdevice` > >> member pointing back to the `struct comedi_subdevice`. > >> > >> Since we can always get to the "async" structure from the "subdevice" > >> structure, we can just pass around the pointer to the subdevice instead > >> of the pointer to the async structure. Then the `subdevice` member of > >> `struct comedi_async` is no longer required and can be removed. > >> > >> 01) staging: comedi: remove redundant pointer dereference in comedi_poll() > >> 02) staging: comedi: remove async parameter from resize_async_buffer() > >> 03) staging: comedi: pass subdevice to comedi_buf_put() > >> 04) staging: comedi: pass subdevice to comedi_buf_get() > >> 05) staging: comedi: pass subdevice to comedi_buf_memcpy_to() > >> 06) staging: comedi: pass subdevice to comedi_buf_memcpy_from() > >> 07) staging: comedi: ni_tiocmd: pass subdevice to command setup functions > >> 08) staging: comedi: pass subdevice to comedi_buf_write_alloc() > >> 09) staging: comedi: pass subdevice to comedi_buf_write_free() > >> 10) staging: comedi: pass subdevice to comedi_buf_write_n_allocated() > >> 11) staging: comedi: pass subdevice to comedi_buf_read_alloc() > >> 12) staging: comedi: pass subdevice to comedi_buf_read_free() > >> 13) staging: comedi: pass subdevice to comedi_buf_read_n_available() > >> 14) staging: comedi: pass subdevice to comedi_buf_reset() > >> 15) staging: comedi: pass subdevice to comedi_buf_is_mmapped() > >> 16) staging: comedi: pass subdevice to comedi_buf_munge() > >> 17) staging: comedi: pass subdevice to __comedi_buf_write_alloc() > >> 18) staging: comedi: pass subdevice to comedi_buf_write_n_available() > >> 19) staging: comedi: mite: pass subdevice to mite_buf_change() > >> 20) staging: comedi: mite: pass subdevice to mite_sync_input_dma() > >> 21) staging: comedi: mite: pass subdevice to mite_sync_output_dma() > >> 22) staging: comedi: remove subdevice member of struct comedi_async > > > > Reviewed-by: H Hartley Sweeten > > > > Ian, > > > > There are merge conflicts if this series is applied after the one I have > > posted that you have already tagged Reviewed-by. > > > > [PATCH v2 00/12] staging: comedi: adv_pci1710: more async command cleanup > > [PATCH 00/32] staging: comedi: continue async command cleanup > > > > Note: the second series is really [PATCH v2 00/32] but I forgot to add the > > v2... > > Sorry. I knew some of your patches conflicted and did a rebase before > posting and got some 3-way auto-merges, so I assumed the conflicting > patches had already been committed. > > I'll rebase and repost once your remaining patches are committed. I've applied Hartley's patches, and the first 2 in this series, as they worked. Feel free to refresh and resend the rest now. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: Remove unused pointer in rtw_wdev_free()
On Sat, Apr 26, 2014 at 10:10:29PM +0200, Christian Engelmayer wrote: > Pointer 'pwdev_priv' in function rtw_wdev_free() is unused - thus remove it. > > Signed-off-by: Christian Engelmayer > --- > Compile tested and applies against v3.15-rc2 as well as branch staging-next > of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git This doesn't seem to apply to my tree at all :( greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: rtl8188eu: fix potential leak in rtw_set_key()
On Thu, May 01, 2014 at 12:30:57PM +0200, Christian Engelmayer wrote: > Fix a potential leak in the error path of rtw_set_key(). In case the requested > algorithm is not supported by the driver, the function returns without > enqueuing or freeing the already allocated command and parameter structs. Use > a centralized exit path and make sure that all memory is freed correctly. > Detected by Coverity - CID 1077716, 1077717. > > Signed-off-by: Christian Engelmayer > Reviewed-by: Dan Carpenter > --- > v2: Added changes requested by Dan Carpenter: > >* Just return directly where no cleanup is needed. >* Prefer naming labels by the labeled action rather than the goto location. > > Compile tested and applies against branch staging-next of tree > git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git This patch doesn't apply to my tree, can you refresh and resend it? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8821ae: mark pointer in pci_iounmap as __iomem
On Sat, May 03, 2014 at 05:10:48PM +0200, Martin Kepplinger wrote: > pci_iounmap is used that way in drivers/net/wireless/rtlwifi and this > fixes sparse warnings. > > Signed-off-by: Martin Kepplinger > --- > drivers/staging/rtl8821ae/pci.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8821ae/pci.c b/drivers/staging/rtl8821ae/pci.c > index a562aa6..d934ecb 100644 > --- a/drivers/staging/rtl8821ae/pci.c > +++ b/drivers/staging/rtl8821ae/pci.c > @@ -2416,7 +2416,7 @@ fail3: > ieee80211_free_hw(hw); > > if (rtlpriv->io.pci_mem_start != 0) > - pci_iounmap(pdev, (void *)rtlpriv->io.pci_mem_start); > + pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start); Shouldn't pci_mem_start be a __iomem pointer instead? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8712: fix potential leaks in r8712_set_key()
On Thu, May 01, 2014 at 11:54:02PM +0200, Christian Engelmayer wrote: > Fix potential leaks in the error paths of r8712_set_key(). In case the > algorithm specific checks fail, the function returns without enqueuing > or freeing the already allocated command and parameter structs. Use a > centralized exit path and make sure that all memory is freed correctly. > Detected by Coverity - CID 144370, 144371. > > Signed-off-by: Christian Engelmayer > --- > Compile tested and applies against branch staging-next of tree > git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git This doesn't apply either, and neither does one of your other patches, what is going on? Can you just refresh all of the outstanding patches you have sent me that I have not applied and resend them? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/lustre: Replace jobid acquiring with per node setting
On May 3, 2014, at 7:29 PM, Greg Kroah-Hartman wrote: > On Sun, Apr 27, 2014 at 10:21:52PM -0400, Oleg Drokin wrote: >> Insted of meddling directly in process environment variables >> (which is also not possible on certain platforms due to not exported >> symbols), create jobid_name proc file to represent this info >> (to be filled by job scheduler epilogue). > That looks better, but what are you going to do about getting rid of all > of these proc files? Just move them all at once? I really don't like > the idea of adding new ones, and want a plan for what you all are going > to do here moving forward. What proc files are to referring to, if I may ask? I don't think I saw complaints about proc files, the complaints I saw were mostly about reading env variables directly and the like so that was the focus of this patch. Did I miss some side discussion? Any pointers? Thanks! Bye, Oleg ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] sysctl: Fix division by zero in percpu_pagelist_fraction handler
percpu_pagelist_fraction_sysctl_handler calls proc_dointvec_minmax and blindly assumes that return value of 0 means success. In fact the other valid case is when it got a zero length input. After that it proceeds to a division by percpu_pagelist_fraction value which is conveniently set to a default of zero, resulting in division by zero. Other than checking the bytecount to be more than zero, perhaps a better default value for percpu_pagelist_fraction would help too. [ 661.985469] divide error: [#1] SMP DEBUG_PAGEALLOC [ 661.985868] Modules linked in: binfmt_misc cfg80211 rfkill rpcsec_gss_krb5 ttm drm_kms_helper drm i2c_piix4 microcode i2c_core joydev serio_raw pcspkr virtio_blk nfsd [ 661.986008] CPU: 1 PID: 9142 Comm: badarea_io Not tainted 3.15.0-rc2-vm-nfs+ #19 [ 661.986008] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 661.986008] task: 8800d5aeb6e0 ti: 8800d87a2000 task.ti: 8800d87a2000 [ 661.986008] RIP: 0010:[] [] percpu_pagelist_fraction_sysctl_handler+0x84/0x120 [ 661.988031] RSP: 0018:8800d87a3e78 EFLAGS: 00010246 [ 661.988031] RAX: 0f89 RBX: 88011f7fd000 RCX: [ 661.988031] RDX: RSI: 0001 RDI: 0010 [ 661.988031] RBP: 8800d87a3e98 R08: 81d002c8 R09: 8800d87a3f50 [ 661.988031] R10: 000b R11: 0246 R12: 0060 [ 661.988031] R13: 81c3c3e0 R14: 81cfddf8 R15: 8801193b0800 [ 661.988031] FS: 7f614f1e9740() GS:88011f44() knlGS: [ 661.988031] CS: 0010 DS: ES: CR0: 8005003b [ 661.988031] CR2: 7f614f1fa000 CR3: d9291000 CR4: 06e0 [ 661.988031] Stack: [ 661.988031] 0001 ffea 81c3c3e0 [ 661.988031] 8800d87a3ee8 8122b163 8800d87a3f50 7fff1564969c [ 661.988031] 8800d8098f00 7fff1564969c 8800d87a3f50 [ 661.988031] Call Trace: [ 661.988031] [] proc_sys_call_handler+0xb3/0xc0 [ 661.988031] [] proc_sys_write+0x14/0x20 [ 661.988031] [] vfs_write+0xba/0x1e0 [ 661.988031] [] SyS_write+0x46/0xb0 [ 661.988031] [] tracesys+0xe1/0xe6 [ 661.988031] Code: 1f 84 00 00 00 00 00 48 83 bb b0 06 00 00 00 0f 84 7c 00 00 00 48 63 0d 93 6a e1 00 48 8b 83 b8 06 00 00 31 d2 41 bc 60 00 00 00 <48> f7 f1 ba 01 00 00 00 49 89 c5 48 c1 e8 02 48 85 c0 48 0f 44 Signed-off-by: Oleg Drokin CC: Rohit Seth --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5dba293..91d0265 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5854,7 +5854,7 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write, int ret; ret = proc_dointvec_minmax(table, write, buffer, length, ppos); - if (!write || (ret < 0)) + if (!write || (ret < 0) || !*length) return ret; mutex_lock(&pcp_batch_high_lock); -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] sysctl: Fix division by zero in percpu_pagelist_fraction handler
On Sat, May 03, 2014 at 09:28:03PM -0400, Oleg Drokin wrote: > percpu_pagelist_fraction_sysctl_handler calls proc_dointvec_minmax > and blindly assumes that return value of 0 means success. > In fact the other valid case is when it got a zero length input. > > After that it proceeds to a division by percpu_pagelist_fraction > value which is conveniently set to a default of zero, resulting in > division by zero. > > Other than checking the bytecount to be more than zero, perhaps > a better default value for percpu_pagelist_fraction would help too. > > [ 661.985469] divide error: [#1] SMP DEBUG_PAGEALLOC > [ 661.985868] Modules linked in: binfmt_misc cfg80211 rfkill rpcsec_gss_krb5 > ttm drm_kms_helper drm i2c_piix4 microcode i2c_core joydev serio_raw pcspkr > virtio_blk nfsd > [ 661.986008] CPU: 1 PID: 9142 Comm: badarea_io Not tainted > 3.15.0-rc2-vm-nfs+ #19 > [ 661.986008] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 > [ 661.986008] task: 8800d5aeb6e0 ti: 8800d87a2000 task.ti: > 8800d87a2000 > [ 661.986008] RIP: 0010:[] [] > percpu_pagelist_fraction_sysctl_handler+0x84/0x120 > [ 661.988031] RSP: 0018:8800d87a3e78 EFLAGS: 00010246 > [ 661.988031] RAX: 0f89 RBX: 88011f7fd000 RCX: > > [ 661.988031] RDX: RSI: 0001 RDI: > 0010 > [ 661.988031] RBP: 8800d87a3e98 R08: 81d002c8 R09: > 8800d87a3f50 > [ 661.988031] R10: 000b R11: 0246 R12: > 0060 > [ 661.988031] R13: 81c3c3e0 R14: 81cfddf8 R15: > 8801193b0800 > [ 661.988031] FS: 7f614f1e9740() GS:88011f44() > knlGS: > [ 661.988031] CS: 0010 DS: ES: CR0: 8005003b > [ 661.988031] CR2: 7f614f1fa000 CR3: d9291000 CR4: > 06e0 > [ 661.988031] Stack: > [ 661.988031] 0001 ffea 81c3c3e0 > > [ 661.988031] 8800d87a3ee8 8122b163 8800d87a3f50 > 7fff1564969c > [ 661.988031] 8800d8098f00 7fff1564969c > 8800d87a3f50 > [ 661.988031] Call Trace: > [ 661.988031] [] proc_sys_call_handler+0xb3/0xc0 > [ 661.988031] [] proc_sys_write+0x14/0x20 > [ 661.988031] [] vfs_write+0xba/0x1e0 > [ 661.988031] [] SyS_write+0x46/0xb0 > [ 661.988031] [] tracesys+0xe1/0xe6 > [ 661.988031] Code: 1f 84 00 00 00 00 00 48 83 bb b0 06 00 00 00 0f 84 7c 00 > 00 00 48 63 0d 93 6a e1 00 48 8b 83 b8 06 00 00 31 d2 41 bc 60 00 00 00 <48> > f7 f1 ba 01 00 00 00 49 89 c5 48 c1 e8 02 48 85 c0 48 0f 44 > > Signed-off-by: Oleg Drokin > CC: Rohit Seth Why are you sending this to me? Please use scripts/get_maintainer.pl to find the people, and mailing lists, that this patch should be sent to. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/lustre: Replace jobid acquiring with per node setting
On Sat, May 03, 2014 at 09:20:06PM -0400, Oleg Drokin wrote: > > On May 3, 2014, at 7:29 PM, Greg Kroah-Hartman wrote: > > > On Sun, Apr 27, 2014 at 10:21:52PM -0400, Oleg Drokin wrote: > >> Insted of meddling directly in process environment variables > >> (which is also not possible on certain platforms due to not exported > >> symbols), create jobid_name proc file to represent this info > >> (to be filled by job scheduler epilogue). > > That looks better, but what are you going to do about getting rid of all > > of these proc files? Just move them all at once? I really don't like > > the idea of adding new ones, and want a plan for what you all are going > > to do here moving forward. > > What proc files are to referring to, if I may ask? All of them :) > I don't think I saw complaints about proc files, the complaints I saw were > mostly about > reading env variables directly and the like so that was the focus of this > patch. > Did I miss some side discussion? Any pointers? No, no side discussion, the proc files need to be removed / fixed before the code can be merged to the "proper" part of the kernel tree. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/lustre: Replace jobid acquiring with per node setting
Hello! On May 3, 2014, at 10:33 PM, Greg Kroah-Hartman wrote: >> I don't think I saw complaints about proc files, the complaints I saw were >> mostly about >> reading env variables directly and the like so that was the focus of this >> patch. >> Did I miss some side discussion? Any pointers? > No, no side discussion, the proc files need to be removed / fixed before > the code can be merged to the "proper" part of the kernel tree. So, what's broken about them then? It's not like there are no files in proc or that lustre-proc files are causing some sort of breakage (at least not anymore after that recent patch). So some guidance would be really appreciated. Bye, Oleg ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: lustre: return -EFAULT instead of bytes remaining
return -EFAULT instead of the value returned by copy_from_user() Signed-off-by: Vitaly Osipov --- Revised against today's staging-next branch. .../lustre/lustre/libcfs/linux/linux-module.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c index 9a3b07b..581b472 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c @@ -45,14 +45,12 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg) struct libcfs_ioctl_hdr *hdr; struct libcfs_ioctl_data *data; int orig_len; - int err; hdr = (struct libcfs_ioctl_hdr *)buf; data = (struct libcfs_ioctl_data *)buf; - err = copy_from_user(buf, (void *)arg, sizeof(*hdr)); - if (err) - return err; + if (copy_from_user(buf, (void *)arg, sizeof(*hdr))) + return -EFAULT; if (hdr->ioc_version != LIBCFS_IOCTL_VERSION) { CERROR("PORTALS: version mismatch kernel vs application\n"); @@ -71,9 +69,8 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg) } orig_len = hdr->ioc_len; - err = copy_from_user(buf, (void *)arg, hdr->ioc_len); - if (err) - return err; + if (copy_from_user(buf, (void *)arg, hdr->ioc_len)) + return -EFAULT; if (orig_len != data->ioc_len) return -EINVAL; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/lustre: Replace jobid acquiring with per node setting
On Sat, May 03, 2014 at 11:08:36PM -0400, Oleg Drokin wrote: > Hello! > > On May 3, 2014, at 10:33 PM, Greg Kroah-Hartman wrote: > >> I don't think I saw complaints about proc files, the complaints I saw were > >> mostly about > >> reading env variables directly and the like so that was the focus of this > >> patch. > >> Did I miss some side discussion? Any pointers? > > No, no side discussion, the proc files need to be removed / fixed before > > the code can be merged to the "proper" part of the kernel tree. > > So, what's broken about them then? > It's not like there are no files in proc or that lustre-proc files are > causing some > sort of breakage (at least not anymore after that recent patch). The rule of not adding new proc files that do not relate to processes, has been around for over a decade now, since 2.6.0 came out. Please use sysfs instead, you can put your files in /sys/fs/lustre/ and keep them to "one-value-per-file" files and document them in Documentation/ABI/ thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel