multiple checkpatch issues
cover multiple checkpatch issues
Improve readability by fixing multiple checkpatch.pl issues.
Arushi Singhal (6):
staging: speakup: fixes braces {} should be used on all arms of this statement
staging: speakup: Avoid multiple assignments on same line
staging: speakup: identation should use tabs
staging: wilc1000: Alignment should match open parenthesis
staging: wilc1000: function prototype argument should have identifier name
staging: wilc1000: Logical continuations should be on the previous line
drivers/staging/speakup/main.c | 6 +++-- drivers/staging/speakup/speakup_decext.c | 6 ++--- drivers/staging/speakup/speakup_decpc.c | 10 ++++---- drivers/staging/speakup/speakup_dectlk.c | 6 ++--- drivers/staging/speakup/varhandlers.c | 12 ++++++---- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/wilc_spi.c | 6 ++--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 28 +++++++++++------------ drivers/staging/wilc1000/wilc_wlan.c | 10 ++++---- drivers/staging/wilc1000/wilc_wlan.h | 6 ++--- 10 files changed, 48 insertions(+), 44 deletions(-)
Signature · 1 line
2.11.0
PATCH 4/6 staging: wilc1000: Alignment should match open parenthesis
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".
--- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/wilc_spi.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 16 ++++++++-------- drivers/staging/wilc1000/wilc_wlan.c | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-)
drivers/staging/wilc1000/host_interface.c +1 -1
@@ -1350,7 +1350,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,if (u32RcvdAssocRespInfoLen !=0 ) { s32Err =wilc_parse_assoc_resp_info (rcv_assoc_resp, u32RcvdAssocRespInfoLen, - &pstrConnectRespInfo); + &pstrConnectRespInfo);if (s32Err) {netdev_err (vif->ndev,"wilc_parse_assoc_resp_info() returned error %d\n" , s32Err); }else {
drivers/staging/wilc1000/wilc_spi.c +1 -1
@@ -410,7 +410,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,if (len2 >ARRAY_SIZE (wb)) {dev_err (&spi->dev,"spi buffer size too small (%d) (%zu)\n" , - len2,ARRAY_SIZE (wb)); + len2,ARRAY_SIZE (wb));return N_FAIL ; }/* zero spi write buffers. */
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +8 -8
@@ -1301,16 +1301,16 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev,for (i =0 ; i < priv->pmkid_list.numpmkid; i++) {if (!memcmp (pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid, -ETH_ALEN )) { +ETH_ALEN )) { flag =PMKID_FOUND ;break ; } }if (i <WILC_MAX_NUM_PMKIDS ) {memcpy (priv->pmkid_list.pmkidlist[i].bssid, pmksa->bssid, -ETH_ALEN ); +ETH_ALEN );memcpy (priv->pmkid_list.pmkidlist[i].pmkid, pmksa->pmkid, -PMKID_LEN ); +PMKID_LEN );if (!(flag ==PMKID_FOUND )) priv->pmkid_list.numpmkid++; }else {
@@ -1334,7 +1334,7 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,for (i =0 ; i < priv->pmkid_list.numpmkid; i++) {if (!memcmp (pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid, -ETH_ALEN )) { +ETH_ALEN )) {memset (&priv->pmkid_list.pmkidlist[i],0 ,sizeof (struct host_if_pmkid ));break ; }
@@ -1343,11 +1343,11 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,if (i < priv->pmkid_list.numpmkid && priv->pmkid_list.numpmkid >0 ) {for (; i < (priv->pmkid_list.numpmkid -1 ); i++) {memcpy (priv->pmkid_list.pmkidlist[i].bssid, - priv->pmkid_list.pmkidlist[i +1 ].bssid, -ETH_ALEN ); + priv->pmkid_list.pmkidlist[i +1 ].bssid, +ETH_ALEN );memcpy (priv->pmkid_list.pmkidlist[i].pmkid, - priv->pmkid_list.pmkidlist[i].pmkid, -PMKID_LEN ); + priv->pmkid_list.pmkidlist[i].pmkid, +PMKID_LEN ); } priv->pmkid_list.numpmkid--; }else {
drivers/staging/wilc1000/wilc_wlan.c +5 -5
@@ -287,7 +287,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)while (dropped >0 ) {wait_for_completion_timeout (&wilc->txq_event, -msecs_to_jiffies (1 )); +msecs_to_jiffies (1 )); dropped--; }
@@ -810,9 +810,9 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)if (!is_cfg_packet) {if (pkt_len >0 ) {wilc_frmw_to_linux (wilc, - &buffer[offset], - pkt_len, - pkt_offset); + &buffer[offset], + pkt_len, + pkt_offset); } }else {struct wilc_cfg_rsp rsp;
@@ -1226,7 +1226,7 @@ int wilc_wlan_cfg_set(struct wilc_vif *vif, int start, u16 wid, u8 *buffer, ret_size =0 ;if (!wait_for_completion_timeout (&wilc->cfg_event, -msecs_to_jiffies (CFG_PKTS_TIMEOUT ))) { +msecs_to_jiffies (CFG_PKTS_TIMEOUT ))) {netdev_dbg (vif->ndev,"Set Timed Out\n" ); ret_size =0 ; }
Signature · 1 line
2.11.0
PATCH 5/6 staging: wilc1000: function prototype argument should have identifier name
In reply to Arushi Singhalfunction prototype argument should have an identifier name as reported by checkpatch.pl.
--- drivers/staging/wilc1000/wilc_wlan.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/wilc_wlan.h +3 -3
@@ -274,8 +274,8 @@ struct wilc_vif;int wilc_wlan_firmware_download (struct wilc *wilc,const u8 *buffer,u32 buffer_size); -int wilc_wlan_start (struct wilc *); -int wilc_wlan_stop (struct wilc *); +int wilc_wlan_start (struct wilc *wilc); +int wilc_wlan_stop (struct wilc *wilc);int wilc_wlan_txq_add_net_pkt (struct net_device *dev,void *priv,u8 *buffer,u32 buffer_size,wilc_tx_complete_func_t func);int wilc_wlan_handle_txq (struct net_device *dev,u32 *txq_count);
@@ -291,7 +291,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,void wilc_chip_sleep_manually (struct wilc *wilc);void wilc_enable_tcp_ack_filter (bool value); -int wilc_wlan_get_num_conn_ifcs (struct wilc *); +int wilc_wlan_get_num_conn_ifcs (struct wilc *wilc);int wilc_mac_xmit (struct sk_buff *skb,struct net_device *dev);void WILC_WFI_p2p_rx (struct net_device *dev,u8 *buff,u32 size);
Signature · 1 line
2.11.0
PATCH 1/6 staging: speakup: fixes braces {} should be used on all arms of this statement
In reply to Arushi SinghalThis patch fixes the checks reported by checkpatch.pl for braces {} should be used on all arms of this statement.
--- drivers/staging/speakup/main.c | 3 ++- drivers/staging/speakup/speakup_decext.c | 6 +++--- drivers/staging/speakup/speakup_decpc.c | 6 +++--- drivers/staging/speakup/speakup_dectlk.c | 6 +++--- drivers/staging/speakup/varhandlers.c | 12 +++++++----- 5 files changed, 18 insertions(+), 15 deletions(-)
drivers/staging/speakup/main.c +2 -1
@@ -408,8 +408,9 @@ static void say_attributes(struct vc_data *vc)if (bg >7 ) {synth_printf (" %s " ,spk_msg_get (MSG_ON_BLINKING )); bg -=8 ; - }else + }else {synth_printf (" %s " ,spk_msg_get (MSG_ON )); + }synth_printf ("%s\n" ,spk_msg_get (MSG_COLORS_START + bg)); }
drivers/staging/speakup/speakup_decext.c +3 -3
@@ -193,11 +193,11 @@ static void do_catch_up(struct spk_synth *synth)spin_lock_irqsave (&speakup_info.spinlock, flags);synth_buffer_getc ();spin_unlock_irqrestore (&speakup_info.spinlock, flags); -if (ch =='[' ) +if (ch =='[' ) { in_escape =1 ; -else if (ch ==']' ) + }else if (ch ==']' ) { in_escape =0 ; -else if (ch <=SPACE ) { + }else if (ch <=SPACE ) {if (!in_escape &&strchr (",.!?;:" , last))spk_serial_out (PROCSPEECH );if (time_after_eq (jiffies, jiff_max)) {
drivers/staging/speakup/speakup_decpc.c +3 -3
@@ -410,11 +410,11 @@ static void do_catch_up(struct spk_synth *synth)spin_lock_irqsave (&speakup_info.spinlock, flags);synth_buffer_getc ();spin_unlock_irqrestore (&speakup_info.spinlock, flags); -if (ch =='[' ) +if (ch =='[' ) { in_escape =1 ; -else if (ch ==']' ) + }else if (ch ==']' ) { in_escape =0 ; -else if (ch <=SPACE ) { + }else if (ch <=SPACE ) {if (!in_escape &&strchr (",.!?;:" , last))dt_sendchar (PROCSPEECH );if (time_after_eq (jiffies, jiff_max)) {
drivers/staging/speakup/speakup_dectlk.c +3 -3
@@ -258,11 +258,11 @@ static void do_catch_up(struct spk_synth *synth)spin_lock_irqsave (&speakup_info.spinlock, flags);synth_buffer_getc ();spin_unlock_irqrestore (&speakup_info.spinlock, flags); -if (ch =='[' ) +if (ch =='[' ) { in_escape =1 ; -else if (ch ==']' ) + }else if (ch ==']' ) { in_escape =0 ; -else if (ch <=SPACE ) { + }else if (ch <=SPACE ) {if (!in_escape &&strchr (",.!?;:" , last))spk_serial_out (PROCSPEECH );if (time_after_eq (jiffies, jiff_max)) {
drivers/staging/speakup/varhandlers.c +7 -5
@@ -258,10 +258,11 @@ int spk_set_string_var(const char *page, struct st_var_header *var, int len)if (var->p_val != var_data->u.s.default_val)strcpy ((char *)var->p_val, var_data->u.s.default_val);return -ERESTART ; - }else if (var->p_val) + }else if (var->p_val) {strcpy ((char *)var->p_val, page); -else + }else {return -E2BIG ; + }return 0 ; }
@@ -281,17 +282,18 @@ int spk_set_mask_bits(const char *input, const int which, const int how) spk_chartab[*cp] &= ~mask; } cp = (u_char *)input; -if (!cp) +if (!cp) { cp = spk_punc_info[which].value; -else { + }else {for (; *cp; cp++) {if (*cp <SPACE )break ;if (mask <PUNC ) {if (!(spk_chartab[*cp] &PUNC ))break ; - }else if (spk_chartab[*cp] &B_NUM ) + }else if (spk_chartab[*cp] &B_NUM ) {break ; + } }if (*cp)return -EINVAL ;
Signature · 1 line
2.11.0
PATCH 2/6 staging: speakup: Avoid multiple assignments on same line
In reply to Arushi SinghalThis patch fixes the checkpatch.pl warning "multiple assignments should be avoided."
--- drivers/staging/speakup/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/speakup/main.c +2 -1
@@ -2091,7 +2091,8 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, spk_keydown =0 ; goto out; } - value = spk_lastkey = pad_chars[value]; + value = pad_chars[value]; + spk_lastkey = value; spk_keydown++; spk_parked &=0xfe ; goto no_map;
Signature · 1 line
2.11.0
PATCH 3/6 staging: speakup: identation should use tabs
In reply to Arushi SinghalIndentation should always use tabs and never spaces.
--- drivers/staging/speakup/speakup_decpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/speakup/speakup_decpc.c +2 -2
@@ -85,8 +85,8 @@#define CTRL_io_priority 0x0c00/* change i/o priority */ #define CTRL_free_mem 0x0d00/* get free paragraphs on module */ #define CTRL_get_lang 0x0e00/* return bit mask of loaded -* languages -*/ +* languages +*/ #define CMD_test 0x2000/* self-test request */ #define TEST_mask 0x0F00/* isolate test field */ #define TEST_null 0x0000/* no test requested */
Signature · 1 line
2.11.0
PATCH 6/6 staging: wilc1000: Logical continuations should be on the previous line
In reply to Arushi SinghalThis patch fixes the checkpatch issue:
CHECK: Logical continuations should be on the previous line.
--- drivers/staging/wilc1000/wilc_spi.c | 4 ++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/wilc1000/wilc_spi.c +2 -2
@@ -454,8 +454,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,return N_FAIL ; } -if ((cmd ==CMD_INTERNAL_READ ) || (cmd ==CMD_SINGLE_READ ) - || (cmd ==CMD_DMA_READ ) || (cmd ==CMD_DMA_EXT_READ )) { +if ((cmd ==CMD_INTERNAL_READ ) || (cmd ==CMD_SINGLE_READ ) || + (cmd ==CMD_DMA_READ ) || (cmd ==CMD_DMA_EXT_READ )) {int retry;/* u16 crc1, crc2; */ u8 crc[2 ];
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +6 -6
@@ -765,8 +765,8 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, } } -if ((sme->crypto.wpa_versions &NL80211_WPA_VERSION_1 ) - || (sme->crypto.wpa_versions &NL80211_WPA_VERSION_2 )) { +if ((sme->crypto.wpa_versions &NL80211_WPA_VERSION_1 ) || + (sme->crypto.wpa_versions &NL80211_WPA_VERSION_2 )) {for (i =0 ; i < sme->crypto.n_ciphers_pairwise; i++) {if (sme->crypto.ciphers_pairwise[i] ==WLAN_CIPHER_SUITE_TKIP ) u8security = u8security |TKIP ;
@@ -1497,8 +1497,8 @@ void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size) } }if (p2p_local_random > p2p_recv_random) { -if ((buff[P2P_PUB_ACTION_SUBTYPE ] ==GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE ] ==GO_NEG_RSP - || buff[P2P_PUB_ACTION_SUBTYPE ] ==P2P_INV_REQ || buff[P2P_PUB_ACTION_SUBTYPE ] ==P2P_INV_RSP )) { +if ((buff[P2P_PUB_ACTION_SUBTYPE ] ==GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE ] ==GO_NEG_RSP || + buff[P2P_PUB_ACTION_SUBTYPE ] ==P2P_INV_REQ || buff[P2P_PUB_ACTION_SUBTYPE ] ==P2P_INV_RSP )) {for (i =P2P_PUB_ACTION_SUBTYPE +2 ; i < size; i++) {if (buff[i] ==P2PELEM_ATTR_ID && !(memcmp (p2p_oui, &buff[i +2 ],4 ))) {WILC_WFI_CfgParseRxAction (&buff[i +6 ], size - (i +6 ));
@@ -1682,8 +1682,8 @@ static int mgmt_tx(struct wiphy *wiphy, } } -if ((buf[P2P_PUB_ACTION_SUBTYPE ] ==GO_NEG_REQ || buf[P2P_PUB_ACTION_SUBTYPE ] ==GO_NEG_RSP - || buf[P2P_PUB_ACTION_SUBTYPE ] ==P2P_INV_REQ || buf[P2P_PUB_ACTION_SUBTYPE ] ==P2P_INV_RSP )) { +if ((buf[P2P_PUB_ACTION_SUBTYPE ] ==GO_NEG_REQ || buf[P2P_PUB_ACTION_SUBTYPE ] ==GO_NEG_RSP || + buf[P2P_PUB_ACTION_SUBTYPE ] ==P2P_INV_REQ || buf[P2P_PUB_ACTION_SUBTYPE ] ==P2P_INV_RSP )) {if (p2p_local_random > p2p_recv_random) {for (i =P2P_PUB_ACTION_SUBTYPE +2 ; i < len; i++) {if (buf[i] ==P2PELEM_ATTR_ID && !(memcmp (p2p_oui, &buf[i +2 ],4 ))) {
Signature · 1 line
2.11.0