Re: [Outreachy kernel] [PATCH v2 0/6] staging: rtl8712: fix coding style issues

2018-03-02 Thread Julia Lawall


On Sat, 3 Mar 2018, Arushi Singhal wrote:

> Fix issues found with checkpatch.pl to conform to the Linux
> kernel coding style.

For the series:

Acked-by: Julia Lawall 


>
> Changes in v2:
> * From and Signed-off emails were not same in v1.
> * Added detailed commit message
>
> Arushi Singhal (6):
>   staging: rtl8712: Fixed 'tabstop' coding style warning
>   staging: rtl8712: match alignment with open parenthesis
>   staging: rtl8712: Remove multiple blank line(s)
>   staging: rtl8712: Added spaces around '+'
>   staging: rtl8712: Add spaces around '|'
>   staging: rtl8712: remove unnecessary parentheses
>
>  drivers/staging/rtl8712/drv_types.h|  2 +-
>  drivers/staging/rtl8712/mlme_linux.c   |  2 +-
>  drivers/staging/rtl8712/os_intfs.c |  3 +-
>  drivers/staging/rtl8712/recv_linux.c   |  4 +-
>  drivers/staging/rtl8712/rtl8712_bitdef.h   |  1 -
>  drivers/staging/rtl8712/rtl8712_cmd.c  |  8 +--
>  drivers/staging/rtl8712/rtl8712_cmd.h  |  4 +-
>  drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h   |  2 +-
>  drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h   |  2 -
>  drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h |  1 -
>  drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h |  2 -
>  drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h  |  1 -
>  drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h  |  2 -
>  drivers/staging/rtl8712/rtl8712_gp_bitdef.h|  2 +-
>  drivers/staging/rtl8712/rtl8712_gp_regdef.h|  1 -
>  drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h |  1 -
>  drivers/staging/rtl8712/rtl8712_led.c  | 70 
> +++---
>  17 files changed, 48 insertions(+), 60 deletions(-)
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1520055156-8388-1-git-send-email-arushisinghal19971997%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/6] staging: rtl8712: Fixed 'tabstop' coding style warning

2018-03-02 Thread Arushi Singhal
Replace a mix of tabs and spaces indentation by tabs only.

Fixed checkpatch warning "Statements should start on a tabstop".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/drv_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index ae79047..ede99e9 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -161,7 +161,7 @@ struct _adapter {
u8  EepromAddressSize;
u8  hw_init_completed;
struct task_struct *cmdThread;
-pid_t evtThread;
+   pid_t evtThread;
struct task_struct *xmitThread;
pid_t recvThread;
uint (*dvobj_init)(struct _adapter *adapter);
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 6/6] staging: rtl8712: remove unnecessary parentheses

2018-03-02 Thread Arushi Singhal
Remove unnecessary parentheses around variables to conform to the Linux
kernel coding style. Issue found using checkpatch.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/recv_linux.c  |  4 +-
 drivers/staging/rtl8712/rtl8712_cmd.c |  8 ++--
 drivers/staging/rtl8712/rtl8712_led.c | 70 +--
 3 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/rtl8712/recv_linux.c 
b/drivers/staging/rtl8712/recv_linux.c
index 986a55b..8cf4286 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -111,8 +111,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
_pkt *skb;
struct rx_pkt_attrib *pattrib = _frame->u.hdr.attrib;
 
-   precvpriv = &(padapter->recvpriv);
-   pfree_recv_queue = &(precvpriv->free_recv_queue);
+   precvpriv = >recvpriv;
+   pfree_recv_queue = >free_recv_queue;
skb = precv_frame->u.hdr.pkt;
if (!skb)
goto _recv_indicatepkt_drop;
diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c 
b/drivers/staging/rtl8712/rtl8712_cmd.c
index 9c8e0c5..b1dfe9f 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.c
+++ b/drivers/staging/rtl8712/rtl8712_cmd.c
@@ -320,7 +320,7 @@ int r8712_cmd_thread(void *context)
struct tx_desc *pdesc;
void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
struct _adapter *padapter = context;
-   struct  cmd_priv*pcmdpriv = &(padapter->cmdpriv);
+   struct  cmd_priv *pcmdpriv = >cmdpriv;
struct completion *cmd_queue_comp =
>cmd_queue_comp;
struct mutex *pwctrl_lock = >pwrctrlpriv.mutex_lock;
@@ -334,7 +334,7 @@ int r8712_cmd_thread(void *context)
if (r8712_register_cmd_alive(padapter) != _SUCCESS)
continue;
 _next:
-   pcmd = r8712_dequeue_cmd(&(pcmdpriv->cmd_queue));
+   pcmd = r8712_dequeue_cmd(>cmd_queue);
if (!(pcmd)) {
r8712_unregister_cmd_alive(padapter);
continue;
@@ -419,7 +419,7 @@ int r8712_cmd_thread(void *context)
}
/* free all cmd_obj resources */
do {
-   pcmd = r8712_dequeue_cmd(&(pcmdpriv->cmd_queue));
+   pcmd = r8712_dequeue_cmd(>cmd_queue);
if (!pcmd)
break;
r8712_free_cmd_obj(pcmd);
@@ -433,7 +433,7 @@ void r8712_event_handle(struct _adapter *padapter, __le32 
*peventbuf)
u8 evt_code, evt_seq;
u16 evt_sz;
void (*event_callback)(struct _adapter *dev, u8 *pbuf);
-   struct  evt_priv *pevt_priv = &(padapter->evtpriv);
+   struct  evt_priv *pevt_priv = >evtpriv;
 
if (!peventbuf)
goto _abort_event_;
diff --git a/drivers/staging/rtl8712/rtl8712_led.c 
b/drivers/staging/rtl8712/rtl8712_led.c
index 455fba7..e907734 100644
--- a/drivers/staging/rtl8712/rtl8712_led.c
+++ b/drivers/staging/rtl8712/rtl8712_led.c
@@ -181,11 +181,11 @@ static void SwLedOff(struct _adapter *padapter, struct 
LED_871x *pLed)
  */
 void r8712_InitSwLeds(struct _adapter *padapter)
 {
-   struct led_priv *pledpriv = &(padapter->ledpriv);
+   struct led_priv *pledpriv = >ledpriv;
 
pledpriv->LedControlHandler = LedControl871x;
-   InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);
-   InitLed871x(padapter, &(pledpriv->SwLed1), LED_PIN_LED1);
+   InitLed871x(padapter, >SwLed0, LED_PIN_LED0);
+   InitLed871x(padapter, >SwLed1, LED_PIN_LED1);
 }
 
 /* Description:
@@ -193,10 +193,10 @@ void r8712_InitSwLeds(struct _adapter *padapter)
  */
 void r8712_DeInitSwLeds(struct _adapter *padapter)
 {
-   struct led_priv *ledpriv = &(padapter->ledpriv);
+   struct led_priv *ledpriv = >ledpriv;
 
-   DeInitLed871x(&(ledpriv->SwLed0));
-   DeInitLed871x(&(ledpriv->SwLed1));
+   DeInitLed871x(>SwLed0);
+   DeInitLed871x(>SwLed1);
 }
 
 /* Description:
@@ -206,7 +206,7 @@ void r8712_DeInitSwLeds(struct _adapter *padapter)
 static void SwLedBlink(struct LED_871x *pLed)
 {
struct _adapter *padapter = pLed->padapter;
-   struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+   struct mlme_priv *pmlmepriv = >mlmepriv;
u8 bStopBlinking = false;
 
/* Change LED according to BlinkingLedState specified. */
@@ -281,14 +281,14 @@ static void SwLedBlink(struct LED_871x *pLed)
 static void SwLedBlink1(struct LED_871x *pLed)
 {
struct _adapter *padapter = pLed->padapter;
-   struct led_priv *ledpriv = &(padapter->ledpriv);
-   struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-   struct eeprom_priv *peeprompriv = &(padapter->eeprompriv);
-   struct LED_871x *pLed1 = &(ledpriv->SwLed1);
+   struct led_priv *ledpriv = >ledpriv;
+   struct mlme_priv *pmlmepriv = >mlmepriv;
+   struct eeprom_priv *peeprompriv = 

[PATCH v2 2/6] staging: rtl8712: match alignment with open parenthesis

2018-03-02 Thread Arushi Singhal
Delete/Add tabs and spaces to align the code to fix the
checkpatch issue: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/mlme_linux.c | 2 +-
 drivers/staging/rtl8712/os_intfs.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/mlme_linux.c 
b/drivers/staging/rtl8712/mlme_linux.c
index 3c7c4a4..baaa52f 100644
--- a/drivers/staging/rtl8712/mlme_linux.c
+++ b/drivers/staging/rtl8712/mlme_linux.c
@@ -36,7 +36,7 @@ static void sitesurvey_ctrl_handler(struct timer_list *t)
 {
struct _adapter *adapter =
from_timer(adapter, t,
-   mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer);
+  mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer);
 
_r8712_sitesurvey_ctrl_handler(adapter);
mod_timer(>mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index e7df5d7..d6d27da 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -230,7 +230,7 @@ struct net_device *r8712_init_netdev(void)
 static u32 start_drv_threads(struct _adapter *padapter)
 {
padapter->cmdThread = kthread_run(r8712_cmd_thread, padapter, "%s",
- padapter->pnetdev->name);
+ padapter->pnetdev->name);
if (IS_ERR(padapter->cmdThread))
return _FAIL;
return _SUCCESS;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 4/6] staging: rtl8712: Added spaces around '+'

2018-03-02 Thread Arushi Singhal
Add spaces around arithmetic operator '+',  to conform to the Linux
kernel coding style. Issue found using checkpatch.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/rtl8712_cmd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_cmd.h 
b/drivers/staging/rtl8712/rtl8712_cmd.h
index 67e9e91..9181bb6 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.h
+++ b/drivers/staging/rtl8712/rtl8712_cmd.h
@@ -145,8 +145,8 @@ enum rtl8712_h2c_cmd {
 #define _SetBBReg_CMD_ _Write_BBREG_CMD_
 #define _GetRFReg_CMD_ _Read_RFREG_CMD_
 #define _SetRFReg_CMD_ _Write_RFREG_CMD_
-#define _DRV_INT_CMD_  (MAX_H2CCMD+1)
-#define _SetRFIntFs_CMD_   (MAX_H2CCMD+2)
+#define _DRV_INT_CMD_  (MAX_H2CCMD + 1)
+#define _SetRFIntFs_CMD_   (MAX_H2CCMD + 2)
 
 #ifdef _RTL8712_CMD_C_
 static struct _cmd_callbackcmd_callback[] = {
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 3/6] staging: rtl8712: Remove multiple blank line(s)

2018-03-02 Thread Arushi Singhal
Remove extra blank line(s) to conform to the Linux
kernel coding style. Issue found using checkpatch.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/os_intfs.c | 1 -
 drivers/staging/rtl8712/rtl8712_bitdef.h   | 1 -
 drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h   | 2 --
 drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h | 1 -
 drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h | 2 --
 drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h  | 1 -
 drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h  | 2 --
 drivers/staging/rtl8712/rtl8712_gp_regdef.h| 1 -
 drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h | 1 -
 9 files changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index d6d27da..ff4e451 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -347,7 +347,6 @@ u8 r8712_free_drv_sw(struct _adapter *padapter)
return _SUCCESS;
 }
 
-
 static void enable_video_mode(struct _adapter *padapter, int cbw40_value)
 {
/*   bit 8:
diff --git a/drivers/staging/rtl8712/rtl8712_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_bitdef.h
index bff57a8..dee35fe 100644
--- a/drivers/staging/rtl8712/rtl8712_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_bitdef.h
@@ -18,7 +18,6 @@
  *
  
**/
 
-
 #ifndef __RTL8712_BITDEF_H__
 #define __RTL8712_BITDEF_H__
 
diff --git a/drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h 
b/drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h
index 9374f1c..8df42a7 100644
--- a/drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h
+++ b/drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h
@@ -20,7 +20,6 @@
 #ifndef __RTL8712_CMDCTRL_REGDEF_H__
 #define __RTL8712_CMDCTRL_REGDEF_H__
 
-
 #define CR (RTL8712_CMDCTRL_ + 0x)
 #define TXPAUSE(RTL8712_CMDCTRL_ + 0x0002)
 #define TCR(RTL8712_CMDCTRL_ + 0x0004)
@@ -29,6 +28,5 @@
 #define SYSF_CFG   (RTL8712_CMDCTRL_ + 0x000D)
 #define MBIDCTRL   (RTL8712_CMDCTRL_ + 0x000E)
 
-
 #endif /* __RTL8712_CMDCTRL_REGDEF_H__ */
 
diff --git a/drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h
index 8bd4837..4b34367 100644
--- a/drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h
@@ -51,5 +51,4 @@
 /*FDLOCKFLAG1*/
 #define_LOCKFLAG1_MSK  0x03
 
-
 #endif /* __RTL8712_DEBUGCTRL_BITDEF_H__ */
diff --git a/drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h 
b/drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h
index 43630bb..d7c964d 100644
--- a/drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h
+++ b/drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h
@@ -41,7 +41,5 @@
 #define TRXPKTBUF_DBG_CTRL (RTL8712_DEBUGCTRL_ + 0x38)
 #define DPLL_MON   (RTL8712_DEBUGCTRL_ + 0x3A)
 
-
-
 #endif /* __RTL8712_DEBUGCTRL_REGDEF_H__ */
 
diff --git a/drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h
index c564dc8..bd82404 100644
--- a/drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h
@@ -140,6 +140,5 @@
 /*TXFF_PG_NUM*/
 #define_TXFF_PG_NUM_MSK0x0FFF
 
-
 #endif /*  __RTL8712_FIFOCTRL_BITDEF_H__ */
 
diff --git a/drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h 
b/drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h
index 29b89c4..6d52738 100644
--- a/drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h
+++ b/drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h
@@ -71,6 +71,4 @@
 #define TXQ_PGADD  (RTL8712_FIFOCTRL_ + 0xB3)
 #define TXFF_PG_NUM(RTL8712_FIFOCTRL_ + 0xB4)
 
-
-
 #endif /* __RTL8712_FIFOCTRL_REGDEF_H__ */
diff --git a/drivers/staging/rtl8712/rtl8712_gp_regdef.h 
b/drivers/staging/rtl8712/rtl8712_gp_regdef.h
index 8fc68f6..a037936 100644
--- a/drivers/staging/rtl8712/rtl8712_gp_regdef.h
+++ b/drivers/staging/rtl8712/rtl8712_gp_regdef.h
@@ -37,6 +37,5 @@
 #define PHY_REG_RPT(RTL8712_GP_ + 0x13)
 #define PHY_REG_DATA   (RTL8712_GP_ + 0x14)
 
-
 #endif /*__RTL8712_GP_REGDEF_H__ */
 
diff --git a/drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h
index 49598c3..2a561d2 100644
--- a/drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h
@@ -53,6 +53,5 @@
 #define_VODOK  BIT(1)
 #define_RXOK   BIT(0)
 
-
 #endif /*__RTL8712_INTERRUPT_BITDEF_H__*/
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 5/6] staging: rtl8712: Add spaces around '|'

2018-03-02 Thread Arushi Singhal
Add spaces around '|' to conform to the Linux
kernel coding style. Issue found using checkpatch.
CHECK: spaces preferred around that '|'.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h | 2 +-
 drivers/staging/rtl8712/rtl8712_gp_bitdef.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h
index b7dda90..4b8985d 100644
--- a/drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h
@@ -63,7 +63,7 @@
 #define _IMEM_CHK_RPT  BIT(1)
 #define _IMEM_CODE_DONEBIT(0)
 
-#define_TXDMA_INIT_VALUE   (_IMEM_CHK_RPT|_EMEM_CHK_RPT)
+#define_TXDMA_INIT_VALUE   (_IMEM_CHK_RPT | _EMEM_CHK_RPT)
 
 /*RCR*/
 #define_ENMBID BIT(27)
diff --git a/drivers/staging/rtl8712/rtl8712_gp_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_gp_bitdef.h
index 44c9060..66c35c9 100644
--- a/drivers/staging/rtl8712/rtl8712_gp_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_gp_bitdef.h
@@ -70,7 +70,7 @@
 #defineGPIOSEL_PHYDBG  1   /* PHYDBG*/
 #defineGPIOSEL_BT  2   /* BT_coex*/
 #defineGPIOSEL_WLANDBG 3   /* WLANDBG*/
-#defineGPIOSEL_GPIO_MASK   (~(BIT(0)|BIT(1)))
+#defineGPIOSEL_GPIO_MASK   (~(BIT(0) | BIT(1)))
 /* HW Radio OFF switch (GPIO BIT) */
 #defineHAL_8192S_HW_GPIO_OFF_BIT   BIT(3)
 #defineHAL_8192S_HW_GPIO_OFF_MASK  0xF7
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/6] staging: rtl8712: fix coding style issues

2018-03-02 Thread Arushi Singhal
Fix issues found with checkpatch.pl to conform to the Linux
kernel coding style.

Changes in v2:
* From and Signed-off emails were not same in v1.
* Added detailed commit message

Arushi Singhal (6):
  staging: rtl8712: Fixed 'tabstop' coding style warning
  staging: rtl8712: match alignment with open parenthesis
  staging: rtl8712: Remove multiple blank line(s)
  staging: rtl8712: Added spaces around '+'
  staging: rtl8712: Add spaces around '|'
  staging: rtl8712: remove unnecessary parentheses

 drivers/staging/rtl8712/drv_types.h|  2 +-
 drivers/staging/rtl8712/mlme_linux.c   |  2 +-
 drivers/staging/rtl8712/os_intfs.c |  3 +-
 drivers/staging/rtl8712/recv_linux.c   |  4 +-
 drivers/staging/rtl8712/rtl8712_bitdef.h   |  1 -
 drivers/staging/rtl8712/rtl8712_cmd.c  |  8 +--
 drivers/staging/rtl8712/rtl8712_cmd.h  |  4 +-
 drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h   |  2 +-
 drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h   |  2 -
 drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h |  1 -
 drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h |  2 -
 drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h  |  1 -
 drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h  |  2 -
 drivers/staging/rtl8712/rtl8712_gp_bitdef.h|  2 +-
 drivers/staging/rtl8712/rtl8712_gp_regdef.h|  1 -
 drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h |  1 -
 drivers/staging/rtl8712/rtl8712_led.c  | 70 +++---
 17 files changed, 48 insertions(+), 60 deletions(-)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Drivers: hv: vmbus: respect what we get from hv_get_synint_state()

2018-03-02 Thread Dexuan Cui
I didn't really hit a bug, but just happened to notice the redundant line.

Signed-off-by: Dexuan Cui 
Cc: Stephen Hemminger 
Cc: K. Y. Srinivasan 
Cc: sta...@vger.kernel.org
---
 drivers/hv/hv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index fe96aab9e794..2bdb2bba911e 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -252,7 +252,6 @@ int hv_synic_init(unsigned int cpu)
hv_get_synint_state(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT,
shared_sint.as_uint64);
 
-   shared_sint.as_uint64 = 0;
shared_sint.vector = HYPERVISOR_CALLBACK_VECTOR;
shared_sint.masked = false;
if (ms_hyperv.hints & HV_X64_DEPRECATING_AEOI_RECOMMENDED)
-- 
2.7.4
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] PCI: hv: fix a comment typo in _hv_pcifront_read_config()

2018-03-02 Thread Dexuan Cui
No functional change.

Signed-off-by: Dexuan Cui 
Fixes: bdd74440d9e8 ("PCI: hv: Add explicit barriers to config space access")
Cc: Vitaly Kuznetsov 
Cc: sta...@vger.kernel.org
Cc: Stephen Hemminger 
Cc: K. Y. Srinivasan 
---
 drivers/pci/host/pci-hyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 2faf38eab785..1233300f41c6 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -653,7 +653,7 @@ static void _hv_pcifront_read_config(struct hv_pci_dev 
*hpdev, int where,
break;
}
/*
-* Make sure the write was done before we release the spinlock
+* Make sure the read was done before we release the spinlock
 * allowing consecutive reads/writes.
 */
mb();
-- 
2.7.4
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3] staging:iio:meter: Add name to function definition arguments

2018-03-02 Thread Rodrigo Siqueira
On 02/24, Jonathan Cameron wrote:
> On Wed, 21 Feb 2018 16:54:35 -0300
> Rodrigo Siqueira  wrote:
> 
> > This patch fixes the checkpatch.pl warning:
> > 
> > drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition
> > argument 'struct device *' should also have an identifier name...
> > 
> > This commit adds arguments names to the signature declared in the
> > ade7854_state struct. For consistency reason, It also renames all
> > arguments in function definitions.
> > 
> > Signed-off-by: Rodrigo Siqueira 
> 
> I would have slightly preferred this as two patches - one doing the
> renames and one introducing them where they were missing.
> 
> Applied to the togreg branch of iio.git and pushed out as testing
> for the autobuilders to play with it.

Hi Jonathan,

I looked at 'togreg' and 'testing' branch, and I did not find the patch.
Is it in another branch?

Thanks.

 
> Thanks,
> 
> Jonathan
> 
> > ---
> > Changes in v2:
> >   - Make the commit message clearer.
> >   - Use the same arguments name across signatures and definitions.
> > Changes in v3:
> >   - Fix name in the email header.
> > 
> >  drivers/staging/iio/meter/ade7754.c |  6 +++---
> >  drivers/staging/iio/meter/ade7854-i2c.c | 28 ++--
> >  drivers/staging/iio/meter/ade7854-spi.c | 28 ++--
> >  drivers/staging/iio/meter/ade7854.h | 28 ++--
> >  4 files changed, 45 insertions(+), 45 deletions(-)
> > 
> > diff --git a/drivers/staging/iio/meter/ade7754.c 
> > b/drivers/staging/iio/meter/ade7754.c
> > index 3a1e342d75fb..9aa067736715 100644
> > --- a/drivers/staging/iio/meter/ade7754.c
> > +++ b/drivers/staging/iio/meter/ade7754.c
> > @@ -132,7 +132,7 @@ static int ade7754_spi_write_reg_8(struct device *dev, 
> > u8 reg_address, u8 val)
> >  }
> >  
> >  static int ade7754_spi_write_reg_16(struct device *dev,
> > -   u8 reg_address, u16 value)
> > +   u8 reg_address, u16 val)
> >  {
> > int ret;
> > struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> > @@ -140,8 +140,8 @@ static int ade7754_spi_write_reg_16(struct device *dev,
> >  
> > mutex_lock(>buf_lock);
> > st->tx[0] = ADE7754_WRITE_REG(reg_address);
> > -   st->tx[1] = (value >> 8) & 0xFF;
> > -   st->tx[2] = value & 0xFF;
> > +   st->tx[1] = (val >> 8) & 0xFF;
> > +   st->tx[2] = val & 0xFF;
> > ret = spi_write(st->us, st->tx, 3);
> > mutex_unlock(>buf_lock);
> >  
> > diff --git a/drivers/staging/iio/meter/ade7854-i2c.c 
> > b/drivers/staging/iio/meter/ade7854-i2c.c
> > index 8106f8cceeab..317e4f0d8176 100644
> > --- a/drivers/staging/iio/meter/ade7854-i2c.c
> > +++ b/drivers/staging/iio/meter/ade7854-i2c.c
> > @@ -17,7 +17,7 @@
> >  
> >  static int ade7854_i2c_write_reg_8(struct device *dev,
> >u16 reg_address,
> > -  u8 value)
> > +  u8 val)
> >  {
> > int ret;
> > struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> > @@ -26,7 +26,7 @@ static int ade7854_i2c_write_reg_8(struct device *dev,
> > mutex_lock(>buf_lock);
> > st->tx[0] = (reg_address >> 8) & 0xFF;
> > st->tx[1] = reg_address & 0xFF;
> > -   st->tx[2] = value;
> > +   st->tx[2] = val;
> >  
> > ret = i2c_master_send(st->i2c, st->tx, 3);
> > mutex_unlock(>buf_lock);
> > @@ -36,7 +36,7 @@ static int ade7854_i2c_write_reg_8(struct device *dev,
> >  
> >  static int ade7854_i2c_write_reg_16(struct device *dev,
> > u16 reg_address,
> > -   u16 value)
> > +   u16 val)
> >  {
> > int ret;
> > struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> > @@ -45,8 +45,8 @@ static int ade7854_i2c_write_reg_16(struct device *dev,
> > mutex_lock(>buf_lock);
> > st->tx[0] = (reg_address >> 8) & 0xFF;
> > st->tx[1] = reg_address & 0xFF;
> > -   st->tx[2] = (value >> 8) & 0xFF;
> > -   st->tx[3] = value & 0xFF;
> > +   st->tx[2] = (val >> 8) & 0xFF;
> > +   st->tx[3] = val & 0xFF;
> >  
> > ret = i2c_master_send(st->i2c, st->tx, 4);
> > mutex_unlock(>buf_lock);
> > @@ -56,7 +56,7 @@ static int ade7854_i2c_write_reg_16(struct device *dev,
> >  
> >  static int ade7854_i2c_write_reg_24(struct device *dev,
> > u16 reg_address,
> > -   u32 value)
> > +   u32 val)
> >  {
> > int ret;
> > struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> > @@ -65,9 +65,9 @@ static int ade7854_i2c_write_reg_24(struct device *dev,
> > mutex_lock(>buf_lock);
> > st->tx[0] = (reg_address >> 8) & 0xFF;
> > st->tx[1] = reg_address & 0xFF;
> > -   st->tx[2] = (value >> 16) & 0xFF;
> > -   st->tx[3] = (value >> 8) & 0xFF;
> > -   st->tx[4] = value & 0xFF;
> > +   st->tx[2] = (val >> 16) & 0xFF;
> > +   st->tx[3] = 

Re: [PATCH PATCH net v2 0/9] hv_netvsc: minor fixes

2018-03-02 Thread Jakub Kicinski
On Fri,  2 Mar 2018 13:49:00 -0800, Stephen Hemminger wrote:
>- change propogate rx mode patch to handle startup of vf

Thanks! :)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 9/9] hv_netvsc: propagate rx filters to VF

2018-03-02 Thread Stephen Hemminger
The netvsc device should propagate filters to the SR-IOV VF
device (if present). The flags also need to be propagated to the
VF device as well. This only really matters on local Hyper-V
since Azure does not support multiple addresses.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc_drv.c | 40 
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 5299cfb16ce2..cdb78eefab67 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -66,10 +66,36 @@ static int debug = -1;
 module_param(debug, int, S_IRUGO);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
 
-static void netvsc_set_multicast_list(struct net_device *net)
+static void netvsc_change_rx_flags(struct net_device *net, int change)
 {
-   struct net_device_context *net_device_ctx = netdev_priv(net);
-   struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
+   struct net_device_context *ndev_ctx = netdev_priv(net);
+   struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
+   int inc;
+
+   if (!vf_netdev)
+   return;
+
+   if (change & IFF_PROMISC) {
+   inc = (net->flags & IFF_PROMISC) ? 1 : -1;
+   dev_set_promiscuity(vf_netdev, inc);
+   }
+
+   if (change & IFF_ALLMULTI) {
+   inc = (net->flags & IFF_ALLMULTI) ? 1 : -1;
+   dev_set_allmulti(vf_netdev, inc);
+   }
+}
+
+static void netvsc_set_rx_mode(struct net_device *net)
+{
+   struct net_device_context *ndev_ctx = netdev_priv(net);
+   struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
+   struct netvsc_device *nvdev = rtnl_dereference(ndev_ctx->nvdev);
+
+   if (vf_netdev) {
+   dev_uc_sync(vf_netdev, net);
+   dev_mc_sync(vf_netdev, net);
+   }
 
rndis_filter_update(nvdev);
 }
@@ -1586,7 +1612,8 @@ static const struct net_device_ops device_ops = {
.ndo_open = netvsc_open,
.ndo_stop = netvsc_close,
.ndo_start_xmit =   netvsc_start_xmit,
-   .ndo_set_rx_mode =  netvsc_set_multicast_list,
+   .ndo_change_rx_flags =  netvsc_change_rx_flags,
+   .ndo_set_rx_mode =  netvsc_set_rx_mode,
.ndo_change_mtu =   netvsc_change_mtu,
.ndo_validate_addr =eth_validate_addr,
.ndo_set_mac_address =  netvsc_set_mac_addr,
@@ -1817,6 +1844,11 @@ static void __netvsc_vf_setup(struct net_device *ndev,
netdev_warn(vf_netdev,
"unable to change mtu to %u\n", ndev->mtu);
 
+   /* set multicast etc flags on VF */
+   dev_change_flags(vf_netdev, ndev->flags | IFF_SLAVE);
+   dev_uc_sync(vf_netdev, ndev);
+   dev_mc_sync(vf_netdev, ndev);
+
if (netif_running(ndev)) {
ret = dev_open(vf_netdev);
if (ret)
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 3/9] hv_netvsc: fix error unwind handling if vmbus_open fails

2018-03-02 Thread Stephen Hemminger
Need to delete NAPI association if vmbus_open fails.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 686900d61374..ff97a85b2e9d 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1286,7 +1286,6 @@ struct netvsc_device *netvsc_device_add(struct hv_device 
*device,
 netvsc_channel_cb, net_device->chan_table);
 
if (ret != 0) {
-   netif_napi_del(_device->chan_table[0].napi);
netdev_err(ndev, "unable to open channel: %d\n", ret);
goto cleanup;
}
@@ -1319,6 +1318,7 @@ struct netvsc_device *netvsc_device_add(struct hv_device 
*device,
vmbus_close(device->channel);
 
 cleanup:
+   netif_napi_del(_device->chan_table[0].napi);
free_netvsc_device(_device->rcu);
 
return ERR_PTR(ret);
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 8/9] hv_netvsc: filter multicast/broadcast

2018-03-02 Thread Stephen Hemminger
The netvsc driver was always enabling all multicast and broadcast
even if netdevice flag had not enabled it.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/rndis_filter.c | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index 1cba767c6453..8927c483c217 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -854,15 +854,19 @@ static void rndis_set_multicast(struct work_struct *w)
 {
struct rndis_device *rdev
= container_of(w, struct rndis_device, mcast_work);
+   u32 filter = NDIS_PACKET_TYPE_DIRECTED;
+   unsigned int flags = rdev->ndev->flags;
 
-   if (rdev->ndev->flags & IFF_PROMISC)
-   rndis_filter_set_packet_filter(rdev,
-  NDIS_PACKET_TYPE_PROMISCUOUS);
-   else
-   rndis_filter_set_packet_filter(rdev,
-  NDIS_PACKET_TYPE_BROADCAST |
-  NDIS_PACKET_TYPE_ALL_MULTICAST |
-  NDIS_PACKET_TYPE_DIRECTED);
+   if (flags & IFF_PROMISC) {
+   filter = NDIS_PACKET_TYPE_PROMISCUOUS;
+   } else {
+   if (flags & IFF_ALLMULTI)
+   flags |= NDIS_PACKET_TYPE_ALL_MULTICAST;
+   if (flags & IFF_BROADCAST)
+   flags |= NDIS_PACKET_TYPE_BROADCAST;
+   }
+
+   rndis_filter_set_packet_filter(rdev, filter);
 }
 
 void rndis_filter_update(struct netvsc_device *nvdev)
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 4/9] hv_netvsc: cancel subchannel setup before halting device

2018-03-02 Thread Stephen Hemminger
Block setup of multiple channels earlier in the teardown
process. This avoids possible races between halt and subchannel
initialization.

Suggested-by: Haiyang Zhang 
Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/rndis_filter.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index c3ca191fea7f..1cba767c6453 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -1340,6 +1340,9 @@ void rndis_filter_device_remove(struct hv_device *dev,
 {
struct rndis_device *rndis_dev = net_dev->extension;
 
+   /* Don't try and setup sub channels if about to halt */
+   cancel_work_sync(_dev->subchan_work);
+
/* Halt and release the rndis device */
rndis_filter_halt_device(rndis_dev);
 
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 2/9] hv_netvsc: only wake transmit queue if link is up

2018-03-02 Thread Stephen Hemminger
Don't wake transmit queues if link is not up yet.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc_drv.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index c5584c2d440e..fa6cf18e7719 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -91,12 +91,11 @@ static int netvsc_open(struct net_device *net)
return ret;
}
 
-   netif_tx_wake_all_queues(net);
-
rdev = nvdev->extension;
-
-   if (!rdev->link_state)
+   if (!rdev->link_state) {
netif_carrier_on(net);
+   netif_tx_wake_all_queues(net);
+   }
 
if (vf_netdev) {
/* Setting synthetic device up transparently sets
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 0/9] hv_netvsc: minor fixes

2018-03-02 Thread Stephen Hemminger
These are improvements to netvsc driver. They aren't functionality
changes so not targeting net-next; and they are not show stopper
bugs that need to go to stable either.

v2
   - drop the irq flags patch, defer it to net-next
   - split the multicast filter flag patch out
   - change propogate rx mode patch to handle startup of vf

Stephen Hemminger (9):
  hv_netvsc: avoid retry on send during shutdown
  hv_netvsc: only wake transmit queue if link is up
  hv_netvsc: fix error unwind handling if vmbus_open fails
  hv_netvsc: cancel subchannel setup before halting device
  hv_netvsc: fix race in napi poll when rescheduling
  hv_netvsc: use napi_schedule_irqoff
  hv_netvsc: defer queue selection to VF
  hv_netvsc: filter multicast/broadcast
  hv_netvsc: propagate rx filters to VF

 drivers/net/hyperv/netvsc.c   | 33 -
 drivers/net/hyperv/netvsc_drv.c   | 62 ---
 drivers/net/hyperv/rndis_filter.c | 23 ++-
 3 files changed, 79 insertions(+), 39 deletions(-)

-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 5/9] hv_netvsc: fix race in napi poll when rescheduling

2018-03-02 Thread Stephen Hemminger
There is a race between napi_reschedule and re-enabling interrupts
which could lead to missed host interrrupts.  This occurs when
interrupts are re-enabled (hv_end_read) and vmbus irq callback
(netvsc_channel_cb) has already scheduled NAPI.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index ff97a85b2e9d..4237cedc4f08 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1207,9 +1207,10 @@ int netvsc_poll(struct napi_struct *napi, int budget)
if (send_recv_completions(ndev, net_device, nvchan) == 0 &&
work_done < budget &&
napi_complete_done(napi, work_done) &&
-   hv_end_read(>inbound)) {
+   hv_end_read(>inbound) &&
+   napi_schedule_prep(napi)) {
hv_begin_read(>inbound);
-   napi_reschedule(napi);
+   __napi_schedule(napi);
}
 
/* Driver may overshoot since multiple packets per descriptor */
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 6/9] hv_netvsc: use napi_schedule_irqoff

2018-03-02 Thread Stephen Hemminger
Since the netvsc_channel_cb is already called in interrupt
context from vmbus, there is no need to do irqsave/restore.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 4237cedc4f08..0265d703eb03 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1233,7 +1233,7 @@ void netvsc_channel_cb(void *context)
/* disable interupts from host */
hv_begin_read(rbi);
 
-   __napi_schedule(>napi);
+   __napi_schedule_irqoff(>napi);
}
 }
 
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 7/9] hv_netvsc: defer queue selection to VF

2018-03-02 Thread Stephen Hemminger
When VF is used for accelerated networking it will likely have
more queues (and different policy) than the synthetic NIC.
This patch defers the queue policy to the VF so that all the
queues can be used. This impacts workloads like local generate UDP.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc_drv.c | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index fa6cf18e7719..5299cfb16ce2 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -298,8 +298,19 @@ static u16 netvsc_select_queue(struct net_device *ndev, 
struct sk_buff *skb,
rcu_read_lock();
vf_netdev = rcu_dereference(ndc->vf_netdev);
if (vf_netdev) {
-   txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0;
-   qdisc_skb_cb(skb)->slave_dev_queue_mapping = skb->queue_mapping;
+   const struct net_device_ops *vf_ops = vf_netdev->netdev_ops;
+
+   if (vf_ops->ndo_select_queue)
+   txq = vf_ops->ndo_select_queue(vf_netdev, skb,
+  accel_priv, fallback);
+   else
+   txq = fallback(vf_netdev, skb);
+
+   /* Record the queue selected by VF so that it can be
+* used for common case where VF has more queues than
+* the synthetic device.
+*/
+   qdisc_skb_cb(skb)->slave_dev_queue_mapping = txq;
} else {
txq = netvsc_pick_tx(ndev, skb);
}
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH PATCH net v2 1/9] hv_netvsc: avoid retry on send during shutdown

2018-03-02 Thread Stephen Hemminger
Change the initialization order so that the device is ready to transmit
(ie connect vsp is completed) before setting the internal reference
to the device with RCU.

This avoids any races on initialization and prevents retry issues
on shutdown.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 24 +++-
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 17e529af79dc..686900d61374 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -852,13 +852,6 @@ int netvsc_send(struct net_device *ndev,
if (unlikely(!net_device || net_device->destroy))
return -ENODEV;
 
-   /* We may race with netvsc_connect_vsp()/netvsc_init_buf() and get
-* here before the negotiation with the host is finished and
-* send_section_map may not be allocated yet.
-*/
-   if (unlikely(!net_device->send_section_map))
-   return -EAGAIN;
-
nvchan = _device->chan_table[packet->q_idx];
packet->send_buf_index = NETVSC_INVALID_INDEX;
packet->cp_partial = false;
@@ -866,10 +859,8 @@ int netvsc_send(struct net_device *ndev,
/* Send control message directly without accessing msd (Multi-Send
 * Data) field which may be changed during data packet processing.
 */
-   if (!skb) {
-   cur_send = packet;
-   goto send_now;
-   }
+   if (!skb)
+   return netvsc_send_pkt(device, packet, net_device, pb, skb);
 
/* batch packets in send buffer if possible */
msdp = >msd;
@@ -953,7 +944,6 @@ int netvsc_send(struct net_device *ndev,
}
}
 
-send_now:
if (cur_send)
ret = netvsc_send_pkt(device, cur_send, net_device, pb, skb);
 
@@ -1306,11 +1296,6 @@ struct netvsc_device *netvsc_device_add(struct hv_device 
*device,
 
napi_enable(_device->chan_table[0].napi);
 
-   /* Writing nvdev pointer unlocks netvsc_send(), make sure chn_table is
-* populated.
-*/
-   rcu_assign_pointer(net_device_ctx->nvdev, net_device);
-
/* Connect with the NetVsp */
ret = netvsc_connect_vsp(device, net_device, device_info);
if (ret != 0) {
@@ -1319,6 +1304,11 @@ struct netvsc_device *netvsc_device_add(struct hv_device 
*device,
goto close;
}
 
+   /* Writing nvdev pointer unlocks netvsc_send(), make sure chn_table is
+* populated.
+*/
+   rcu_assign_pointer(net_device_ctx->nvdev, net_device);
+
return net_device;
 
 close:
-- 
2.16.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 02/10] include: Move compat_timespec/ timeval to compat_time.h

2018-03-02 Thread James Hogan
On Mon, Jan 15, 2018 at 06:18:10PM -0800, Deepa Dinamani wrote:
> All the current architecture specific defines for these
> are the same. Refactor these common defines to a common
> header file.
> 
> The new common linux/compat_time.h is also useful as it
> will eventually be used to hold all the defines that
> are needed for compat time types that support non y2038
> safe types. New architectures need not have to define these
> new types as they will only use new y2038 safe syscalls.
> This file can be deleted after y2038 when we stop supporting
> non y2038 safe syscalls.

...

>  arch/mips/include/asm/compat.h| 11 ---
>  arch/mips/kernel/signal32.c   |  2 +-

For MIPS:
Acked-by: James Hogan 

Cheers
James


signature.asc
Description: Digital signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] staging: rtl8712: Remove multiple blank line(s)

2018-03-02 Thread Arushi Singhal
From: Arushi Singhal 

Remove extra blank line(s) that were causing checkpatch issues.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/os_intfs.c | 1 -
 drivers/staging/rtl8712/rtl8712_bitdef.h   | 1 -
 drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h   | 2 --
 drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h | 1 -
 drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h | 2 --
 drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h  | 1 -
 drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h  | 2 --
 drivers/staging/rtl8712/rtl8712_gp_regdef.h| 1 -
 drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h | 1 -
 9 files changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index d6d27da..ff4e451 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -347,7 +347,6 @@ u8 r8712_free_drv_sw(struct _adapter *padapter)
return _SUCCESS;
 }
 
-
 static void enable_video_mode(struct _adapter *padapter, int cbw40_value)
 {
/*   bit 8:
diff --git a/drivers/staging/rtl8712/rtl8712_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_bitdef.h
index bff57a8..dee35fe 100644
--- a/drivers/staging/rtl8712/rtl8712_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_bitdef.h
@@ -18,7 +18,6 @@
  *
  
**/
 
-
 #ifndef __RTL8712_BITDEF_H__
 #define __RTL8712_BITDEF_H__
 
diff --git a/drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h 
b/drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h
index 9374f1c..8df42a7 100644
--- a/drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h
+++ b/drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h
@@ -20,7 +20,6 @@
 #ifndef __RTL8712_CMDCTRL_REGDEF_H__
 #define __RTL8712_CMDCTRL_REGDEF_H__
 
-
 #define CR (RTL8712_CMDCTRL_ + 0x)
 #define TXPAUSE(RTL8712_CMDCTRL_ + 0x0002)
 #define TCR(RTL8712_CMDCTRL_ + 0x0004)
@@ -29,6 +28,5 @@
 #define SYSF_CFG   (RTL8712_CMDCTRL_ + 0x000D)
 #define MBIDCTRL   (RTL8712_CMDCTRL_ + 0x000E)
 
-
 #endif /* __RTL8712_CMDCTRL_REGDEF_H__ */
 
diff --git a/drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h
index 8bd4837..4b34367 100644
--- a/drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h
@@ -51,5 +51,4 @@
 /*FDLOCKFLAG1*/
 #define_LOCKFLAG1_MSK  0x03
 
-
 #endif /* __RTL8712_DEBUGCTRL_BITDEF_H__ */
diff --git a/drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h 
b/drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h
index 43630bb..d7c964d 100644
--- a/drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h
+++ b/drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h
@@ -41,7 +41,5 @@
 #define TRXPKTBUF_DBG_CTRL (RTL8712_DEBUGCTRL_ + 0x38)
 #define DPLL_MON   (RTL8712_DEBUGCTRL_ + 0x3A)
 
-
-
 #endif /* __RTL8712_DEBUGCTRL_REGDEF_H__ */
 
diff --git a/drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h
index c564dc8..bd82404 100644
--- a/drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h
@@ -140,6 +140,5 @@
 /*TXFF_PG_NUM*/
 #define_TXFF_PG_NUM_MSK0x0FFF
 
-
 #endif /*  __RTL8712_FIFOCTRL_BITDEF_H__ */
 
diff --git a/drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h 
b/drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h
index 29b89c4..6d52738 100644
--- a/drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h
+++ b/drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h
@@ -71,6 +71,4 @@
 #define TXQ_PGADD  (RTL8712_FIFOCTRL_ + 0xB3)
 #define TXFF_PG_NUM(RTL8712_FIFOCTRL_ + 0xB4)
 
-
-
 #endif /* __RTL8712_FIFOCTRL_REGDEF_H__ */
diff --git a/drivers/staging/rtl8712/rtl8712_gp_regdef.h 
b/drivers/staging/rtl8712/rtl8712_gp_regdef.h
index 8fc68f6..a037936 100644
--- a/drivers/staging/rtl8712/rtl8712_gp_regdef.h
+++ b/drivers/staging/rtl8712/rtl8712_gp_regdef.h
@@ -37,6 +37,5 @@
 #define PHY_REG_RPT(RTL8712_GP_ + 0x13)
 #define PHY_REG_DATA   (RTL8712_GP_ + 0x14)
 
-
 #endif /*__RTL8712_GP_REGDEF_H__ */
 
diff --git a/drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h
index 49598c3..2a561d2 100644
--- a/drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h
@@ -53,6 +53,5 @@
 #define_VODOK  BIT(1)
 #define_RXOK   BIT(0)
 
-
 #endif /*__RTL8712_INTERRUPT_BITDEF_H__*/
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] staging: rtl8712: remove unnecessary parentheses

2018-03-02 Thread Arushi Singhal
Remove unnecessary parentheses around variables to conform to the Linux
kernel coding style. Issue found using checkpatch.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/recv_linux.c  |  4 +-
 drivers/staging/rtl8712/rtl8712_cmd.c |  8 ++--
 drivers/staging/rtl8712/rtl8712_led.c | 70 +--
 3 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/rtl8712/recv_linux.c 
b/drivers/staging/rtl8712/recv_linux.c
index 986a55b..8cf4286 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -111,8 +111,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
_pkt *skb;
struct rx_pkt_attrib *pattrib = _frame->u.hdr.attrib;
 
-   precvpriv = &(padapter->recvpriv);
-   pfree_recv_queue = &(precvpriv->free_recv_queue);
+   precvpriv = >recvpriv;
+   pfree_recv_queue = >free_recv_queue;
skb = precv_frame->u.hdr.pkt;
if (!skb)
goto _recv_indicatepkt_drop;
diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c 
b/drivers/staging/rtl8712/rtl8712_cmd.c
index 9c8e0c5..b1dfe9f 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.c
+++ b/drivers/staging/rtl8712/rtl8712_cmd.c
@@ -320,7 +320,7 @@ int r8712_cmd_thread(void *context)
struct tx_desc *pdesc;
void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
struct _adapter *padapter = context;
-   struct  cmd_priv*pcmdpriv = &(padapter->cmdpriv);
+   struct  cmd_priv *pcmdpriv = >cmdpriv;
struct completion *cmd_queue_comp =
>cmd_queue_comp;
struct mutex *pwctrl_lock = >pwrctrlpriv.mutex_lock;
@@ -334,7 +334,7 @@ int r8712_cmd_thread(void *context)
if (r8712_register_cmd_alive(padapter) != _SUCCESS)
continue;
 _next:
-   pcmd = r8712_dequeue_cmd(&(pcmdpriv->cmd_queue));
+   pcmd = r8712_dequeue_cmd(>cmd_queue);
if (!(pcmd)) {
r8712_unregister_cmd_alive(padapter);
continue;
@@ -419,7 +419,7 @@ int r8712_cmd_thread(void *context)
}
/* free all cmd_obj resources */
do {
-   pcmd = r8712_dequeue_cmd(&(pcmdpriv->cmd_queue));
+   pcmd = r8712_dequeue_cmd(>cmd_queue);
if (!pcmd)
break;
r8712_free_cmd_obj(pcmd);
@@ -433,7 +433,7 @@ void r8712_event_handle(struct _adapter *padapter, __le32 
*peventbuf)
u8 evt_code, evt_seq;
u16 evt_sz;
void (*event_callback)(struct _adapter *dev, u8 *pbuf);
-   struct  evt_priv *pevt_priv = &(padapter->evtpriv);
+   struct  evt_priv *pevt_priv = >evtpriv;
 
if (!peventbuf)
goto _abort_event_;
diff --git a/drivers/staging/rtl8712/rtl8712_led.c 
b/drivers/staging/rtl8712/rtl8712_led.c
index 455fba7..e907734 100644
--- a/drivers/staging/rtl8712/rtl8712_led.c
+++ b/drivers/staging/rtl8712/rtl8712_led.c
@@ -181,11 +181,11 @@ static void SwLedOff(struct _adapter *padapter, struct 
LED_871x *pLed)
  */
 void r8712_InitSwLeds(struct _adapter *padapter)
 {
-   struct led_priv *pledpriv = &(padapter->ledpriv);
+   struct led_priv *pledpriv = >ledpriv;
 
pledpriv->LedControlHandler = LedControl871x;
-   InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);
-   InitLed871x(padapter, &(pledpriv->SwLed1), LED_PIN_LED1);
+   InitLed871x(padapter, >SwLed0, LED_PIN_LED0);
+   InitLed871x(padapter, >SwLed1, LED_PIN_LED1);
 }
 
 /* Description:
@@ -193,10 +193,10 @@ void r8712_InitSwLeds(struct _adapter *padapter)
  */
 void r8712_DeInitSwLeds(struct _adapter *padapter)
 {
-   struct led_priv *ledpriv = &(padapter->ledpriv);
+   struct led_priv *ledpriv = >ledpriv;
 
-   DeInitLed871x(&(ledpriv->SwLed0));
-   DeInitLed871x(&(ledpriv->SwLed1));
+   DeInitLed871x(>SwLed0);
+   DeInitLed871x(>SwLed1);
 }
 
 /* Description:
@@ -206,7 +206,7 @@ void r8712_DeInitSwLeds(struct _adapter *padapter)
 static void SwLedBlink(struct LED_871x *pLed)
 {
struct _adapter *padapter = pLed->padapter;
-   struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
+   struct mlme_priv *pmlmepriv = >mlmepriv;
u8 bStopBlinking = false;
 
/* Change LED according to BlinkingLedState specified. */
@@ -281,14 +281,14 @@ static void SwLedBlink(struct LED_871x *pLed)
 static void SwLedBlink1(struct LED_871x *pLed)
 {
struct _adapter *padapter = pLed->padapter;
-   struct led_priv *ledpriv = &(padapter->ledpriv);
-   struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-   struct eeprom_priv *peeprompriv = &(padapter->eeprompriv);
-   struct LED_871x *pLed1 = &(ledpriv->SwLed1);
+   struct led_priv *ledpriv = >ledpriv;
+   struct mlme_priv *pmlmepriv = >mlmepriv;
+   struct eeprom_priv *peeprompriv = 

[PATCH 0/4] staging: rtl8712: fix coding style issues

2018-03-02 Thread Arushi Singhal
Fix issues found with checkpatch.pl for rtl8712 driver.

Arushi Singhal (4):
  staging: rtl8712: Remove multiple blank line(s)
  staging: rtl8712: Added spaces around '+'.
  staging: rtl8712: Add spaces around '|'
  staging: rtl8712: remove unnecessary parentheses

 drivers/staging/rtl8712/os_intfs.c |  1 -
 drivers/staging/rtl8712/recv_linux.c   |  4 +-
 drivers/staging/rtl8712/rtl8712_bitdef.h   |  1 -
 drivers/staging/rtl8712/rtl8712_cmd.c  |  8 +--
 drivers/staging/rtl8712/rtl8712_cmd.h  |  4 +-
 drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h   |  2 +-
 drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h   |  2 -
 drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h |  1 -
 drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h |  2 -
 drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h  |  1 -
 drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h  |  2 -
 drivers/staging/rtl8712/rtl8712_gp_bitdef.h|  2 +-
 drivers/staging/rtl8712/rtl8712_gp_regdef.h|  1 -
 drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h |  1 -
 drivers/staging/rtl8712/rtl8712_led.c  | 70 +++---
 15 files changed, 45 insertions(+), 57 deletions(-)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] staging: rtl8712: Added spaces around '+'.

2018-03-02 Thread Arushi Singhal
From: Arushi Singhal 

Add spaces around arithmetic operator '+', to fix the checkpatch
issue.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/rtl8712_cmd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_cmd.h 
b/drivers/staging/rtl8712/rtl8712_cmd.h
index 67e9e91..9181bb6 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.h
+++ b/drivers/staging/rtl8712/rtl8712_cmd.h
@@ -145,8 +145,8 @@ enum rtl8712_h2c_cmd {
 #define _SetBBReg_CMD_ _Write_BBREG_CMD_
 #define _GetRFReg_CMD_ _Read_RFREG_CMD_
 #define _SetRFReg_CMD_ _Write_RFREG_CMD_
-#define _DRV_INT_CMD_  (MAX_H2CCMD+1)
-#define _SetRFIntFs_CMD_   (MAX_H2CCMD+2)
+#define _DRV_INT_CMD_  (MAX_H2CCMD + 1)
+#define _SetRFIntFs_CMD_   (MAX_H2CCMD + 2)
 
 #ifdef _RTL8712_CMD_C_
 static struct _cmd_callbackcmd_callback[] = {
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] staging: rtl8712: Add spaces around '|'

2018-03-02 Thread Arushi Singhal
From: Arushi Singhal 

Add spaces around '|' to fix the checkpatch issue.
CHECK: spaces preferred around that '|'.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h | 2 +-
 drivers/staging/rtl8712/rtl8712_gp_bitdef.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h
index b7dda90..4b8985d 100644
--- a/drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h
@@ -63,7 +63,7 @@
 #define _IMEM_CHK_RPT  BIT(1)
 #define _IMEM_CODE_DONEBIT(0)
 
-#define_TXDMA_INIT_VALUE   (_IMEM_CHK_RPT|_EMEM_CHK_RPT)
+#define_TXDMA_INIT_VALUE   (_IMEM_CHK_RPT | _EMEM_CHK_RPT)
 
 /*RCR*/
 #define_ENMBID BIT(27)
diff --git a/drivers/staging/rtl8712/rtl8712_gp_bitdef.h 
b/drivers/staging/rtl8712/rtl8712_gp_bitdef.h
index 44c9060..66c35c9 100644
--- a/drivers/staging/rtl8712/rtl8712_gp_bitdef.h
+++ b/drivers/staging/rtl8712/rtl8712_gp_bitdef.h
@@ -70,7 +70,7 @@
 #defineGPIOSEL_PHYDBG  1   /* PHYDBG*/
 #defineGPIOSEL_BT  2   /* BT_coex*/
 #defineGPIOSEL_WLANDBG 3   /* WLANDBG*/
-#defineGPIOSEL_GPIO_MASK   (~(BIT(0)|BIT(1)))
+#defineGPIOSEL_GPIO_MASK   (~(BIT(0) | BIT(1)))
 /* HW Radio OFF switch (GPIO BIT) */
 #defineHAL_8192S_HW_GPIO_OFF_BIT   BIT(3)
 #defineHAL_8192S_HW_GPIO_OFF_MASK  0xF7
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH] staging: rtl8712: match alignment with open parenthesis

2018-03-02 Thread Julia Lawall


On Fri, 2 Mar 2018, Arushi Singhal wrote:

> This patch fixes the checks reported by checkpatch.pl for alignment
> should match open parenthesis.
>
> Signed-off-by: Arushi Singhal 

Your Signed-off-by email address should be the same as the one in the From
line.  You have arushisinghal19971...@gmail.com.

The commit log should be in the imperative and should explain what you did
and not just what you fixed.  Try to start the commit log message with
"Add".

The change looks fine.

julia

> ---
>  drivers/staging/rtl8712/mlme_linux.c | 2 +-
>  drivers/staging/rtl8712/os_intfs.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/mlme_linux.c 
> b/drivers/staging/rtl8712/mlme_linux.c
> index 3c7c4a4..baaa52f 100644
> --- a/drivers/staging/rtl8712/mlme_linux.c
> +++ b/drivers/staging/rtl8712/mlme_linux.c
> @@ -36,7 +36,7 @@ static void sitesurvey_ctrl_handler(struct timer_list *t)
>  {
>   struct _adapter *adapter =
>   from_timer(adapter, t,
> - mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer);
> +mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer);
>
>   _r8712_sitesurvey_ctrl_handler(adapter);
>   mod_timer(>mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
> diff --git a/drivers/staging/rtl8712/os_intfs.c 
> b/drivers/staging/rtl8712/os_intfs.c
> index e7df5d7..d6d27da 100644
> --- a/drivers/staging/rtl8712/os_intfs.c
> +++ b/drivers/staging/rtl8712/os_intfs.c
> @@ -230,7 +230,7 @@ struct net_device *r8712_init_netdev(void)
>  static u32 start_drv_threads(struct _adapter *padapter)
>  {
>   padapter->cmdThread = kthread_run(r8712_cmd_thread, padapter, "%s",
> -   padapter->pnetdev->name);
> +   padapter->pnetdev->name);
>   if (IS_ERR(padapter->cmdThread))
>   return _FAIL;
>   return _SUCCESS;
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/20180302173619.GA8598%40seema-Inspiron-15-3567.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8712: match alignment with open parenthesis

2018-03-02 Thread Arushi Singhal
This patch fixes the checks reported by checkpatch.pl for alignment
should match open parenthesis.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/mlme_linux.c | 2 +-
 drivers/staging/rtl8712/os_intfs.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/mlme_linux.c 
b/drivers/staging/rtl8712/mlme_linux.c
index 3c7c4a4..baaa52f 100644
--- a/drivers/staging/rtl8712/mlme_linux.c
+++ b/drivers/staging/rtl8712/mlme_linux.c
@@ -36,7 +36,7 @@ static void sitesurvey_ctrl_handler(struct timer_list *t)
 {
struct _adapter *adapter =
from_timer(adapter, t,
-   mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer);
+  mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer);
 
_r8712_sitesurvey_ctrl_handler(adapter);
mod_timer(>mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index e7df5d7..d6d27da 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -230,7 +230,7 @@ struct net_device *r8712_init_netdev(void)
 static u32 start_drv_threads(struct _adapter *padapter)
 {
padapter->cmdThread = kthread_run(r8712_cmd_thread, padapter, "%s",
- padapter->pnetdev->name);
+ padapter->pnetdev->name);
if (IS_ERR(padapter->cmdThread))
return _FAIL;
return _SUCCESS;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 4/4] staging: fsl-dpaa2/eth: allow the driver to compile multi-arch

2018-03-02 Thread Ruxandra Ioana Ciocoi Radulescu
-Original Message-
From: Greg KH [mailto:gre...@linuxfoundation.org] 
Sent: Thursday, March 1, 2018 6:32 PM
To: Ruxandra Ioana Ciocoi Radulescu 
Cc: de...@driverdev.osuosl.org; Roy Pledge ; Bogdan 
Purcareata ; linux-ker...@vger.kernel.org; Laurentiu 
Tudor 
Subject: Re: [PATCH 4/4] staging: fsl-dpaa2/eth: allow the driver to compile 
multi-arch

On Mon, Feb 26, 2018 at 10:28:07AM -0600, Ioana Radulescu wrote:
> Drop dependency on ARCH_LAYERSCAPE (which in turn depends on ARM64), 
> thus allowing this driver to compile on all architectures supported by 
> the fsl-mc bus driver.
> 
> This was compile tested on:
>  - powerpc (corenet_basic_defconfig, ppc64_defconfig)
>  - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF)
>  - arm64 (defconfig)

Seems you need to compile it on more things, based on the kbuild warnings :(

Yes I do, sorry for the slip :(

I've added allmodconfig and the sparse endianness flag to my list of tests.
Will send a v2 early next week.

Thanks,
Ioana
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/13] staging: wilc1000: rename u16DummyReasonCode to avoid camelCase

2018-03-02 Thread Ajay Singh
Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 2354666..a4ee175 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1795,11 +1795,11 @@ static void handle_disconnect(struct wilc_vif *vif)
struct host_if_drv *hif_drv = vif->hif_drv;
 
s32 result = 0;
-   u16 u16DummyReasonCode = 0;
+   u16 dummy_reason_code = 0;
 
wid.id = (u16)WID_DISCONNECT;
wid.type = WID_CHAR;
-   wid.val = (s8 *)
+   wid.val = (s8 *)_reason_code;
wid.size = sizeof(char);
 
wilc_optaining_ip = false;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/13] staging: wilc1000: fix line over 80 char in handle_rcvd_ntwrk_info()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 character' issues found by checkpatch.pl script by
use of temporary variable and avoided leading tab.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 66 +++
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 19c7483..2354666 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1267,51 +1267,51 @@ static s32 handle_rcvd_ntwrk_info(struct wilc_vif *vif,
struct network_info *info = NULL;
void *params = NULL;
struct host_if_drv *hif_drv = vif->hif_drv;
+   struct user_scan_req *scan_req = _drv->usr_scan_req;
 
found = true;
 
-   if (hif_drv->usr_scan_req.scan_result) {
-   wilc_parse_network_info(rcvd_info->buffer, );
-   if (!info || !hif_drv->usr_scan_req.scan_result) {
-   netdev_err(vif->ndev, "driver is null\n");
-   result = -EINVAL;
-   goto done;
-   }
+   if (!scan_req->scan_result)
+   goto done;
 
-   for (i = 0; i < hif_drv->usr_scan_req.rcvd_ch_cnt; i++) {
-   if (memcmp(hif_drv->usr_scan_req.net_info[i].bssid,
-  info->bssid, 6) == 0) {
-   if (info->rssi <= 
hif_drv->usr_scan_req.net_info[i].rssi) {
-   goto done;
-   } else {
-   hif_drv->usr_scan_req.net_info[i].rssi 
= info->rssi;
-   found = false;
-   break;
-   }
+   wilc_parse_network_info(rcvd_info->buffer, );
+   if (!info || !scan_req->scan_result) {
+   netdev_err(vif->ndev, "driver is null\n");
+   result = -EINVAL;
+   goto done;
+   }
+
+   for (i = 0; i < scan_req->rcvd_ch_cnt; i++) {
+   if (memcmp(scan_req->net_info[i].bssid, info->bssid, 6) == 0) {
+   if (info->rssi <= scan_req->net_info[i].rssi) {
+   goto done;
+   } else {
+   scan_req->net_info[i].rssi = info->rssi;
+   found = false;
+   break;
}
}
+   }
 
-   if (found) {
-   if (hif_drv->usr_scan_req.rcvd_ch_cnt < 
MAX_NUM_SCANNED_NETWORKS) {
-   
hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].rssi = 
info->rssi;
+   if (found) {
+   if (scan_req->rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) {
+   scan_req->net_info[scan_req->rcvd_ch_cnt].rssi = 
info->rssi;
 
-   
memcpy(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid,
-  info->bssid, 6);
+   memcpy(scan_req->net_info[scan_req->rcvd_ch_cnt].bssid,
+  info->bssid, 6);
 
-   hif_drv->usr_scan_req.rcvd_ch_cnt++;
+   scan_req->rcvd_ch_cnt++;
 
-   info->new_network = true;
-   params = host_int_parse_join_bss_param(info);
+   info->new_network = true;
+   params = host_int_parse_join_bss_param(info);
 
-   
hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, info,
- 
hif_drv->usr_scan_req.arg,
- params);
-   }
-   } else {
-   info->new_network = false;
-   
hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, info,
- 
hif_drv->usr_scan_req.arg, NULL);
+   scan_req->scan_result(SCAN_EVENT_NETWORK_FOUND, info,
+  scan_req->arg, params);
}
+   } else {
+   info->new_network = false;
+   scan_req->scan_result(SCAN_EVENT_NETWORK_FOUND, info,
+ scan_req->arg, NULL);
}
 
 done:
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/13] staging: wilc1000: fix line over 80 char in wilc_scan_complete_received()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 character' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index e071eaf..ce04622 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3569,7 +3569,10 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 
*buffer, u32 length)
struct host_if_drv *hif_drv = NULL;
struct wilc_vif *vif;
 
-   id = ((buffer[length - 4]) | (buffer[length - 3] << 8) | (buffer[length 
- 2] << 16) | (buffer[length - 1] << 24));
+   id = buffer[length - 4];
+   id |= buffer[length - 3] << 8;
+   id |= buffer[length - 2] << 16;
+   id |= buffer[length - 1] << 24;
vif = wilc_get_vif_from_idx(wilc, id);
if (!vif)
return;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/13] staging: wilc1000: rename handle_connect_timeout() variables to avoid camelCase

2018-03-02 Thread Ajay Singh
Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index ce04622..19c7483 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1182,9 +1182,9 @@ static s32 handle_connect(struct wilc_vif *vif,
 static s32 handle_connect_timeout(struct wilc_vif *vif)
 {
s32 result = 0;
-   struct connect_info strConnectInfo;
+   struct connect_info info;
struct wid wid;
-   u16 u16DummyReasonCode = 0;
+   u16 dummy_reason_code = 0;
struct host_if_drv *hif_drv = vif->hif_drv;
 
if (!hif_drv) {
@@ -1196,37 +1196,37 @@ static s32 handle_connect_timeout(struct wilc_vif *vif)
 
scan_while_connected = false;
 
-   memset(, 0, sizeof(struct connect_info));
+   memset(, 0, sizeof(struct connect_info));
 
if (hif_drv->usr_conn_req.conn_result) {
if (hif_drv->usr_conn_req.bssid) {
-   memcpy(strConnectInfo.bssid,
+   memcpy(info.bssid,
   hif_drv->usr_conn_req.bssid, 6);
}
 
if (hif_drv->usr_conn_req.ies) {
-   strConnectInfo.req_ies_len = 
hif_drv->usr_conn_req.ies_len;
-   strConnectInfo.req_ies = 
kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
-   memcpy(strConnectInfo.req_ies,
+   info.req_ies_len = hif_drv->usr_conn_req.ies_len;
+   info.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, 
GFP_KERNEL);
+   memcpy(info.req_ies,
   hif_drv->usr_conn_req.ies,
   hif_drv->usr_conn_req.ies_len);
}
 
hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
- ,
+ ,
  MAC_DISCONNECTED,
  NULL,
  hif_drv->usr_conn_req.arg);
 
-   kfree(strConnectInfo.req_ies);
-   strConnectInfo.req_ies = NULL;
+   kfree(info.req_ies);
+   info.req_ies = NULL;
} else {
netdev_err(vif->ndev, "Connect callback is NULL\n");
}
 
wid.id = (u16)WID_DISCONNECT;
wid.type = WID_CHAR;
-   wid.val = (s8 *)
+   wid.val = (s8 *)_reason_code;
wid.size = sizeof(char);
 
result = wilc_send_config_pkt(vif, SET_CFG, , 1,
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/13] staging: wilc1000: rename pstrHostIFkeyAttr to avoid camelCase issue

2018-03-02 Thread Ajay Singh
Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 119 +++---
 1 file changed, 59 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index a7fa004..5ebb0aa 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1538,8 +1538,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif 
*vif,
return result;
 }
 
-static int handle_key(struct wilc_vif *vif,
- struct key_attr *pstrHostIFkeyAttr)
+static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 {
s32 result = 0;
struct wid wid;
@@ -1550,76 +1549,76 @@ static int handle_key(struct wilc_vif *vif,
s8 ret = 0;
struct host_if_drv *hif_drv = vif->hif_drv;
 
-   switch (pstrHostIFkeyAttr->type) {
+   switch (hif_key->type) {
case WEP:
 
-   if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
+   if (hif_key->action & ADDKEY_AP) {
wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char);
-   wid_list[0].val = (s8 
*)>attr.wep.mode;
+   wid_list[0].val = (s8 *)_key->attr.wep.mode;
 
wid_list[1].id = WID_AUTH_TYPE;
wid_list[1].type = WID_CHAR;
wid_list[1].size = sizeof(char);
-   wid_list[1].val = (s8 
*)>attr.wep.auth_type;
+   wid_list[1].val = (s8 *)_key->attr.wep.auth_type;
 
-   pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len 
+ 2,
+   pu8keybuf = kmalloc(hif_key->attr.wep.key_len + 2,
GFP_KERNEL);
if (!pu8keybuf)
return -ENOMEM;
 
-   pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
-   pu8keybuf[1] = pstrHostIFkeyAttr->attr.wep.key_len;
+   pu8keybuf[0] = hif_key->attr.wep.index;
+   pu8keybuf[1] = hif_key->attr.wep.key_len;
 
-   memcpy([2], pstrHostIFkeyAttr->attr.wep.key,
-  pstrHostIFkeyAttr->attr.wep.key_len);
+   memcpy([2], hif_key->attr.wep.key,
+  hif_key->attr.wep.key_len);
 
-   kfree(pstrHostIFkeyAttr->attr.wep.key);
+   kfree(hif_key->attr.wep.key);
 
wid_list[2].id = (u16)WID_WEP_KEY_VALUE;
wid_list[2].type = WID_STR;
-   wid_list[2].size = pstrHostIFkeyAttr->attr.wep.key_len 
+ 2;
+   wid_list[2].size = hif_key->attr.wep.key_len + 2;
wid_list[2].val = (s8 *)pu8keybuf;
 
result = wilc_send_config_pkt(vif, SET_CFG,
  wid_list, 3,
  wilc_get_vif_idx(vif));
kfree(pu8keybuf);
-   } else if (pstrHostIFkeyAttr->action & ADDKEY) {
-   pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len 
+ 2, GFP_KERNEL);
+   } else if (hif_key->action & ADDKEY) {
+   pu8keybuf = kmalloc(hif_key->attr.wep.key_len + 2, 
GFP_KERNEL);
if (!pu8keybuf)
return -ENOMEM;
-   pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
-   memcpy(pu8keybuf + 1, 
>attr.wep.key_len, 1);
-   memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->attr.wep.key,
-  pstrHostIFkeyAttr->attr.wep.key_len);
-   kfree(pstrHostIFkeyAttr->attr.wep.key);
+   pu8keybuf[0] = hif_key->attr.wep.index;
+   memcpy(pu8keybuf + 1, _key->attr.wep.key_len, 1);
+   memcpy(pu8keybuf + 2, hif_key->attr.wep.key,
+  hif_key->attr.wep.key_len);
+   kfree(hif_key->attr.wep.key);
 
wid.id = (u16)WID_ADD_WEP_KEY;
wid.type = WID_STR;
wid.val = (s8 *)pu8keybuf;
-   wid.size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
+   wid.size = hif_key->attr.wep.key_len + 2;
 
result = wilc_send_config_pkt(vif, SET_CFG,
  , 1,
  wilc_get_vif_idx(vif));
kfree(pu8keybuf);
-   } else if 

[PATCH 09/13] staging: wilc1000: fix line over 80 char in wilc_del_allstation() & wilc_deinit()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 57f90e4..e071eaf 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3444,7 +3444,8 @@ int wilc_deinit(struct wilc_vif *vif)
 
if (hif_drv->usr_scan_req.scan_result) {
hif_drv->usr_scan_req.scan_result(SCAN_EVENT_ABORTED, NULL,
- hif_drv->usr_scan_req.arg, 
NULL);
+ hif_drv->usr_scan_req.arg,
+ NULL);
hif_drv->usr_scan_req.scan_result = NULL;
}
 
@@ -3796,7 +3797,8 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 
mac_addr[][ETH_ALEN])
 
for (i = 0; i < MAX_NUM_STA; i++) {
if (memcmp(mac_addr[i], zero_addr, ETH_ALEN)) {
-   memcpy(del_all_sta_info->del_all_sta[i], mac_addr[i], 
ETH_ALEN);
+   memcpy(del_all_sta_info->del_all_sta[i], mac_addr[i],
+  ETH_ALEN);
assoc_sta++;
}
}
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/13] staging: wilc1000: fix line over 80 char in wilc_add_ptk()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 5ebb0aa..57f90e4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2858,10 +2858,12 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, 
u8 ptk_key_len,
return -ENOMEM;
 
if (rx_mic)
-   memcpy(msg.body.key_info.attr.wpa.key + 16, rx_mic, 
RX_MIC_KEY_LEN);
+   memcpy(msg.body.key_info.attr.wpa.key + 16, rx_mic,
+  RX_MIC_KEY_LEN);
 
if (tx_mic)
-   memcpy(msg.body.key_info.attr.wpa.key + 24, tx_mic, 
TX_MIC_KEY_LEN);
+   memcpy(msg.body.key_info.attr.wpa.key + 24, tx_mic,
+  TX_MIC_KEY_LEN);
 
msg.body.key_info.attr.wpa.key_len = key_len;
msg.body.key_info.attr.wpa.mac_addr = mac_addr;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/13] staging: wilc1000: fix camelcase, line over 80 char and few smatch warning

2018-03-02 Thread Ajay Singh
This patch series contains fixes for checkpatch.pl reported issue & 'always true
condition' smatch warning.


Ajay Singh (13):
  staging: wilc1000: rename enuEvent to avoid camelCase
  staging: wilc1000: remove always 'true' check from 'if' statement
  staging: wilc1000: fix line over 80 char in handle_cfg_param()
  staging: wilc1000: fix line over 80 char in
wilc_network_info_received()
  staging: wilc1000: fix line over 80 char for
wilc_gnrl_async_info_received()
  staging: wilc1000: fix line over 80 char in
host_int_parse_join_bss_param()
  staging: wilc1000: rename pstrHostIFkeyAttr to avoid camelCase issue
  staging: wilc1000: fix line over 80 char in wilc_add_ptk()
  staging: wilc1000: fix line over 80 char in wilc_del_allstation() &
wilc_deinit()
  staging: wilc1000: fix line over 80 char in
wilc_scan_complete_received()
  staging: wilc1000: rename handle_connect_timeout() variables to avoid
camelCase
  staging: wilc1000: fix line over 80 char in handle_rcvd_ntwrk_info()
  staging: wilc1000: rename u16DummyReasonCode to avoid camelCase

 drivers/staging/wilc1000/host_interface.c | 644 --
 1 file changed, 335 insertions(+), 309 deletions(-)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/13] staging: wilc1000: fix line over 80 char for wilc_gnrl_async_info_received()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 char' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index a44ddb2..a15c087 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3520,7 +3520,10 @@ void wilc_gnrl_async_info_received(struct wilc *wilc, u8 
*buffer, u32 length)
 
mutex_lock(_deinit_lock);
 
-   id = ((buffer[length - 4]) | (buffer[length - 3] << 8) | (buffer[length 
- 2] << 16) | (buffer[length - 1] << 24));
+   id = buffer[length - 4];
+   id |= (buffer[length - 3] << 8);
+   id |= (buffer[length - 2] << 16);
+   id |= (buffer[length - 1] << 24);
vif = wilc_get_vif_from_idx(wilc, id);
if (!vif) {
mutex_unlock(_deinit_lock);
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/13] staging: wilc1000: fix line over 80 char in host_int_parse_join_bss_param()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 216 +++---
 1 file changed, 108 insertions(+), 108 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index a15c087..a7fa004 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3904,129 +3904,129 @@ static void *host_int_parse_join_bss_param(struct 
network_info *info)
ies_len = info->ies_len;
 
param = kzalloc(sizeof(*param), GFP_KERNEL);
-   if (param) {
-   param->dtim_period = info->dtim_period;
-   param->beacon_period = info->beacon_period;
-   param->cap_info = info->cap_info;
-   memcpy(param->bssid, info->bssid, 6);
-   memcpy((u8 *)param->ssid, info->ssid,
-  info->ssid_len + 1);
-   param->ssid_len = info->ssid_len;
-   memset(param->rsn_pcip_policy, 0xFF, 3);
-   memset(param->rsn_auth_policy, 0xFF, 3);
-
-   while (index < ies_len) {
-   if (ies[index] == SUPP_RATES_IE) {
-   rates_no = ies[index + 1];
-   param->supp_rates[0] = rates_no;
-   index += 2;
-
-   for (i = 0; i < rates_no; i++)
-   param->supp_rates[i + 1] = ies[index + 
i];
-
-   index += rates_no;
-   } else if (ies[index] == EXT_SUPP_RATES_IE) {
-   ext_rates_no = ies[index + 1];
-   if (ext_rates_no > (MAX_RATES_SUPPORTED - 
rates_no))
-   param->supp_rates[0] = 
MAX_RATES_SUPPORTED;
-   else
-   param->supp_rates[0] += ext_rates_no;
-   index += 2;
-   for (i = 0; i < (param->supp_rates[0] - 
rates_no); i++)
-   param->supp_rates[rates_no + i + 1] = 
ies[index + i];
-
-   index += ext_rates_no;
-   } else if (ies[index] == HT_CAPABILITY_IE) {
-   param->ht_capable = true;
-   index += ies[index + 1] + 2;
-   } else if ((ies[index] == WMM_IE) &&
-  (ies[index + 2] == 0x00) && (ies[index + 3] 
== 0x50) &&
-  (ies[index + 4] == 0xF2) &&
-  (ies[index + 5] == 0x02) &&
-  ((ies[index + 6] == 0x00) || (ies[index + 6] 
== 0x01)) &&
-  (ies[index + 7] == 0x01)) {
-   param->wmm_cap = true;
-
-   if (ies[index + 8] & BIT(7))
-   param->uapsd_cap = true;
-   index += ies[index + 1] + 2;
-   } else if ((ies[index] == P2P_IE) &&
-(ies[index + 2] == 0x50) && (ies[index + 3] == 
0x6f) &&
-(ies[index + 4] == 0x9a) &&
-(ies[index + 5] == 0x09) && (ies[index + 6] == 
0x0c)) {
-   u16 p2p_cnt;
-
-   param->tsf = info->tsf_lo;
-   param->noa_enabled = 1;
-   param->idx = ies[index + 9];
-
-   if (ies[index + 10] & BIT(7)) {
-   param->opp_enabled = 1;
-   param->ct_window = ies[index + 10];
-   } else {
-   param->opp_enabled = 0;
-   }
+   if (!param)
+   return NULL;
 
-   param->cnt = ies[index + 11];
-   p2p_cnt = index + 12;
+   param->dtim_period = info->dtim_period;
+   param->beacon_period = info->beacon_period;
+   param->cap_info = info->cap_info;
+   memcpy(param->bssid, info->bssid, 6);
+   memcpy((u8 *)param->ssid, info->ssid, info->ssid_len + 1);
+   param->ssid_len = info->ssid_len;
+   memset(param->rsn_pcip_policy, 0xFF, 3);
+   memset(param->rsn_auth_policy, 0xFF, 3);
+
+   while (index < ies_len) {
+   if (ies[index] == SUPP_RATES_IE) {
+   rates_no = ies[index + 1];
+   param->supp_rates[0] = rates_no;
+   index += 2;
+
+   for (i = 0; i < rates_no; i++)
+   param->supp_rates[i + 1] = 

[PATCH 01/13] staging: wilc1000: rename enuEvent to avoid camelCase

2018-03-02 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 253225c..b46a759 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -267,7 +267,7 @@ static struct wilc_vif *join_req_vif;
 
 static void *host_int_parse_join_bss_param(struct network_info *info);
 static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
-static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event enuEvent);
+static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt);
 static void host_if_work(struct work_struct *work);
 
 /*!
@@ -863,15 +863,14 @@ static s32 handle_scan(struct wilc_vif *vif, struct 
scan_attr *scan_info)
return result;
 }
 
-static s32 handle_scan_done(struct wilc_vif *vif,
-   enum scan_event enuEvent)
+static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
 {
s32 result = 0;
u8 u8abort_running_scan;
struct wid wid;
struct host_if_drv *hif_drv = vif->hif_drv;
 
-   if (enuEvent == SCAN_EVENT_ABORTED) {
+   if (evt == SCAN_EVENT_ABORTED) {
u8abort_running_scan = 1;
wid.id = (u16)WID_ABORT_RUNNING_SCAN;
wid.type = WID_CHAR;
@@ -893,7 +892,7 @@ static s32 handle_scan_done(struct wilc_vif *vif,
}
 
if (hif_drv->usr_scan_req.scan_result) {
-   hif_drv->usr_scan_req.scan_result(enuEvent, NULL,
+   hif_drv->usr_scan_req.scan_result(evt, NULL,
  hif_drv->usr_scan_req.arg, 
NULL);
hif_drv->usr_scan_req.scan_result = NULL;
}
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/13] staging: wilc1000: remove always 'true' check from 'if' statement

2018-03-02 Thread Ajay Singh
Fix few smatch warning related to 'warn: always true condition'.

handle_cfg_param() warn: always true condition
'(cfg_param_attr->auth_timeout < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->rts_threshold < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->beacon_interval < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->site_survey_scan_time < 65536) => (0-u16max <
65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->active_scan_time < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->passive_scan_time < 65536) => (0-u16max < 65536)'

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index b46a759..f992e5d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -510,8 +510,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & AUTHEN_TIMEOUT) {
-   if (cfg_param_attr->auth_timeout > 0 &&
-   cfg_param_attr->auth_timeout < 65536) {
+   if (cfg_param_attr->auth_timeout > 0) {
wid_list[i].id = WID_AUTH_TIMEOUT;
wid_list[i].val = (s8 *)_param_attr->auth_timeout;
wid_list[i].type = WID_SHORT;
@@ -579,8 +578,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & RTS_THRESHOLD) {
-   if (cfg_param_attr->rts_threshold > 255 &&
-   cfg_param_attr->rts_threshold < 65536) {
+   if (cfg_param_attr->rts_threshold > 255) {
wid_list[i].id = WID_RTS_THRESHOLD;
wid_list[i].val = (s8 *)_param_attr->rts_threshold;
wid_list[i].type = WID_SHORT;
@@ -632,8 +630,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & BEACON_INTERVAL) {
-   if (cfg_param_attr->beacon_interval > 0 &&
-   cfg_param_attr->beacon_interval < 65536) {
+   if (cfg_param_attr->beacon_interval > 0) {
wid_list[i].id = WID_BEACON_INTERVAL;
wid_list[i].val = (s8 
*)_param_attr->beacon_interval;
wid_list[i].type = WID_SHORT;
@@ -673,8 +670,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & SITE_SURVEY_SCAN_TIME) {
-   if (cfg_param_attr->site_survey_scan_time > 0 &&
-   cfg_param_attr->site_survey_scan_time < 65536) {
+   if (cfg_param_attr->site_survey_scan_time > 0) {
wid_list[i].id = WID_SITE_SURVEY_SCAN_TIME;
wid_list[i].val = (s8 
*)_param_attr->site_survey_scan_time;
wid_list[i].type = WID_SHORT;
@@ -687,8 +683,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & ACTIVE_SCANTIME) {
-   if (cfg_param_attr->active_scan_time > 0 &&
-   cfg_param_attr->active_scan_time < 65536) {
+   if (cfg_param_attr->active_scan_time > 0) {
wid_list[i].id = WID_ACTIVE_SCAN_TIME;
wid_list[i].val = (s8 
*)_param_attr->active_scan_time;
wid_list[i].type = WID_SHORT;
@@ -701,8 +696,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & PASSIVE_SCANTIME) {
-   if (cfg_param_attr->passive_scan_time > 0 &&
-   cfg_param_attr->passive_scan_time < 65536) {
+   if (cfg_param_attr->passive_scan_time > 0) {
wid_list[i].id = WID_PASSIVE_SCAN_TIME;
wid_list[i].val = (s8 
*)_param_attr->passive_scan_time;
wid_list[i].type = WID_SHORT;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/13] staging: wilc1000: fix line over 80 char in wilc_network_info_received()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 character' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index cabee47..a44ddb2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3482,7 +3482,10 @@ void wilc_network_info_received(struct wilc *wilc, u8 
*buffer, u32 length)
struct host_if_drv *hif_drv = NULL;
struct wilc_vif *vif;
 
-   id = ((buffer[length - 4]) | (buffer[length - 3] << 8) | (buffer[length 
- 2] << 16) | (buffer[length - 1] << 24));
+   id = buffer[length - 4];
+   id |= (buffer[length - 3] << 8);
+   id |= (buffer[length - 2] << 16);
+   id |= (buffer[length - 1] << 24);
vif = wilc_get_vif_from_idx(wilc, id);
if (!vif)
return;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/13] staging: wilc1000: fix line over 80 char in handle_cfg_param()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 char' issues found by checkpatch.pl script in
handle_cfg_param(). Rename variables and used temporary variables
to fix the line over 80 characters issue.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 175 +-
 1 file changed, 98 insertions(+), 77 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index f992e5d..cabee47 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -469,8 +469,7 @@ static void handle_get_mac_address(struct wilc_vif *vif,
complete(_wait_response);
 }
 
-static void handle_cfg_param(struct wilc_vif *vif,
-struct cfg_param_attr *cfg_param_attr)
+static void handle_cfg_param(struct wilc_vif *vif, struct cfg_param_attr 
*param)
 {
int ret = 0;
struct wid wid_list[32];
@@ -479,12 +478,12 @@ static void handle_cfg_param(struct wilc_vif *vif,
 
mutex_lock(_drv->cfg_values_lock);
 
-   if (cfg_param_attr->flag & BSS_TYPE) {
-   u8 bss_type = cfg_param_attr->bss_type;
+   if (param->flag & BSS_TYPE) {
+   u8 bss_type = param->bss_type;
 
if (bss_type < 6) {
wid_list[i].id = WID_BSS_TYPE;
-   wid_list[i].val = (s8 *)_type;
+   wid_list[i].val = (s8 *)>bss_type;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
hif_drv->cfg_values.bss_type = bss_type;
@@ -494,222 +493,244 @@ static void handle_cfg_param(struct wilc_vif *vif,
}
i++;
}
-   if (cfg_param_attr->flag & AUTH_TYPE) {
-   if (cfg_param_attr->auth_type == 1 ||
-   cfg_param_attr->auth_type == 2 ||
-   cfg_param_attr->auth_type == 5) {
+   if (param->flag & AUTH_TYPE) {
+   u8 auth_type = param->auth_type;
+
+   if (auth_type == 1 || auth_type == 2 || auth_type == 5) {
wid_list[i].id = WID_AUTH_TYPE;
-   wid_list[i].val = (s8 *)_param_attr->auth_type;
+   wid_list[i].val = (s8 *)>auth_type;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.auth_type = 
(u8)cfg_param_attr->auth_type;
+   hif_drv->cfg_values.auth_type = auth_type;
} else {
netdev_err(vif->ndev, "Impossible value\n");
goto unlock;
}
i++;
}
-   if (cfg_param_attr->flag & AUTHEN_TIMEOUT) {
-   if (cfg_param_attr->auth_timeout > 0) {
+   if (param->flag & AUTHEN_TIMEOUT) {
+   if (param->auth_timeout > 0) {
wid_list[i].id = WID_AUTH_TIMEOUT;
-   wid_list[i].val = (s8 *)_param_attr->auth_timeout;
+   wid_list[i].val = (s8 *)>auth_timeout;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.auth_timeout = 
cfg_param_attr->auth_timeout;
+   hif_drv->cfg_values.auth_timeout = param->auth_timeout;
} else {
netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
goto unlock;
}
i++;
}
-   if (cfg_param_attr->flag & POWER_MANAGEMENT) {
-   if (cfg_param_attr->power_mgmt_mode < 5) {
+   if (param->flag & POWER_MANAGEMENT) {
+   u8 pm_mode = param->power_mgmt_mode;
+
+   if (pm_mode < 5) {
wid_list[i].id = WID_POWER_MANAGEMENT;
-   wid_list[i].val = (s8 
*)_param_attr->power_mgmt_mode;
+   wid_list[i].val = (s8 *)>power_mgmt_mode;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.power_mgmt_mode = 
(u8)cfg_param_attr->power_mgmt_mode;
+   hif_drv->cfg_values.power_mgmt_mode = pm_mode;
} else {
netdev_err(vif->ndev, "Invalid power mode\n");
goto unlock;
}
i++;
}
-   if (cfg_param_attr->flag & RETRY_SHORT) {
-   if (cfg_param_attr->short_retry_limit > 0 &&
-   cfg_param_attr->short_retry_limit < 256) {
+   if (param->flag & RETRY_SHORT) {
+   u16 retry_limit = param->short_retry_limit;
+
+   if (retry_limit > 0 && retry_limit < 256) {
wid_list[i].id = WID_SHORT_RETRY_LIMIT;
-   

[PATCH 3/3] staging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq()

2018-03-02 Thread Ajay Singh
Refactor wilc_wlan_handle_rxq() to fix line over 80 character issue
found by checkpatch.pl script. Added a new function to split
'wilc_wlan_handle_rxq' function code.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c | 114 +++
 1 file changed, 63 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 8490407..bcbb923 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -773,9 +773,70 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 
*txq_count)
return ret;
 }
 
+static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size)
+{
+   int offset = 0;
+   u32 header;
+   u32 pkt_len, pkt_offset, tp_len;
+   int is_cfg_packet;
+   u8 *buff_ptr;
+
+   do {
+   buff_ptr = buffer + offset;
+   memcpy(, buff_ptr, 4);
+   header = cpu_to_le32(header);
+
+   is_cfg_packet = (header >> 31) & 0x1;
+   pkt_offset = (header >> 22) & 0x1ff;
+   tp_len = (header >> 11) & 0x7ff;
+   pkt_len = header & 0x7ff;
+
+   if (pkt_len == 0 || tp_len == 0)
+   break;
+
+   if (pkt_offset & IS_MANAGMEMENT) {
+   pkt_offset &= ~(IS_MANAGMEMENT |
+   IS_MANAGMEMENT_CALLBACK |
+   IS_MGMT_STATUS_SUCCES);
+   buff_ptr += HOST_HDR_OFFSET;
+   wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len);
+   } else {
+   if (!is_cfg_packet) {
+   if (pkt_len > 0) {
+   wilc_frmw_to_linux(wilc, buff_ptr,
+  pkt_len,
+  pkt_offset);
+   }
+   } else {
+   struct wilc_cfg_rsp rsp;
+
+   buff_ptr += pkt_offset;
+
+   wilc_wlan_cfg_indicate_rx(wilc, buff_ptr,
+ pkt_len,
+ );
+   if (rsp.type == WILC_CFG_RSP) {
+   if (wilc->cfg_seq_no == rsp.seq_no)
+   complete(>cfg_event);
+   } else if (rsp.type == WILC_CFG_RSP_STATUS) {
+   wilc_mac_indicate(wilc,
+ 
WILC_MAC_INDICATE_STATUS);
+
+   } else if (rsp.type == WILC_CFG_RSP_SCAN) {
+   wilc_mac_indicate(wilc,
+ 
WILC_MAC_INDICATE_SCAN);
+   }
+   }
+   }
+   offset += tp_len;
+   if (offset >= size)
+   break;
+   } while (1);
+}
+
 static void wilc_wlan_handle_rxq(struct wilc *wilc)
 {
-   int offset = 0, size;
+   int size;
u8 *buffer;
struct rxq_entry_t *rqe;
 
@@ -792,57 +853,8 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 
buffer = rqe->buffer;
size = rqe->buffer_size;
-   offset = 0;
-
-   do {
-   u32 header;
-   u32 pkt_len, pkt_offset, tp_len;
-   int is_cfg_packet;
-
-   memcpy(, [offset], 4);
-   header = cpu_to_le32(header);
-
-   is_cfg_packet = (header >> 31) & 0x1;
-   pkt_offset = (header >> 22) & 0x1ff;
-   tp_len = (header >> 11) & 0x7ff;
-   pkt_len = header & 0x7ff;
-
-   if (pkt_len == 0 || tp_len == 0)
-   break;
+   wilc_wlan_handle_rx_buff(wilc, buffer, size);
 
-   if (pkt_offset & IS_MANAGMEMENT) {
-   pkt_offset &= ~(IS_MANAGMEMENT |
-   IS_MANAGMEMENT_CALLBACK |
-   IS_MGMT_STATUS_SUCCES);
-
-   wilc_wfi_mgmt_rx(wilc, [offset + 
HOST_HDR_OFFSET], pkt_len);
-   } else {
-   if (!is_cfg_packet) {
-   if (pkt_len > 0) {
-   wilc_frmw_to_linux(wilc,
-  
[offset],
-  

[PATCH 1/3] staging: wilc1000: fix open parenthesis mismatch in wilc_wlan_cfg_get()

2018-03-02 Thread Ajay Singh
Fix 'Alignment should match open parenthesis' issue found by
checkpatch.pl script. Reduce the leading tab, to make space for open
parenthesis match.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 74b80ad..7c0d212 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1267,21 +1267,22 @@ int wilc_wlan_cfg_get(struct wilc_vif *vif, int start, 
u16 wid, int commit,
offset += ret_size;
wilc->cfg_frame_offset = offset;
 
-   if (commit) {
-   wilc->cfg_frame_in_use = 1;
+   if (!commit)
+   return ret_size;
 
-   if (wilc_wlan_cfg_commit(vif, WILC_CFG_QUERY, drv_handler))
-   ret_size = 0;
+   wilc->cfg_frame_in_use = 1;
 
-   if (!wait_for_completion_timeout(>cfg_event,
-   msecs_to_jiffies(CFG_PKTS_TIMEOUT))) {
-   netdev_dbg(vif->ndev, "Get Timed Out\n");
-   ret_size = 0;
-   }
-   wilc->cfg_frame_in_use = 0;
-   wilc->cfg_frame_offset = 0;
-   wilc->cfg_seq_no += 1;
+   if (wilc_wlan_cfg_commit(vif, WILC_CFG_QUERY, drv_handler))
+   ret_size = 0;
+
+   if (!wait_for_completion_timeout(>cfg_event,
+msecs_to_jiffies(CFG_PKTS_TIMEOUT))) {
+   netdev_dbg(vif->ndev, "Get Timed Out\n");
+   ret_size = 0;
}
+   wilc->cfg_frame_in_use = 0;
+   wilc->cfg_frame_offset = 0;
+   wilc->cfg_seq_no += 1;
 
return ret_size;
 }
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/3] staging: wilc1000: fix line over 80 char & coding style

2018-03-02 Thread Ajay Singh
This patch series contains fixes for open parenthesis mismatch and line
over 80 char issue found by checkpatch script.

Ajay Singh (3):
  staging: wilc1000: fix open parenthesis mismatch in
wilc_wlan_cfg_get()
  staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set()
  staging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq()

 drivers/staging/wilc1000/wilc_wlan.c | 172 +++
 1 file changed, 93 insertions(+), 79 deletions(-)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set()

2018-03-02 Thread Ajay Singh
Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c | 37 ++--
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 7c0d212..8490407 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1225,27 +1225,28 @@ int wilc_wlan_cfg_set(struct wilc_vif *vif, int start, 
u16 wid, u8 *buffer,
offset += ret_size;
wilc->cfg_frame_offset = offset;
 
-   if (commit) {
-   netdev_dbg(vif->ndev,
-  "[WILC]PACKET Commit with sequence number %d\n",
-  wilc->cfg_seq_no);
-   netdev_dbg(vif->ndev, "Processing cfg_set()\n");
-   wilc->cfg_frame_in_use = 1;
-
-   if (wilc_wlan_cfg_commit(vif, WILC_CFG_SET, drv_handler))
-   ret_size = 0;
-
-   if (!wait_for_completion_timeout(>cfg_event,
-
msecs_to_jiffies(CFG_PKTS_TIMEOUT))) {
-   netdev_dbg(vif->ndev, "Set Timed Out\n");
-   ret_size = 0;
-   }
+   if (!commit)
+   return ret_size;
 
-   wilc->cfg_frame_in_use = 0;
-   wilc->cfg_frame_offset = 0;
-   wilc->cfg_seq_no += 1;
+   netdev_dbg(vif->ndev,
+  "[WILC]PACKET Commit with sequence number %d\n",
+  wilc->cfg_seq_no);
+   netdev_dbg(vif->ndev, "Processing cfg_set()\n");
+   wilc->cfg_frame_in_use = 1;
+
+   if (wilc_wlan_cfg_commit(vif, WILC_CFG_SET, drv_handler))
+   ret_size = 0;
+
+   if (!wait_for_completion_timeout(>cfg_event,
+msecs_to_jiffies(CFG_PKTS_TIMEOUT))) {
+   netdev_dbg(vif->ndev, "Set Timed Out\n");
+   ret_size = 0;
}
 
+   wilc->cfg_frame_in_use = 0;
+   wilc->cfg_frame_offset = 0;
+   wilc->cfg_seq_no += 1;
+
return ret_size;
 }
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/6] Staging: iio: adis16209: Remove unnecessary comments and group the definitions

2018-03-02 Thread Shreeya Patel
Remove some unnecessay comments and group the control
register and register field macros together.

Signed-off-by: Shreeya Patel 
---
 drivers/staging/iio/accel/adis16209.c | 116 ++
 1 file changed, 19 insertions(+), 97 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16209.c 
b/drivers/staging/iio/accel/adis16209.c
index 151120f..d2d1254 100644
--- a/drivers/staging/iio/accel/adis16209.c
+++ b/drivers/staging/iio/accel/adis16209.c
@@ -21,135 +21,60 @@
 #include 
 
 #define ADIS16209_STARTUP_DELAY_MS 220
-
-/* Flash memory write count */
 #define ADIS16209_FLASH_CNT_REG0x00
 
-/* Output, power supply */
+/* Data Output Register Definitions */
 #define ADIS16209_SUPPLY_OUT_REG   0x02
-
-/* Output, x-axis accelerometer */
 #define ADIS16209_XACCL_OUT_REG0x04
-
-/* Output, y-axis accelerometer */
 #define ADIS16209_YACCL_OUT_REG0x06
-
-/* Output, auxiliary ADC input */
 #define ADIS16209_AUX_ADC_REG  0x08
-
-/* Output, temperature */
 #define ADIS16209_TEMP_OUT_REG 0x0A
-
-/* Output, x-axis inclination */
 #define ADIS16209_XINCL_OUT_REG0x0C
-
-/* Output, y-axis inclination */
 #define ADIS16209_YINCL_OUT_REG0x0E
-
-/* Output, +/-180 vertical rotational position */
 #define ADIS16209_ROT_OUT_REG  0x10
 
-/* Calibration, x-axis acceleration offset null */
+/* Calibration Register Definitions */
 #define ADIS16209_XACCL_NULL_REG   0x12
-
-/* Calibration, y-axis acceleration offset null */
 #define ADIS16209_YACCL_NULL_REG   0x14
-
-/* Calibration, x-axis inclination offset null */
 #define ADIS16209_XINCL_NULL_REG   0x16
-
-/* Calibration, y-axis inclination offset null */
 #define ADIS16209_YINCL_NULL_REG   0x18
-
-/* Calibration, vertical rotation offset null */
 #define ADIS16209_ROT_NULL_REG 0x1A
 
-/* Alarm 1 amplitude threshold */
+/* Alarm Register Definitions */
 #define ADIS16209_ALM_MAG1_REG 0x20
-
-/* Alarm 2 amplitude threshold */
 #define ADIS16209_ALM_MAG2_REG 0x22
-
-/* Alarm 1, sample period */
 #define ADIS16209_ALM_SMPL1_REG0x24
-
-/* Alarm 2, sample period */
 #define ADIS16209_ALM_SMPL2_REG0x26
-
-/* Alarm control */
 #define ADIS16209_ALM_CTRL_REG 0x28
 
-/* Auxiliary DAC data */
 #define ADIS16209_AUX_DAC_REG  0x30
-
-/* General-purpose digital input/output control */
 #define ADIS16209_GPIO_CTRL_REG0x32
-
-/* Miscellaneous control */
-#define ADIS16209_MSC_CTRL_REG 0x34
-
-/* Internal sample period (rate) control */
 #define ADIS16209_SMPL_PRD_REG 0x36
-
-/* Operation, filter configuration */
 #define ADIS16209_AVG_CNT_REG  0x38
-
-/* Operation, sleep mode control */
 #define ADIS16209_SLP_CNT_REG  0x3A
 
-/* Diagnostics, system status register */
-#define ADIS16209_DIAG_STAT_REG0x3C
-
-/* Operation, system command register */
-#define ADIS16209_GLOB_CMD_REG 0x3E
-
-/* MSC_CTRL */
-
-/* Self-test at power-on: 1 = disabled, 0 = enabled */
-#define ADIS16209_MSC_CTRL_PWRUP_SELF_TEST BIT(10)
-
-/* Self-test enable */
-#define ADIS16209_MSC_CTRL_SELF_TEST_ENBIT(8)
-
-/* Data-ready enable: 1 = enabled, 0 = disabled */
-#define ADIS16209_MSC_CTRL_DATA_RDY_EN BIT(2)
-
-/* Data-ready polarity: 1 = active high, 0 = active low */
-#define ADIS16209_MSC_CTRL_ACTIVE_HIGH BIT(1)
+#define ADIS16209_MSC_CTRL_REG 0x34
+#define  ADIS16209_MSC_CTRL_PWRUP_SELF_TESTBIT(10)
+#define  ADIS16209_MSC_CTRL_SELF_TEST_EN   BIT(8)
+#define  ADIS16209_MSC_CTRL_DATA_RDY_ENBIT(2)
+#define  ADIS16209_MSC_CTRL_ACTIVE_HIGHBIT(1)
+#define  ADIS16209_MSC_CTRL_DATA_RDY_DIO2  BIT(0)
 
-/* Data-ready line selection: 1 = DIO2, 0 = DIO1 */
-#define ADIS16209_MSC_CTRL_DATA_RDY_DIO2   BIT(0)
-
-/* DIAG_STAT */
-
-/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */
-#define ADIS16209_DIAG_STAT_ALARM2BIT(9)
-
-/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */
-#define ADIS16209_DIAG_STAT_ALARM1BIT(8)
-
-/* Self-test diagnostic error flag: 1 = error condition, 0 = normal operation 
*/
+#define ADIS16209_DIAG_STAT_REG0x3C
+#define  ADIS16209_DIAG_STAT_ALARM2BIT(9)
+#define  ADIS16209_DIAG_STAT_ALARM1BIT(8)
 #define ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT  5
-
-/* SPI communications failure */
 #define ADIS16209_DIAG_STAT_SPI_FAIL_BIT   3
-
-/* Flash update failure */
 #define ADIS16209_DIAG_STAT_FLASH_UPT_BIT  2
-
-/* Power supply above 3.625 V */
 #define ADIS16209_DIAG_STAT_POWER_HIGH_BIT 1
-
-/* Power supply below 3.15 V */
 #define ADIS16209_DIAG_STAT_POWER_LOW_BIT  0
 
-/* GLOB_CMD */
-
-#define ADIS16209_GLOB_CMD_SW_RESETBIT(7)
-#define ADIS16209_GLOB_CMD_CLEAR_STAT  BIT(4)
-#define 

[PATCH 2/6] Staging: iio: adis16209: Change the definition name

2018-03-02 Thread Shreeya Patel
The change in the definition name makes it then obvious
what the units are throughout the driver and there will
be no need of the comment.

Signed-off-by: Shreeya Patel 
---
 drivers/staging/iio/accel/adis16209.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16209.c 
b/drivers/staging/iio/accel/adis16209.c
index 58f604d..830c278 100644
--- a/drivers/staging/iio/accel/adis16209.c
+++ b/drivers/staging/iio/accel/adis16209.c
@@ -20,7 +20,7 @@
 #include 
 #include 
 
-#define ADIS16209_STARTUP_DELAY220 /* ms */
+#define ADIS16209_STARTUP_DELAY_MS 220
 
 /* Flash memory write count */
 #define ADIS16209_FLASH_CNT  0x00
@@ -303,7 +303,7 @@ static const struct adis_data adis16209_data = {
 
.self_test_mask = ADIS16209_MSC_CTRL_SELF_TEST_EN,
.self_test_no_autoclear = true,
-   .startup_delay = ADIS16209_STARTUP_DELAY,
+   .startup_delay = ADIS16209_STARTUP_DELAY_MS,
 
.status_error_msgs = adis16209_status_error_msgs,
.status_error_mask = BIT(ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT) |
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] Staging: iio: adis16209: Arrange headers in alphabetical order

2018-03-02 Thread Shreeya Patel
Arrange the headers in alphabetical order for cleanup
purpose.

Signed-off-by: Shreeya Patel 
---
 drivers/staging/iio/accel/adis16209.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16209.c 
b/drivers/staging/iio/accel/adis16209.c
index 7fcef9a..58f604d 100644
--- a/drivers/staging/iio/accel/adis16209.c
+++ b/drivers/staging/iio/accel/adis16209.c
@@ -9,11 +9,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 #include 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/6] adis16209 driver cleanup

2018-03-02 Thread Shreeya Patel
This patchset has been introduced for the cleanup of
adis16209 driver.
This patchset cleans up miscellaneous code fragments
and improves the code readability.

Shreeya Patel (6):
  Staging: iio: adis16209: Arrange headers in alphabetical order
  Staging: iio: adis16209: Change the definition name
  Staging: iio: adis16209: Add _REG postfix for registers
  Staging: iio: adis16209: Remove unnecessary comments and group the
definitions
  Staging: iio: adis16209: Add some informatic comments
  Staging: iio: adis16209: Use sign_extend32 and adjust a switch
statement

 drivers/staging/iio/accel/adis16209.c | 245 +-
 1 file changed, 94 insertions(+), 151 deletions(-)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging/imx: Fix inconsistent IS_ERR and PTR_ERR

2018-03-02 Thread Philipp Zabel
Hi Fabio,

On Thu, 2018-03-01 at 13:43 -0300, Fabio Estevam wrote:
> On Thu, Mar 1, 2018 at 1:27 PM, Philipp Zabel  wrote:
> 
> > Oh, this only works for csi ports that have pinctrl in their csi port
> > node, like:
> > 
> > _csi0 {
> > pinctrl-names = "default";
> > pinctrl-0 = <_ipu1_csi0>;
> > };
> 
> This is the case for imx6qdl-sabresd.dtsi and even in this case
> devm_pinctrl_get_select_default() fails
> 
> > pinctrl would have to be moved out of the csi port nodes, for example
> > into their parent ipu nodes, or maybe more correctly, into the video mux
> > nodes in each device tree.
> 
> Tried it like this:
> 
> --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> @@ -154,12 +154,9 @@
>  };
> 
>  _csi0_mux_from_parallel_sensor {
> -   remote-endpoint = <_to_ipu1_csi0_mux>;
> -};
> -
> -_csi0 {
> pinctrl-names = "default";
> pinctrl-0 = <_ipu1_csi0>;
> +   remote-endpoint = <_to_ipu1_csi0_mux>;
>  };
> 
>  _csi {
> 
> 
> but still get the devm_pinctrl_get_select_default() failure.

Yes, this would still require to ignore the pinctrl error in the CSI
driver.

I just think that this is might be more correct, since the external pins
are directly connected to the mux input port.

> I was not able to change the dts so that
> devm_pinctrl_get_select_default() succeeds.
> 
> If you agree I can send the following change:
> 
> diff --git a/drivers/staging/media/imx/imx-media-csi.c
> b/drivers/staging/media/imx/imx-media-csi.c
> index 5a195f8..c40f786 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -1797,11 +1797,8 @@ static int imx_csi_probe(struct platform_device *pdev)
>  */
> priv->dev->of_node = pdata->of_node;
> pinctrl = devm_pinctrl_get_select_default(priv->dev);
> -   if (IS_ERR(pinctrl)) {
> -   ret = PTR_ERR(priv->vdev);
> -   goto free;
> -   }
> -
> +   if (IS_ERR(pinctrl))
> +   dev_dbg(priv->dev, "pintrl_get_select_default() failed\n");

I would add the error code to the debug print.

> ret = v4l2_async_register_subdev(>sd);
> if (ret)
> goto free;
> 
> So that the error is ignored and we still can change the pinctrl values via 
> dts.
> 
> What do you think?

Maybe we should still throw the error if it is anything other than
-ENODEV (which we expect in case there is no pinctrl property in the csi
port node):

if (IS_ERR(pinctrl)) {
ret = PTR_ERR(pinctrl);
dev_dbg(priv->dev, "pinctrl_get_select_default() failed: %d\n",
ret);
if (ret != -ENODEV)
goto free;
}

regards
Philipp
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/2] staging: fsl-mc: Move DPBP and DPCON out of staging

2018-03-02 Thread Bogdan Purcareata
Previous submission: https://lkml.org/lkml/2018/3/1/733

Commit 6bd067c48ef ("staging: fsl-mc: Move core bus out of staging")
moves the fsl-mc bus driver infrastructure out of staging to
drivers/bus/fsl-mc. The next step is moving a couple of tightly
connected DPAA2 objects - DPBP (Data Path Buffer Pool) and DPCON
(Data Path Concentrator).

The patches handle moving out the mentioned objects, one at a time.

v1 -> v2:
- previous cleanup patch already applied, so removed from patchset
- properly refactor #include line (Laurentiu)

Bogdan Purcareata (2):
  staging: fsl-mc: Move DPBP out of staging
  staging: fsl-mc: Move DPCON out of staging

 drivers/bus/fsl-mc/Makefile|   2 +
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c  |   4 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpcon.c |   4 +-
 drivers/bus/fsl-mc/fsl-mc-private.h|  87 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |   3 +-
 drivers/staging/fsl-mc/bus/Makefile|   2 -
 drivers/staging/fsl-mc/bus/dpbp-cmd.h  |  44 -
 drivers/staging/fsl-mc/bus/dpcon-cmd.h |  53 --
 drivers/staging/fsl-mc/include/dpbp.h  |  53 --
 drivers/staging/fsl-mc/include/dpcon.h |  79 ---
 include/linux/fsl/mc.h | 108 +
 11 files changed, 202 insertions(+), 237 deletions(-)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (98%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpcon.c (99%)
 delete mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h
 delete mode 100644 drivers/staging/fsl-mc/bus/dpcon-cmd.h
 delete mode 100644 drivers/staging/fsl-mc/include/dpbp.h
 delete mode 100644 drivers/staging/fsl-mc/include/dpcon.h

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/2] staging: fsl-mc: Move DPBP out of staging

2018-03-02 Thread Bogdan Purcareata
Move the source files out of staging into their final locations:
- dpbp.c goes to drivers/bus/fsl-mc/, next to the core infrastructure
- dpbp-cmd.h gets merged into drivers/bus/fsl-mc/fsl-mc-private.h, next
  to the other internally used APIs
- dpbp.h gets merged into include/linux/fsl/mc.h, exposing the public
  API

Update references in the dpaa2-eth staging driver.

DPBP stands for Data Path Buffer Pool - you can read more about the
object in Documentation/networking/dpaa2/overview.rst

Signed-off-by: Bogdan Purcareata 
Reviewed-by: Laurentiu Tudor 
---
v1 -> v2:
- properly refactor #include line (Laurentiu)

 drivers/bus/fsl-mc/Makefile   |  1 +
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c |  4 +-
 drivers/bus/fsl-mc/fsl-mc-private.h   | 39 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h|  2 +-
 drivers/staging/fsl-mc/bus/Makefile   |  3 +-
 drivers/staging/fsl-mc/bus/dpbp-cmd.h | 44 ---
 drivers/staging/fsl-mc/include/dpbp.h | 53 ---
 include/linux/fsl/mc.h| 42 ++
 8 files changed, 86 insertions(+), 102 deletions(-)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (98%)
 delete mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h
 delete mode 100644 drivers/staging/fsl-mc/include/dpbp.h

diff --git a/drivers/bus/fsl-mc/Makefile b/drivers/bus/fsl-mc/Makefile
index 6a97f2c..da26e52 100644
--- a/drivers/bus/fsl-mc/Makefile
+++ b/drivers/bus/fsl-mc/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o
 mc-bus-driver-objs := fsl-mc-bus.o \
  mc-sys.o \
  mc-io.o \
+ dpbp.o \
  dprc.o \
  dprc-driver.o \
  fsl-mc-allocator.o \
diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/bus/fsl-mc/dpbp.c
similarity index 98%
rename from drivers/staging/fsl-mc/bus/dpbp.c
rename to drivers/bus/fsl-mc/dpbp.c
index 85735bb..0aeacc5 100644
--- a/drivers/staging/fsl-mc/bus/dpbp.c
+++ b/drivers/bus/fsl-mc/dpbp.c
@@ -5,9 +5,9 @@
  */
 #include 
 #include 
-#include "../include/dpbp.h"
+#include 
 
-#include "dpbp-cmd.h"
+#include "fsl-mc-private.h"
 
 /**
  * dpbp_open() - Open a control session for the specified object.
diff --git a/drivers/bus/fsl-mc/fsl-mc-private.h 
b/drivers/bus/fsl-mc/fsl-mc-private.h
index bed990c..4ef8d7e 100644
--- a/drivers/bus/fsl-mc/fsl-mc-private.h
+++ b/drivers/bus/fsl-mc/fsl-mc-private.h
@@ -379,6 +379,45 @@ int dprc_get_container_id(struct fsl_mc_io *mc_io,
  u32 cmd_flags,
  int *container_id);
 
+/*
+ * Data Path Buffer Pool (DPBP) API
+ */
+
+/* DPBP Version */
+#define DPBP_VER_MAJOR 3
+#define DPBP_VER_MINOR 2
+
+/* Command versioning */
+#define DPBP_CMD_BASE_VERSION  1
+#define DPBP_CMD_ID_OFFSET 4
+
+#define DPBP_CMD(id)   (((id) << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
+
+/* Command IDs */
+#define DPBP_CMDID_CLOSE   DPBP_CMD(0x800)
+#define DPBP_CMDID_OPENDPBP_CMD(0x804)
+
+#define DPBP_CMDID_ENABLE  DPBP_CMD(0x002)
+#define DPBP_CMDID_DISABLE DPBP_CMD(0x003)
+#define DPBP_CMDID_GET_ATTRDPBP_CMD(0x004)
+#define DPBP_CMDID_RESET   DPBP_CMD(0x005)
+
+struct dpbp_cmd_open {
+   __le32 dpbp_id;
+};
+
+#define DPBP_ENABLE0x1
+
+struct dpbp_rsp_get_attributes {
+   /* response word 0 */
+   __le16 pad;
+   __le16 bpid;
+   __le32 id;
+   /* response word 1 */
+   __le16 version_major;
+   __le16 version_minor;
+};
+
 /**
  * Maximum number of total IRQs that can be pre-allocated for an MC bus'
  * IRQ pool
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index e577410..ce864ee 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -35,10 +35,10 @@
 
 #include 
 #include 
+#include 
 
 #include "../../fsl-mc/include/dpaa2-io.h"
 #include "../../fsl-mc/include/dpaa2-fd.h"
-#include "../../fsl-mc/include/dpbp.h"
 #include "../../fsl-mc/include/dpcon.h"
 #include "dpni.h"
 #include "dpni-cmd.h"
diff --git a/drivers/staging/fsl-mc/bus/Makefile 
b/drivers/staging/fsl-mc/bus/Makefile
index b67889e..ea6479f 100644
--- a/drivers/staging/fsl-mc/bus/Makefile
+++ b/drivers/staging/fsl-mc/bus/Makefile
@@ -4,8 +4,7 @@
 #
 # Copyright (C) 2014 Freescale Semiconductor, Inc.
 #
-obj-$(CONFIG_FSL_MC_BUS) += dpbp.o \
-   dpcon.o
+obj-$(CONFIG_FSL_MC_BUS) += dpcon.o
 
 # MC DPIO driver
 obj-$(CONFIG_FSL_MC_DPIO) += dpio/
diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h 
b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
deleted file 

Re: [PATCH 2/2] staging: most: Fix a coding style problem

2018-03-02 Thread Dan Carpenter
You've got two subjects which are the same.  That's not allowed, sorry.
You could just say:

[PATCH 1/2] staging: most: Add a blank line
[PATCH 2/2] staging: most: Silence a long line warning

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 2/3] staging: fsl-mc: Move DPBP out of staging

2018-03-02 Thread Bogdan Purcareata
> -Original Message-
> From: Laurentiu Tudor
> Sent: Friday, March 02, 2018 11:18 AM
> To: Bogdan Purcareata ; gre...@linuxfoundation.org;
> Ruxandra Ioana Ciocoi Radulescu 
> Cc: stuyo...@gmail.com; Ioana Ciornei ; Nipun Gupta
> ; Roy Pledge ; Horia Geantă
> ; de...@driverdev.osuosl.org; linux-
> ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org
> Subject: Re: [PATCH 2/3] staging: fsl-mc: Move DPBP out of staging
> 
> Hi Bogdan,
> 
> On 03/01/2018 07:47 PM, Bogdan Purcareata wrote:
> > Move the source files out of staging into their final locations:
> > - dpbp.c goes to drivers/bus/fsl-mc/, next to the core infrastructure
> > - dpbp-cmd.h gets merged into drivers/bus/fsl-mc/fsl-mc-private.h, next
> >to the other internally used APIs
> > - dpbp.h gets merged into include/linux/fsl/mc.h, exposing the public
> >API
> >
> > Update references in the dpaa2-eth staging driver.
> >
> > DPBP stands for Data Path Buffer Pool - you can read more about the
> > object in Documentation/networking/dpaa2/overview.rst
> >
> > Signed-off-by: Bogdan Purcareata 
> > ---
> >   drivers/bus/fsl-mc/Makefile   |  1 +
> >   drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c |  4 +-
> >   drivers/bus/fsl-mc/fsl-mc-private.h   | 39 +
> >   drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h|  2 +-
> >   drivers/staging/fsl-mc/bus/Makefile   |  3 +-
> >   drivers/staging/fsl-mc/bus/dpbp-cmd.h | 44 ---
> >   drivers/staging/fsl-mc/include/dpbp.h | 53 
> > 
> ---
> >   include/linux/fsl/mc.h| 42 ++
> >   8 files changed, 86 insertions(+), 102 deletions(-)
> >   rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (98%)
> >   delete mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h
> >   delete mode 100644 drivers/staging/fsl-mc/include/dpbp.h
> >
> > diff --git a/drivers/bus/fsl-mc/Makefile b/drivers/bus/fsl-mc/Makefile
> > index 6a97f2c..da26e52 100644
> > --- a/drivers/bus/fsl-mc/Makefile
> > +++ b/drivers/bus/fsl-mc/Makefile
> > @@ -9,6 +9,7 @@ obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o
> >   mc-bus-driver-objs := fsl-mc-bus.o \
> >   mc-sys.o \
> >   mc-io.o \
> > + dpbp.o \
> >   dprc.o \
> >   dprc-driver.o \
> >   fsl-mc-allocator.o \
> > diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/bus/fsl-mc/dpbp.c
> > similarity index 98%
> > rename from drivers/staging/fsl-mc/bus/dpbp.c
> > rename to drivers/bus/fsl-mc/dpbp.c
> > index 85735bb..31a360b 100644
> > --- a/drivers/staging/fsl-mc/bus/dpbp.c
> > +++ b/drivers/bus/fsl-mc/dpbp.c
> > @@ -5,9 +5,9 @@
> >*/
> >   #include 
> >   #include 
> > -#include "../include/dpbp.h"
> > +#include "linux/fsl/mc.h"
> 
> I think we can use <> here, same comment for patch 3/3.
> 
> Other than that, the series looks ok to me so for all the patches:
> 
> Reviewed-by: Laurentiu Tudor 

Thank you!
I will update the patchset - seeing that the cleanup one has already been 
applied - and will send a v2 shortly.

Best regards,
Bogdan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] staging: fsl-mc: Move DPBP out of staging

2018-03-02 Thread Laurentiu Tudor
Hi Bogdan,

On 03/01/2018 07:47 PM, Bogdan Purcareata wrote:
> Move the source files out of staging into their final locations:
> - dpbp.c goes to drivers/bus/fsl-mc/, next to the core infrastructure
> - dpbp-cmd.h gets merged into drivers/bus/fsl-mc/fsl-mc-private.h, next
>to the other internally used APIs
> - dpbp.h gets merged into include/linux/fsl/mc.h, exposing the public
>API
>
> Update references in the dpaa2-eth staging driver.
>
> DPBP stands for Data Path Buffer Pool - you can read more about the
> object in Documentation/networking/dpaa2/overview.rst
>
> Signed-off-by: Bogdan Purcareata 
> ---
>   drivers/bus/fsl-mc/Makefile   |  1 +
>   drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c |  4 +-
>   drivers/bus/fsl-mc/fsl-mc-private.h   | 39 +
>   drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h|  2 +-
>   drivers/staging/fsl-mc/bus/Makefile   |  3 +-
>   drivers/staging/fsl-mc/bus/dpbp-cmd.h | 44 ---
>   drivers/staging/fsl-mc/include/dpbp.h | 53 
> ---
>   include/linux/fsl/mc.h| 42 ++
>   8 files changed, 86 insertions(+), 102 deletions(-)
>   rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (98%)
>   delete mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h
>   delete mode 100644 drivers/staging/fsl-mc/include/dpbp.h
>
> diff --git a/drivers/bus/fsl-mc/Makefile b/drivers/bus/fsl-mc/Makefile
> index 6a97f2c..da26e52 100644
> --- a/drivers/bus/fsl-mc/Makefile
> +++ b/drivers/bus/fsl-mc/Makefile
> @@ -9,6 +9,7 @@ obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o
>   mc-bus-driver-objs := fsl-mc-bus.o \
> mc-sys.o \
> mc-io.o \
> +   dpbp.o \
> dprc.o \
> dprc-driver.o \
> fsl-mc-allocator.o \
> diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/bus/fsl-mc/dpbp.c
> similarity index 98%
> rename from drivers/staging/fsl-mc/bus/dpbp.c
> rename to drivers/bus/fsl-mc/dpbp.c
> index 85735bb..31a360b 100644
> --- a/drivers/staging/fsl-mc/bus/dpbp.c
> +++ b/drivers/bus/fsl-mc/dpbp.c
> @@ -5,9 +5,9 @@
>*/
>   #include 
>   #include 
> -#include "../include/dpbp.h"
> +#include "linux/fsl/mc.h"

I think we can use <> here, same comment for patch 3/3.

Other than that, the series looks ok to me so for all the patches:

Reviewed-by: Laurentiu Tudor 

---
Best Regards, Laurentiu

> -#include "dpbp-cmd.h"
> +#include "fsl-mc-private.h"
>
>   /**
>* dpbp_open() - Open a control session for the specified object.
> diff --git a/drivers/bus/fsl-mc/fsl-mc-private.h 
> b/drivers/bus/fsl-mc/fsl-mc-private.h
> index bed990c..4ef8d7e 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-private.h
> +++ b/drivers/bus/fsl-mc/fsl-mc-private.h
> @@ -379,6 +379,45 @@ int dprc_get_container_id(struct fsl_mc_io *mc_io,
> u32 cmd_flags,
> int *container_id);
>
> +/*
> + * Data Path Buffer Pool (DPBP) API
> + */
> +
> +/* DPBP Version */
> +#define DPBP_VER_MAJOR   3
> +#define DPBP_VER_MINOR   2
> +
> +/* Command versioning */
> +#define DPBP_CMD_BASE_VERSION1
> +#define DPBP_CMD_ID_OFFSET   4
> +
> +#define DPBP_CMD(id) (((id) << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
> +
> +/* Command IDs */
> +#define DPBP_CMDID_CLOSE DPBP_CMD(0x800)
> +#define DPBP_CMDID_OPEN  DPBP_CMD(0x804)
> +
> +#define DPBP_CMDID_ENABLEDPBP_CMD(0x002)
> +#define DPBP_CMDID_DISABLE   DPBP_CMD(0x003)
> +#define DPBP_CMDID_GET_ATTR  DPBP_CMD(0x004)
> +#define DPBP_CMDID_RESET DPBP_CMD(0x005)
> +
> +struct dpbp_cmd_open {
> + __le32 dpbp_id;
> +};
> +
> +#define DPBP_ENABLE  0x1
> +
> +struct dpbp_rsp_get_attributes {
> + /* response word 0 */
> + __le16 pad;
> + __le16 bpid;
> + __le32 id;
> + /* response word 1 */
> + __le16 version_major;
> + __le16 version_minor;
> +};
> +
>   /**
>* Maximum number of total IRQs that can be pre-allocated for an MC bus'
>* IRQ pool
> diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
> b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
> index e577410..ce864ee 100644
> --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
> +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
> @@ -35,10 +35,10 @@
>
>   #include 
>   #include 
> +#include 
>
>   #include "../../fsl-mc/include/dpaa2-io.h"
>   #include "../../fsl-mc/include/dpaa2-fd.h"
> -#include "../../fsl-mc/include/dpbp.h"
>   #include "../../fsl-mc/include/dpcon.h"
>   #include "dpni.h"
>   #include "dpni-cmd.h"
> diff --git a/drivers/staging/fsl-mc/bus/Makefile 
> b/drivers/staging/fsl-mc/bus/Makefile
> index b67889e..ea6479f 100644
> --- 

Re: [PATCH 3/5] staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.

2018-03-02 Thread Dan Carpenter
And no top posting on email threads...  So don't you forget it.  :P

regards,
dan carpenter
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/5] staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.

2018-03-02 Thread Dan Carpenter
There are so many rules for kernel developers to deal with.  Is it worse
to go over the 80 character limit or align the parameters properly?  Is
it OK to start the subject with a lower case letter?  I get in trouble
for using the wrong prefix but I'm the first person to patch a driver so
how on earth am I supposed to read into your @#$R@#$@#$@#$@ mind to see
what prefix you are going to want?

The imperitive thing is a good suggestion for people to think about but
it's not something that you should suggest to other people out of the
blue for no reason.  I've seen people do it for OPW and I'm like, "Eh...
I guess in that case maybe the intern will have to deal with some super
anal maintainer so they should know all the rules".  But generally,
unless the person asked you to tutor them about every single unpleasant
thing/maintainer they might have to deal then just let it be.  Otherwise
you risk becoming that unpleasant thing they have to deal with.

Don't lose track of the bigger picture which is "Can you understand the
changelog?"  There is no such thing as a perfect patch.  This patch has
a style violation which I overlooked because it just doesn't matter.

It's discouraging to be nagged at.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [staging:staging-testing 217/217] drivers/staging/nvec/nvec_power.c:361:10: warning: 'return' with a value, in function returning void

2018-03-02 Thread Greg Kroah-Hartman
On Fri, Mar 02, 2018 at 05:21:42AM +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
> staging-testing
> head:   501b9cb070bc35073f4195b58e74098a9d31375c
> commit: 501b9cb070bc35073f4195b58e74098a9d31375c [217/217] staging: nvec: add 
> error checking to nvec_event
> config: arm-multi_v7_defconfig (attached as .config)
> compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 501b9cb070bc35073f4195b58e74098a9d31375c
> # save the attached .config to linux build tree
> make.cross ARCH=arm 
> 
> All warnings (new ones prefixed by >>):
> 
>drivers/staging/nvec/nvec_power.c: In function 'nvec_power_poll':
> >> drivers/staging/nvec/nvec_power.c:361:10: warning: 'return' with a value, 
> >> in function returning void
>   return err;
>  ^~~
>drivers/staging/nvec/nvec_power.c:348:13: note: declared here
> static void nvec_power_poll(struct work_struct *work)
> ^~~

Thomas, I've now dropped this patch, please fix up and resend.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel