* [PATCH 0/2] staging: rtl8712: rewrite comparisons and remove blank lines
@ 2021-04-06 10:50 Zhansaya Bagdauletkyzy
2021-04-06 10:50 ` [PATCH 1/2] staging: rtl8712: Rewrite NULL comparisons Zhansaya Bagdauletkyzy
2021-04-06 10:50 ` [PATCH 2/2] staging: rtl8712: Remove extra blank lines Zhansaya Bagdauletkyzy
0 siblings, 2 replies; 5+ messages in thread
From: Zhansaya Bagdauletkyzy @ 2021-04-06 10:50 UTC (permalink / raw)
To: Larry.Finger, florian.c.schilhabel, gregkh
Cc: linux-staging, linux-kernel, outreachy-kernel
This patchset replaces NULL comparisons with boolean negation and
removes extra blank lines after an open brace.
Zhansaya Bagdauletkyzy (2):
staging: rtl8712: Rewrite NULL comparisons
staging: rtl8712: Remove extra blank lines
drivers/staging/rtl8712/rtl871x_io.h | 1 -
drivers/staging/rtl8712/rtl871x_mlme.h | 1 -
drivers/staging/rtl8712/rtl871x_recv.h | 11 +++++------
drivers/staging/rtl8712/sta_info.h | 1 -
4 files changed, 5 insertions(+), 9 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] staging: rtl8712: Rewrite NULL comparisons
2021-04-06 10:50 [PATCH 0/2] staging: rtl8712: rewrite comparisons and remove blank lines Zhansaya Bagdauletkyzy
@ 2021-04-06 10:50 ` Zhansaya Bagdauletkyzy
2021-04-06 10:58 ` [Outreachy kernel] " Julia Lawall
2021-04-06 10:50 ` [PATCH 2/2] staging: rtl8712: Remove extra blank lines Zhansaya Bagdauletkyzy
1 sibling, 1 reply; 5+ messages in thread
From: Zhansaya Bagdauletkyzy @ 2021-04-06 10:50 UTC (permalink / raw)
To: Larry.Finger, florian.c.schilhabel, gregkh
Cc: linux-staging, linux-kernel, outreachy-kernel
Replace NULL comparisons with boolean negation.
Reported by checkpatch.
Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
---
drivers/staging/rtl8712/rtl871x_recv.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl871x_recv.h b/drivers/staging/rtl8712/rtl871x_recv.h
index 7c9995060a6f..4aa39f4f3b84 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.h
+++ b/drivers/staging/rtl8712/rtl871x_recv.h
@@ -135,7 +135,7 @@ int recv_func(struct _adapter *padapter, void *pcontext);
static inline u8 *get_rxmem(union recv_frame *precvframe)
{
/* always return rx_head... */
- if (precvframe == NULL)
+ if (!precvframe)
return NULL;
return precvframe->u.hdr.rx_head;
}
@@ -143,7 +143,7 @@ static inline u8 *get_rxmem(union recv_frame *precvframe)
static inline u8 *get_recvframe_data(union recv_frame *precvframe)
{
/* always return rx_data */
- if (precvframe == NULL)
+ if (!precvframe)
return NULL;
return precvframe->u.hdr.rx_data;
}
@@ -153,7 +153,7 @@ static inline u8 *recvframe_pull(union recv_frame *precvframe, sint sz)
/* used for extract sz bytes from rx_data, update rx_data and return
* the updated rx_data to the caller
*/
- if (precvframe == NULL)
+ if (!precvframe)
return NULL;
precvframe->u.hdr.rx_data += sz;
if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) {
@@ -170,7 +170,7 @@ static inline u8 *recvframe_put(union recv_frame *precvframe, sint sz)
* return the updated rx_tail to the caller
* after putting, rx_tail must be still larger than rx_end.
*/
- if (precvframe == NULL)
+ if (!precvframe)
return NULL;
precvframe->u.hdr.rx_tail += sz;
if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) {
@@ -188,7 +188,7 @@ static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz)
* updated rx_end to the caller
* after pulling, rx_end must be still larger than rx_data.
*/
- if (precvframe == NULL)
+ if (!precvframe)
return NULL;
precvframe->u.hdr.rx_tail -= sz;
if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH 1/2] staging: rtl8712: Rewrite NULL comparisons
2021-04-06 10:50 ` [PATCH 1/2] staging: rtl8712: Rewrite NULL comparisons Zhansaya Bagdauletkyzy
@ 2021-04-06 10:58 ` Julia Lawall
0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2021-04-06 10:58 UTC (permalink / raw)
To: Zhansaya Bagdauletkyzy
Cc: Larry.Finger, florian.c.schilhabel, gregkh, linux-staging,
linux-kernel, outreachy-kernel
On Tue, 6 Apr 2021, Zhansaya Bagdauletkyzy wrote:
> Replace NULL comparisons with boolean negation.
This summarizes concisely what you did, which is helpful, but you could
also say why. For example, to make the code more concise or to improve
readability or for consistency with the rest of the code base.
julia
> Reported by checkpatch.
>
> Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
> ---
> drivers/staging/rtl8712/rtl871x_recv.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/rtl871x_recv.h b/drivers/staging/rtl8712/rtl871x_recv.h
> index 7c9995060a6f..4aa39f4f3b84 100644
> --- a/drivers/staging/rtl8712/rtl871x_recv.h
> +++ b/drivers/staging/rtl8712/rtl871x_recv.h
> @@ -135,7 +135,7 @@ int recv_func(struct _adapter *padapter, void *pcontext);
> static inline u8 *get_rxmem(union recv_frame *precvframe)
> {
> /* always return rx_head... */
> - if (precvframe == NULL)
> + if (!precvframe)
> return NULL;
> return precvframe->u.hdr.rx_head;
> }
> @@ -143,7 +143,7 @@ static inline u8 *get_rxmem(union recv_frame *precvframe)
> static inline u8 *get_recvframe_data(union recv_frame *precvframe)
> {
> /* always return rx_data */
> - if (precvframe == NULL)
> + if (!precvframe)
> return NULL;
> return precvframe->u.hdr.rx_data;
> }
> @@ -153,7 +153,7 @@ static inline u8 *recvframe_pull(union recv_frame *precvframe, sint sz)
> /* used for extract sz bytes from rx_data, update rx_data and return
> * the updated rx_data to the caller
> */
> - if (precvframe == NULL)
> + if (!precvframe)
> return NULL;
> precvframe->u.hdr.rx_data += sz;
> if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) {
> @@ -170,7 +170,7 @@ static inline u8 *recvframe_put(union recv_frame *precvframe, sint sz)
> * return the updated rx_tail to the caller
> * after putting, rx_tail must be still larger than rx_end.
> */
> - if (precvframe == NULL)
> + if (!precvframe)
> return NULL;
> precvframe->u.hdr.rx_tail += sz;
> if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) {
> @@ -188,7 +188,7 @@ static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz)
> * updated rx_end to the caller
> * after pulling, rx_end must be still larger than rx_data.
> */
> - if (precvframe == NULL)
> + if (!precvframe)
> return NULL;
> precvframe->u.hdr.rx_tail -= sz;
> if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {
> --
> 2.25.1
>
> --
> 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+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/5d2db1d233030ececcdd4934ca9c46cb998c0c5b.1617705825.git.zhansayabagdaulet%40gmail.com.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] staging: rtl8712: Remove extra blank lines
2021-04-06 10:50 [PATCH 0/2] staging: rtl8712: rewrite comparisons and remove blank lines Zhansaya Bagdauletkyzy
2021-04-06 10:50 ` [PATCH 1/2] staging: rtl8712: Rewrite NULL comparisons Zhansaya Bagdauletkyzy
@ 2021-04-06 10:50 ` Zhansaya Bagdauletkyzy
1 sibling, 0 replies; 5+ messages in thread
From: Zhansaya Bagdauletkyzy @ 2021-04-06 10:50 UTC (permalink / raw)
To: Larry.Finger, florian.c.schilhabel, gregkh
Cc: linux-staging, linux-kernel, outreachy-kernel
Remove extra blank lines after an open brace to adhere to Linux kernel
coding style.
Reported by checkpatch.
Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
---
drivers/staging/rtl8712/rtl871x_io.h | 1 -
drivers/staging/rtl8712/rtl871x_mlme.h | 1 -
drivers/staging/rtl8712/rtl871x_recv.h | 1 -
drivers/staging/rtl8712/sta_info.h | 1 -
4 files changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl871x_io.h b/drivers/staging/rtl8712/rtl871x_io.h
index c20dd5a6bbd1..c5b12f74ebf8 100644
--- a/drivers/staging/rtl8712/rtl871x_io.h
+++ b/drivers/staging/rtl8712/rtl871x_io.h
@@ -123,7 +123,6 @@ struct intf_hdl {
};
struct reg_protocol_rd {
-
#ifdef __LITTLE_ENDIAN
/* DW1 */
u32 NumOfTrans:4;
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.h b/drivers/staging/rtl8712/rtl871x_mlme.h
index 46effb469fd4..d7d25f240111 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.h
+++ b/drivers/staging/rtl8712/rtl871x_mlme.h
@@ -77,7 +77,6 @@ struct sitesurvey_ctrl {
};
struct mlme_priv {
-
spinlock_t lock;
spinlock_t lock2;
sint fw_state; /*shall we protect this variable? */
diff --git a/drivers/staging/rtl8712/rtl871x_recv.h b/drivers/staging/rtl8712/rtl871x_recv.h
index 4aa39f4f3b84..1c8298bde033 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.h
+++ b/drivers/staging/rtl8712/rtl871x_recv.h
@@ -37,7 +37,6 @@ struct smooth_rssi_data {
};
struct rx_pkt_attrib {
-
u8 amsdu;
u8 order;
u8 qos;
diff --git a/drivers/staging/rtl8712/sta_info.h b/drivers/staging/rtl8712/sta_info.h
index d042d900f30c..9b7e5ffa380d 100644
--- a/drivers/staging/rtl8712/sta_info.h
+++ b/drivers/staging/rtl8712/sta_info.h
@@ -36,7 +36,6 @@ struct wlan_acl_pool {
};
struct stainfo_stats {
-
uint rx_pkts;
uint rx_bytes;
u64 tx_pkts;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 0/2] staging: rtl8712: add blank lines after declarations and remove extra blank lines
@ 2021-04-04 20:51 Zhansaya Bagdauletkyzy
2021-04-04 20:51 ` [PATCH 2/2] staging: rtl8712: " Zhansaya Bagdauletkyzy
0 siblings, 1 reply; 5+ messages in thread
From: Zhansaya Bagdauletkyzy @ 2021-04-04 20:51 UTC (permalink / raw)
To: Larry.Finger, florian.c.schilhabel, gregkh
Cc: linux-staging, linux-kernel, outreachy-kernel
This patchset adds blank lines after function/struct/union/enum declarations and removes extra blank lines.
Reported by checkpatch.
Zhansaya Bagdauletkyzy (2):
staging: rtl8712: add blank lines after declarations
staging: rtl8712: remove extra blank lines
drivers/staging/rtl8712/rtl8712_recv.h | 2 +-
drivers/staging/rtl8712/rtl871x_cmd.h | 10 ++++++++++
drivers/staging/rtl8712/rtl871x_event.h | 1 +
drivers/staging/rtl8712/rtl871x_mlme.c | 3 ---
drivers/staging/rtl8712/rtl871x_mp.c | 1 +
drivers/staging/rtl8712/rtl871x_mp.h | 1 +
drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 3 +++
drivers/staging/rtl8712/rtl871x_pwrctrl.h | 3 ---
drivers/staging/rtl8712/rtl871x_recv.c | 1 +
drivers/staging/rtl8712/rtl871x_recv.h | 1 -
10 files changed, 18 insertions(+), 8 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] staging: rtl8712: remove extra blank lines
2021-04-04 20:51 [PATCH 0/2] staging: rtl8712: add blank lines after declarations and remove " Zhansaya Bagdauletkyzy
@ 2021-04-04 20:51 ` Zhansaya Bagdauletkyzy
0 siblings, 0 replies; 5+ messages in thread
From: Zhansaya Bagdauletkyzy @ 2021-04-04 20:51 UTC (permalink / raw)
To: Larry.Finger, florian.c.schilhabel, gregkh
Cc: linux-staging, linux-kernel, outreachy-kernel
Remove extra blank lines to adhere to Linux kernel coding style.
Reported by checkpatch.
Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
---
drivers/staging/rtl8712/rtl8712_recv.h | 1 -
drivers/staging/rtl8712/rtl871x_mlme.c | 3 ---
drivers/staging/rtl8712/rtl871x_pwrctrl.h | 3 ---
drivers/staging/rtl8712/rtl871x_recv.h | 1 -
4 files changed, 8 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl8712_recv.h b/drivers/staging/rtl8712/rtl8712_recv.h
index c70b37ff554e..f4d20b0efd4e 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.h
+++ b/drivers/staging/rtl8712/rtl8712_recv.h
@@ -85,7 +85,6 @@ union recvstat {
unsigned int value[RXDESC_SIZE>>2];
};
-
struct recv_buf {
struct list_head list;
spinlock_t recvbuf_lock;
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index f5886b39b3b5..8a97307fbbd6 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -124,7 +124,6 @@ static void free_network_nolock(struct mlme_priv *pmlmepriv,
pmlmepriv->num_of_scanned--;
}
-
/* return the wlan_network with the matching addr
* Shall be called under atomic context...
* to avoid possible racing condition...
@@ -358,7 +357,6 @@ static void update_scanned_network(struct _adapter *adapter,
plist = plist->next;
}
-
/* If we didn't find a match, then get a new network slot to initialize
* with this beacon's information
*/
@@ -621,7 +619,6 @@ void r8712_indicate_connect(struct _adapter *padapter)
jiffies + msecs_to_jiffies(60000));
}
-
/*
* r8712_ind_disconnect: the caller has to lock pmlmepriv->lock
*/
diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
index dd5a79f90b1a..bf6623cfaf27 100644
--- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h
+++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
@@ -17,7 +17,6 @@
#include "osdep_service.h"
#include "drv_types.h"
-
#define CMD_ALIVE BIT(2)
enum Power_Mgnt {
@@ -63,12 +62,10 @@ enum Power_Mgnt {
#define PS_STATE_S3 (PS_ALL_ON)
#define PS_STATE_S4 ((PS_ST_ACTIVE) | (PS_ALL_ON))
-
#define PS_IS_RF_ON(x) ((x) & (PS_ALL_ON))
#define PS_IS_ACTIVE(x) ((x) & (PS_ST_ACTIVE))
#define CLR_PS_STATE(x) ((x) = ((x) & (0xF0)))
-
struct reportpwrstate_parm {
unsigned char mode;
unsigned char state; /* the CPWM value */
diff --git a/drivers/staging/rtl8712/rtl871x_recv.h b/drivers/staging/rtl8712/rtl871x_recv.h
index e83c256e1474..7c9995060a6f 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.h
+++ b/drivers/staging/rtl8712/rtl871x_recv.h
@@ -29,7 +29,6 @@ struct stainfo_rxcache {
#define PHY_RSSI_SLID_WIN_MAX 100
#define PHY_LINKQUALITY_SLID_WIN_MAX 20
-
struct smooth_rssi_data {
u32 elements[100]; /* array to store values */
u32 index; /* index to current array to store */
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-04-06 10:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 10:50 [PATCH 0/2] staging: rtl8712: rewrite comparisons and remove blank lines Zhansaya Bagdauletkyzy
2021-04-06 10:50 ` [PATCH 1/2] staging: rtl8712: Rewrite NULL comparisons Zhansaya Bagdauletkyzy
2021-04-06 10:58 ` [Outreachy kernel] " Julia Lawall
2021-04-06 10:50 ` [PATCH 2/2] staging: rtl8712: Remove extra blank lines Zhansaya Bagdauletkyzy
-- strict thread matches above, loose matches on Subject: below --
2021-04-04 20:51 [PATCH 0/2] staging: rtl8712: add blank lines after declarations and remove " Zhansaya Bagdauletkyzy
2021-04-04 20:51 ` [PATCH 2/2] staging: rtl8712: " Zhansaya Bagdauletkyzy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).