[PATCH] dh key: Missing a blank line after declarations
This patch fixes a "WARNING: Missing a blank line after declarations" issue found by checkpatch.pl Signed-off-by: Frank Werner-Krippendorf --- security/keys/dh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/security/keys/dh.c b/security/keys/dh.c index c4c629bb1c03..5515f51e62db 100644 --- a/security/keys/dh.c +++ b/security/keys/dh.c @@ -161,6 +161,7 @@ static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen, if (zlen && h) { u8 tmpbuffer[32]; size_t chunk = min_t(size_t, zlen, sizeof(tmpbuffer)); + memset(tmpbuffer, 0, chunk); do { -- 2.20.1
[PATCH] Do not assign in if condition wg_noise_handshake_consume_initiation()
Fixes an error condition reported by checkpatch.pl which caused by assigning a variable in an if condition in wg_noise_handshake_consume_initiation(). Signed-off-by: Frank Werner-Krippendorf --- drivers/net/wireguard/noise.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireguard/noise.c b/drivers/net/wireguard/noise.c index 626433690abb..9524a15a62a6 100644 --- a/drivers/net/wireguard/noise.c +++ b/drivers/net/wireguard/noise.c @@ -617,8 +617,9 @@ wg_noise_handshake_consume_initiation(struct message_handshake_initiation *src, memcpy(handshake->hash, hash, NOISE_HASH_LEN); memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN); handshake->remote_index = src->sender_index; + initiation_consumption = ktime_get_coarse_boottime_ns(); if ((s64)(handshake->last_initiation_consumption - - (initiation_consumption = ktime_get_coarse_boottime_ns())) < 0) + initiation_consumption) < 0) handshake->last_initiation_consumption = initiation_consumption; handshake->state = HANDSHAKE_CONSUMED_INITIATION; up_write(>lock); -- 2.20.1
[PATCH] Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"
Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix a coding style issue "Statements should start on a tabstop" detected by checkpatch.pl script. Signed-off-by: Frank Werner-Krippendorf --- drivers/staging/rtl8712/rtl871x_event.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_event.h b/drivers/staging/rtl8712/rtl871x_event.h index 5171379..2e59e8e 100644 --- a/drivers/staging/rtl8712/rtl871x_event.h +++ b/drivers/staging/rtl8712/rtl871x_event.h @@ -90,13 +90,13 @@ struct event_node { unsigned char *node; unsigned char evt_code; unsigned short evt_sz; - /*volatile*/ int *caller_ff_tail; + int *caller_ff_tail; int caller_ff_sz; }; struct c2hevent_queue { - /*volatile*/ inthead; - /*volatile*/ inttail; + int head; + int tail; struct event_node nodes[C2HEVENT_SZ]; unsigned char seq; }; @@ -104,8 +104,8 @@ struct c2hevent_queue { #define NETWORK_QUEUE_SZ 4 struct network_queue { - /*volatile*/ inthead; - /*volatile*/ inttail; + int head; + int tail; struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ]; }; -- 2.7.4
[PATCH] Staging:rtl8712: Style - Removed inline block comment to fix "Statements should start on a tapstop"
Removed 5 inline comments "/*volatile*/" rtl87x_event.h, to fix a coding style issue "Statements should start on a tabstop" detected by checkpatch.pl script. Signed-off-by: Frank Werner-Krippendorf --- drivers/staging/rtl8712/rtl871x_event.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_event.h b/drivers/staging/rtl8712/rtl871x_event.h index 5171379..2e59e8e 100644 --- a/drivers/staging/rtl8712/rtl871x_event.h +++ b/drivers/staging/rtl8712/rtl871x_event.h @@ -90,13 +90,13 @@ struct event_node { unsigned char *node; unsigned char evt_code; unsigned short evt_sz; - /*volatile*/ int *caller_ff_tail; + int *caller_ff_tail; int caller_ff_sz; }; struct c2hevent_queue { - /*volatile*/ inthead; - /*volatile*/ inttail; + int head; + int tail; struct event_node nodes[C2HEVENT_SZ]; unsigned char seq; }; @@ -104,8 +104,8 @@ struct c2hevent_queue { #define NETWORK_QUEUE_SZ 4 struct network_queue { - /*volatile*/ inthead; - /*volatile*/ inttail; + int head; + int tail; struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ]; }; -- 2.7.4
[PATCH] Staging: rtl8712: rtl871x: removed unused code, to fix a coding style issue
Fixed a coding style issue. Signed-off-by: Frank Werner-Krippendorf --- drivers/staging/rtl8712/rtl871x_event.h | 10 +- drivers/staging/rtl8712/rtl871x_io.h | 2 +- drivers/staging/rtl8712/rtl871x_pwrctrl.h | 10 +- drivers/staging/rtl8712/rtl871x_xmit.h| 14 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_event.h b/drivers/staging/rtl8712/rtl871x_event.h index 5171379..2e59e8e 100644 --- a/drivers/staging/rtl8712/rtl871x_event.h +++ b/drivers/staging/rtl8712/rtl871x_event.h @@ -90,13 +90,13 @@ struct event_node { unsigned char *node; unsigned char evt_code; unsigned short evt_sz; - /*volatile*/ int *caller_ff_tail; + int *caller_ff_tail; int caller_ff_sz; }; struct c2hevent_queue { - /*volatile*/ inthead; - /*volatile*/ inttail; + int head; + int tail; struct event_node nodes[C2HEVENT_SZ]; unsigned char seq; }; @@ -104,8 +104,8 @@ struct c2hevent_queue { #define NETWORK_QUEUE_SZ 4 struct network_queue { - /*volatile*/ inthead; - /*volatile*/ inttail; + int head; + int tail; struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ]; }; diff --git a/drivers/staging/rtl8712/rtl871x_io.h b/drivers/staging/rtl8712/rtl871x_io.h index dd054d7..61d9e41 100644 --- a/drivers/staging/rtl8712/rtl871x_io.h +++ b/drivers/staging/rtl8712/rtl871x_io.h @@ -113,7 +113,7 @@ struct _io_ops { struct io_req { struct list_head list; u32 addr; - /*volatile*/ u32val; + u32 val; u32 command; u32 status; u8 *pbuf; diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h b/drivers/staging/rtl8712/rtl871x_pwrctrl.h index bd2c3a2..6451beb 100644 --- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h +++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h @@ -89,14 +89,14 @@ struct reportpwrstate_parm { struct pwrctrl_priv { struct mutex mutex_lock; - /*volatile*/ u8 rpwm; /* requested power state for fw */ + u8 rpwm; /* requested power state for fw */ /* fw current power state. updated when 1. read from HCPWM or * 2. driver lowers power level */ - /*volatile*/ u8 cpwm; - /*volatile*/ u8 tog; /* toggling */ - /*volatile*/ u8 cpwm_tog; /* toggling */ - /*volatile*/ u8 tgt_rpwm; /* wanted power state */ + u8 cpwm; + u8 tog; /* toggling */ + u8 cpwm_tog; /* toggling */ + u8 tgt_rpwm; /* wanted power state */ uint pwr_mode; uint smart_ps; uint alives; diff --git a/drivers/staging/rtl8712/rtl871x_xmit.h b/drivers/staging/rtl8712/rtl871x_xmit.h index 4092727..aac0e14 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.h +++ b/drivers/staging/rtl8712/rtl871x_xmit.h @@ -160,8 +160,8 @@ struct xmit_frame { _pkt *pkt; int frame_tag; struct _adapter *padapter; -u8 *buf_addr; -struct xmit_buf *pxmitbuf; + u8 *buf_addr; + struct xmit_buf *pxmitbuf; u8 *mem_addr; u16 sz[8]; struct urb *pxmit_urb[8]; @@ -194,11 +194,11 @@ struct sta_xmit_priv { }; struct hw_txqueue { - /*volatile*/ sint head; - /*volatile*/ sint tail; - /*volatile*/ sint free_sz;/*in units of 64 bytes*/ - /*volatile*/ sint free_cmdsz; - /*volatile*/ sinttxsz[8]; + sinthead; + sinttail; + sintfree_sz;/*in units of 64 bytes*/ + sintfree_cmdsz; + sinttxsz[8]; uintff_hwaddr; uintcmd_hwaddr; sintac_tag; -- 2.7.4
[PATCH] Staging: rtl8712: rtl871x: removed unused code, to fix a coding style issue
Fixed a coding style issue. Signed-off-by: Frank Werner-Krippendorf --- drivers/staging/rtl8712/rtl871x_event.h | 10 +- drivers/staging/rtl8712/rtl871x_io.h | 2 +- drivers/staging/rtl8712/rtl871x_pwrctrl.h | 10 +- drivers/staging/rtl8712/rtl871x_xmit.h| 14 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_event.h b/drivers/staging/rtl8712/rtl871x_event.h index 5171379..2e59e8e 100644 --- a/drivers/staging/rtl8712/rtl871x_event.h +++ b/drivers/staging/rtl8712/rtl871x_event.h @@ -90,13 +90,13 @@ struct event_node { unsigned char *node; unsigned char evt_code; unsigned short evt_sz; - /*volatile*/ int *caller_ff_tail; + int *caller_ff_tail; int caller_ff_sz; }; struct c2hevent_queue { - /*volatile*/ inthead; - /*volatile*/ inttail; + int head; + int tail; struct event_node nodes[C2HEVENT_SZ]; unsigned char seq; }; @@ -104,8 +104,8 @@ struct c2hevent_queue { #define NETWORK_QUEUE_SZ 4 struct network_queue { - /*volatile*/ inthead; - /*volatile*/ inttail; + int head; + int tail; struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ]; }; diff --git a/drivers/staging/rtl8712/rtl871x_io.h b/drivers/staging/rtl8712/rtl871x_io.h index dd054d7..61d9e41 100644 --- a/drivers/staging/rtl8712/rtl871x_io.h +++ b/drivers/staging/rtl8712/rtl871x_io.h @@ -113,7 +113,7 @@ struct _io_ops { struct io_req { struct list_head list; u32 addr; - /*volatile*/ u32val; + u32 val; u32 command; u32 status; u8 *pbuf; diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h b/drivers/staging/rtl8712/rtl871x_pwrctrl.h index bd2c3a2..6451beb 100644 --- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h +++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h @@ -89,14 +89,14 @@ struct reportpwrstate_parm { struct pwrctrl_priv { struct mutex mutex_lock; - /*volatile*/ u8 rpwm; /* requested power state for fw */ + u8 rpwm; /* requested power state for fw */ /* fw current power state. updated when 1. read from HCPWM or * 2. driver lowers power level */ - /*volatile*/ u8 cpwm; - /*volatile*/ u8 tog; /* toggling */ - /*volatile*/ u8 cpwm_tog; /* toggling */ - /*volatile*/ u8 tgt_rpwm; /* wanted power state */ + u8 cpwm; + u8 tog; /* toggling */ + u8 cpwm_tog; /* toggling */ + u8 tgt_rpwm; /* wanted power state */ uint pwr_mode; uint smart_ps; uint alives; diff --git a/drivers/staging/rtl8712/rtl871x_xmit.h b/drivers/staging/rtl8712/rtl871x_xmit.h index 4092727..aac0e14 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.h +++ b/drivers/staging/rtl8712/rtl871x_xmit.h @@ -160,8 +160,8 @@ struct xmit_frame { _pkt *pkt; int frame_tag; struct _adapter *padapter; -u8 *buf_addr; -struct xmit_buf *pxmitbuf; + u8 *buf_addr; + struct xmit_buf *pxmitbuf; u8 *mem_addr; u16 sz[8]; struct urb *pxmit_urb[8]; @@ -194,11 +194,11 @@ struct sta_xmit_priv { }; struct hw_txqueue { - /*volatile*/ sint head; - /*volatile*/ sint tail; - /*volatile*/ sint free_sz;/*in units of 64 bytes*/ - /*volatile*/ sint free_cmdsz; - /*volatile*/ sinttxsz[8]; + sinthead; + sinttail; + sintfree_sz;/*in units of 64 bytes*/ + sintfree_cmdsz; + sinttxsz[8]; uintff_hwaddr; uintcmd_hwaddr; sintac_tag; -- 2.7.4