Skip to contentSkip to conversation

staging: rtl8712: fix coding style issues

PATCH In review Arushi Singhal 2 participants 8 messages Mar 3, 2018 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: rtl8712: fix coding style issues

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(-)
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#1 lore raw

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

Replace a mix of tabs and spaces indentation by tabs only.

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

---
 drivers/staging/rtl8712/drv_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/drv_types.h +1 -1
index ae79047..ede99e9 100644
@@ -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);
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#2 lore raw

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

In reply to Arushi Singhal

Delete/Add tabs and spaces to align the code to fix the checkpatch issue: "CHECK: Alignment should match open parenthesis".

---
 drivers/staging/rtl8712/mlme_linux.c | 2 +-
 drivers/staging/rtl8712/os_intfs.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/mlme_linux.c +1 -1
index 3c7c4a4..baaa52f 100644
@@ -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(&adapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
drivers/staging/rtl8712/os_intfs.c +1 -1
index e7df5d7..d6d27da 100644
@@ -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;
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#3 lore raw

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

In reply to Arushi Singhal

Remove extra blank line(s) to conform to the Linux kernel coding style. Issue found using checkpatch.

---
 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(-)
drivers/staging/rtl8712/os_intfs.c +0 -1
index d6d27da..ff4e451 100644
@@ -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:
drivers/staging/rtl8712/rtl8712_bitdef.h +0 -1
index bff57a8..dee35fe 100644
@@ -18,7 +18,6 @@
  *
  ******************************************************************************/
 
-
 #ifndef __RTL8712_BITDEF_H__
 #define __RTL8712_BITDEF_H__
 
drivers/staging/rtl8712/rtl8712_cmdctrl_regdef.h +0 -2
index 9374f1c..8df42a7 100644
@@ -20,7 +20,6 @@
 #ifndef __RTL8712_CMDCTRL_REGDEF_H__
 #define __RTL8712_CMDCTRL_REGDEF_H__
 
-
 #define CR			(RTL8712_CMDCTRL_ + 0x0000)
 #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__ */
 
drivers/staging/rtl8712/rtl8712_debugctrl_bitdef.h +0 -1
index 8bd4837..4b34367 100644
@@ -51,5 +51,4 @@
 /*FDLOCKFLAG1*/
 #define	_LOCKFLAG1_MSK		0x03
 
-
 #endif /* __RTL8712_DEBUGCTRL_BITDEF_H__ */
drivers/staging/rtl8712/rtl8712_debugctrl_regdef.h +0 -2
index 43630bb..d7c964d 100644
@@ -41,7 +41,5 @@
 #define TRXPKTBUF_DBG_CTRL	(RTL8712_DEBUGCTRL_ + 0x38)
 #define DPLL_MON		(RTL8712_DEBUGCTRL_ + 0x3A)
 
-
-
 #endif /* __RTL8712_DEBUGCTRL_REGDEF_H__ */
 
drivers/staging/rtl8712/rtl8712_fifoctrl_bitdef.h +0 -1
index c564dc8..bd82404 100644
@@ -140,6 +140,5 @@
 /*TXFF_PG_NUM*/
 #define	_TXFF_PG_NUM_MSK	0x0FFF
 
-
 #endif	/*	__RTL8712_FIFOCTRL_BITDEF_H__ */
 
drivers/staging/rtl8712/rtl8712_fifoctrl_regdef.h +0 -2
index 29b89c4..6d52738 100644
@@ -71,6 +71,4 @@
 #define TXQ_PGADD		(RTL8712_FIFOCTRL_ + 0xB3)
 #define TXFF_PG_NUM		(RTL8712_FIFOCTRL_ + 0xB4)
 
-
-
 #endif	/* __RTL8712_FIFOCTRL_REGDEF_H__ */
drivers/staging/rtl8712/rtl8712_gp_regdef.h +0 -1
index 8fc68f6..a037936 100644
@@ -37,6 +37,5 @@
 #define PHY_REG_RPT		(RTL8712_GP_ + 0x13)
 #define PHY_REG_DATA		(RTL8712_GP_ + 0x14)
 
-
 #endif	/*__RTL8712_GP_REGDEF_H__ */
 
drivers/staging/rtl8712/rtl8712_interrupt_bitdef.h +0 -1
index 49598c3..2a561d2 100644
@@ -53,6 +53,5 @@
 #define	_VODOK					BIT(1)
 #define	_RXOK					BIT(0)
 
-
 #endif	/*__RTL8712_INTERRUPT_BITDEF_H__*/
 
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#4 lore raw

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

In reply to Arushi Singhal

Add spaces around arithmetic operator '+', to conform to the Linux kernel coding style. Issue found using checkpatch.

---
 drivers/staging/rtl8712/rtl8712_cmd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/rtl8712_cmd.h +2 -2
index 67e9e91..9181bb6 100644
@@ -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_callback	cmd_callback[] = {
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#5 lore raw

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

In reply to Arushi Singhal

Add spaces around '|' to conform to the Linux kernel coding style. Issue found using checkpatch.
CHECK: spaces preferred around that '|'.

---
 drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h | 2 +-
 drivers/staging/rtl8712/rtl8712_gp_bitdef.h      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/rtl8712_cmdctrl_bitdef.h +1 -1
index b7dda90..4b8985d 100644
@@ -63,7 +63,7 @@
 #define _IMEM_CHK_RPT			BIT(1)
 #define _IMEM_CODE_DONE			BIT(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)
drivers/staging/rtl8712/rtl8712_gp_bitdef.h +1 -1
index 44c9060..66c35c9 100644
@@ -70,7 +70,7 @@
 #define		GPIOSEL_PHYDBG	1	/* PHYDBG*/
 #define		GPIOSEL_BT	2	/* BT_coex*/
 #define		GPIOSEL_WLANDBG	3	/* WLANDBG*/
-#define		GPIOSEL_GPIO_MASK	(~(BIT(0)|BIT(1)))
+#define		GPIOSEL_GPIO_MASK	(~(BIT(0) | BIT(1)))
 /* HW Radio OFF switch (GPIO BIT) */
 #define		HAL_8192S_HW_GPIO_OFF_BIT	BIT(3)
 #define		HAL_8192S_HW_GPIO_OFF_MASK	0xF7
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#6 lore raw

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

In reply to Arushi Singhal

Remove unnecessary parentheses around variables to conform to the Linux kernel coding style. Issue found using checkpatch.

---
 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(-)
drivers/staging/rtl8712/recv_linux.c +2 -2
index 986a55b..8cf4286 100644
@@ -111,8 +111,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
 	_pkt *skb;
 	struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
 
-	precvpriv = &(padapter->recvpriv);
-	pfree_recv_queue = &(precvpriv->free_recv_queue);
+	precvpriv = &padapter->recvpriv;
+	pfree_recv_queue = &precvpriv->free_recv_queue;
 	skb = precv_frame->u.hdr.pkt;
 	if (!skb)
 		goto _recv_indicatepkt_drop;
drivers/staging/rtl8712/rtl8712_cmd.c +4 -4
index 9c8e0c5..b1dfe9f 100644
@@ -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 = &padapter->cmdpriv;
 	struct completion *cmd_queue_comp =
 		&pcmdpriv->cmd_queue_comp;
 	struct mutex *pwctrl_lock = &padapter->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(&pcmdpriv->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(&pcmdpriv->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 = &padapter->evtpriv;
 
 	if (!peventbuf)
 		goto _abort_event_;
drivers/staging/rtl8712/rtl8712_led.c +35 -35

175 lines not on this page · raw message

Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Acked-by on the v2 series
#7 lore raw
In reply to Arushi Singhal
Quoted 2 lines · Arushi Singhal

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

For the series:

Quoted 42 lines

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 [email protected].
To post to this group, send email to [email protected].
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.