Re: [PATCH] staging: speakup: Fix coding style
On Sun, 2018-05-13 at 11:38 +0200, Samuel Thibault wrote: [] > @@ -68,7 +68,7 @@ int spk_punc_level, spk_reading_punc; > char spk_str_caps_start[MAXVARLEN + 1] = "\0"; > char spk_str_caps_stop[MAXVARLEN + 1] = "\0"; > char spk_str_pause[MAXVARLEN + 1] = "\0"; > -bool spk_paused = 0; > +bool spk_paused; > const struct st_bits_data spk_punc_info[] = { > {"none", "", 0}, > {"some", "/$%&@", SOME}, > @@ -1782,8 +1782,7 @@ static void speakup_con_update(struct vc > /* Speakup output, discard */ > return; > speakup_date(vc); > - if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0]) > - { > + if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0]) { > synth_printf("%s", spk_str_pause); > spk_paused = 1; probably nice to change the assignments of spk_paused to true&false too ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: speakup: Fix coding style
Signed-off-by: Samuel Thibault --- drivers/staging/speakup/buffers.c |3 ++- drivers/staging/speakup/main.c|5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/drivers/staging/speakup/buffers.c +++ b/drivers/staging/speakup/buffers.c @@ -78,7 +78,8 @@ void synth_buffer_add(u16 ch) if (buff_in > buffer_end) buff_in = synth_buffer; /* We have written something to the speech synthesis, so we are not -* paused any more. */ +* paused any more. +*/ spk_paused = 0; } --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -68,7 +68,7 @@ int spk_punc_level, spk_reading_punc; char spk_str_caps_start[MAXVARLEN + 1] = "\0"; char spk_str_caps_stop[MAXVARLEN + 1] = "\0"; char spk_str_pause[MAXVARLEN + 1] = "\0"; -bool spk_paused = 0; +bool spk_paused; const struct st_bits_data spk_punc_info[] = { {"none", "", 0}, {"some", "/$%&@", SOME}, @@ -1782,8 +1782,7 @@ static void speakup_con_update(struct vc /* Speakup output, discard */ return; speakup_date(vc); - if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0]) - { + if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0]) { synth_printf("%s", spk_str_pause); spk_paused = 1; } ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/23] staging: ks7010: use u16 as type for casting in hostif_ps_adhoc_set_request
There is an assignment inside hostif_ps_adhoc_set_request function which is being used together with cpu_to_le16 using uint16_t as cast type. Replace it to use 'u16' instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 2681e2e..6d4702e 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1300,7 +1300,7 @@ void hostif_ps_adhoc_set_request(struct ks_wlan_private *priv) return; init_request(priv, &pp->request); - pp->channel = cpu_to_le16((uint16_t)(priv->reg.channel)); + pp->channel = cpu_to_le16((u16)(priv->reg.channel)); send_request_to_device(priv, pp, hif_align_size(sizeof(*pp))); } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/23] staging: ks7010: remove no necessary blank line
There was two blank lines between definitions and statements in ks7010_upload_firmware function. Remove one of them. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks7010_sdio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 0b1e352..d236dfe 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -756,7 +756,6 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card) int ret; const struct firmware *fw_entry = NULL; - sdio_claim_host(func); /* Firmware running ? */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/23] staging: ks7010: use 'u16' for casts in assignments in hostif_sme_set_rsn
There are some assignments inside hostif_sme_set_rsn function which are being used together with cpu_to_le16 using uint16_t as cast type. Replace all of them to use 'u16' instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 1cb5d90..4e88767 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1619,7 +1619,7 @@ static void hostif_sme_set_rsn(struct ks_wlan_private *priv, int type) switch (type) { case SME_RSN_UCAST_REQUEST: - wpa_suite.size = cpu_to_le16((uint16_t)1); + wpa_suite.size = cpu_to_le16((u16)1); switch (priv->wpa.pairwise_suite) { case IW_AUTH_CIPHER_NONE: buf = (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2) ? @@ -1682,7 +1682,7 @@ static void hostif_sme_set_rsn(struct ks_wlan_private *priv, int type) CIPHER_ID_LEN); break; case SME_RSN_AUTH_REQUEST: - wpa_suite.size = cpu_to_le16((uint16_t)1); + wpa_suite.size = cpu_to_le16((u16)1); switch (priv->wpa.key_mgmt_suite) { case IW_AUTH_KEY_MGMT_802_1X: buf = (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2) ? @@ -1721,7 +1721,7 @@ static void hostif_sme_set_rsn(struct ks_wlan_private *priv, int type) (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA) ? RSN_MODE_WPA : RSN_MODE_NONE; rsn_mode.rsn_mode = cpu_to_le32(mode); - rsn_mode.rsn_capability = cpu_to_le16((uint16_t)0); + rsn_mode.rsn_capability = cpu_to_le16((u16)0); hostif_mib_set_request_ostring(priv, LOCAL_RSN_MODE, &rsn_mode, sizeof(rsn_mode)); break; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/23] staging: ks7010: avoid no needed cast in ks_wlan_cap
In ks_wlan_cap there is a cast to uint16_t to use cpu_to_le16 with variable 'capability' which is already defined as u16. Avoid this cast to clean code. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 9724a48..adc6ccf 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1275,7 +1275,7 @@ static __le16 ks_wlan_cap(struct ks_wlan_private *priv) capability &= ~(WLAN_CAPABILITY_DSSS_OFDM); } - return cpu_to_le16((uint16_t)capability); + return cpu_to_le16(capability); } static void init_request(struct ks_wlan_private *priv, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/23] staging: ks7010: replace cast type in assignment in hostif_sme_set_pmksa
There is an assignment inside hostif_sme_set_pmksa function which is being used together with cpu_to_le16 using uint16_t as cast type. Replace it to use 'u16' instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 4e88767..66ab45a 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1979,7 +1979,7 @@ void hostif_sme_set_pmksa(struct ks_wlan_private *priv) memcpy(pmkcache.list[i].pmkid, pmk->pmkid, IW_PMKID_LEN); i++; } - pmkcache.size = cpu_to_le16((uint16_t)(priv->pmklist.size)); + pmkcache.size = cpu_to_le16((u16)(priv->pmklist.size)); size = sizeof(priv->pmklist.size) + ((ETH_ALEN + IW_PMKID_LEN) * priv->pmklist.size); hostif_mib_set_request_ostring(priv, LOCAL_PMK, &pmkcache, size); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/23] staging: ks7010: replace cast type in assignment in hostif_adhoc_set_request
There is an assignment inside hostif_adhoc_set_request function which is being used together with cpu_to_le16 using uint16_t as cast type. Replace it to use 'u16' instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index bf410e3..b946f51 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1354,7 +1354,7 @@ void hostif_adhoc_set_request(struct ks_wlan_private *priv) return; init_request(priv, &pp->request); - pp->channel = cpu_to_le16((uint16_t)(priv->reg.channel)); + pp->channel = cpu_to_le16((u16)(priv->reg.channel)); pp->ssid.size = priv->reg.ssid.size; memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/23] staging: ks7010: change cast from uint16_t to u16
Header size and event fields of header are declared as __le16 and being casted using uint16_t in cpu_to_le16. Change cast to use preferred u16. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks7010_sdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index f56db07..a51b5e8 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -1061,8 +1061,8 @@ static int send_stop_request(struct sdio_func *func) return -ENOMEM; size = sizeof(*pp) - sizeof(pp->header.size); - pp->header.size = cpu_to_le16((uint16_t)size); - pp->header.event = cpu_to_le16((uint16_t)HIF_STOP_REQ); + pp->header.size = cpu_to_le16((u16)size); + pp->header.event = cpu_to_le16((u16)HIF_STOP_REQ); sdio_claim_host(func); write_to_device(card->priv, (u8 *)pp, hif_align_size(sizeof(*pp))); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/23] staging: ks7010: change two parameter types in hostif_mic_failure_request
Parameters 'failure_count' and 'timer' was declared as unsigned short and then there was being casted to u16 inside cpu_to_le16 to make the assignation. Just declare them as 'u16' and avoid casting at all. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 5e7d3fa..1cb5d90 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1501,8 +1501,7 @@ void hostif_bss_scan_request(struct ks_wlan_private *priv, static void hostif_mic_failure_request(struct ks_wlan_private *priv, - unsigned short failure_count, - unsigned short timer) + u16 failure_count, u16 timer) { struct hostif_mic_failure_request *pp; @@ -1510,8 +1509,8 @@ void hostif_mic_failure_request(struct ks_wlan_private *priv, if (!pp) return; - pp->failure_count = cpu_to_le16((uint16_t)failure_count); - pp->timer = cpu_to_le16((uint16_t)timer); + pp->failure_count = cpu_to_le16(failure_count); + pp->timer = cpu_to_le16(timer); send_request_to_device(priv, pp, hif_align_size(sizeof(*pp))); } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/23] staging: ks7010: change uint8_t casts to u8 in ks_wlan_set_rate
There are some casts to uint8_t in ks_wlan_set_rate function to assign values of the bitrate. Just change it to u8 which is the one defined for the field 'body' of the struct which is in use. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_wlan_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 6d5ac62..1cd690a 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -406,12 +406,12 @@ static int ks_wlan_set_rate(struct net_device *dev, case 1100: case 550: priv->reg.rate_set.body[0] = - (uint8_t)(vwrq->bitrate.value / 50); + (u8)(vwrq->bitrate.value / 50); break; case 200: case 100: priv->reg.rate_set.body[0] = - ((uint8_t)(vwrq->bitrate.value / 50)) | + ((u8)(vwrq->bitrate.value / 50)) | BASIC_RATE; break; default: @@ -466,7 +466,7 @@ static int ks_wlan_set_rate(struct net_device *dev, case 1800: case 900: priv->reg.rate_set.body[0] = - (uint8_t)(vwrq->bitrate.value / 50); + (u8)(vwrq->bitrate.value / 50); break; case 2400: case 1200: @@ -476,7 +476,7 @@ static int ks_wlan_set_rate(struct net_device *dev, case 200: case 100: priv->reg.rate_set.body[0] = - ((uint8_t)(vwrq->bitrate.value / 50)) | + ((u8)(vwrq->bitrate.value / 50)) | BASIC_RATE; break; default: -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/23] staging: ks7010: change some cast type from uint16_t to u16 in hostif_data_request
There are some castings inside the function hostif_data_request which are being using with uint16_t type. Fields which have being assigned are declared as u16. So update casts types to u16 in all of them. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 9d3f7e3..ecdd134 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1109,7 +1109,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb) priv->wpa.key[1].key_len == 0 && priv->wpa.key[2].key_len == 0 && priv->wpa.key[3].key_len == 0) { - pp->auth_type = cpu_to_le16((uint16_t)TYPE_AUTH); + pp->auth_type = cpu_to_le16((u16)TYPE_AUTH); } else { if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP) { michael_mic_function(&michael_mic, @@ -1121,26 +1121,26 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb) skb_len += 8; p += 8; pp->auth_type = - cpu_to_le16((uint16_t)TYPE_DATA); + cpu_to_le16((u16)TYPE_DATA); } else if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_CCMP) { pp->auth_type = - cpu_to_le16((uint16_t)TYPE_DATA); + cpu_to_le16((u16)TYPE_DATA); } } } else { if (eth_proto == ETH_P_PAE) - pp->auth_type = cpu_to_le16((uint16_t)TYPE_AUTH); + pp->auth_type = cpu_to_le16((u16)TYPE_AUTH); else - pp->auth_type = cpu_to_le16((uint16_t)TYPE_DATA); + pp->auth_type = cpu_to_le16((u16)TYPE_DATA); } /* header value set */ pp->header.size = - cpu_to_le16((uint16_t) + cpu_to_le16((u16) (sizeof(*pp) - sizeof(pp->header.size) + skb_len)); - pp->header.event = cpu_to_le16((uint16_t)HIF_DATA_REQ); + pp->header.event = cpu_to_le16((u16)HIF_DATA_REQ); /* tx request */ result = ks_wlan_hw_tx(priv, pp, hif_align_size(sizeof(*pp) + skb_len), -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/23] staging: ks7010: change parameter type in hostif_mib_get_request
Second parameter 'mib_attribute' in function hostif_mib_get_request is declared as unsigned long and inside the function a cast to uint32_t is being used. Just pass a u32 instead and avoid the casting. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index ecdd134..9724a48 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1182,9 +1182,8 @@ static inline void send_request_to_device(struct ks_wlan_private *priv, ks_wlan_hw_tx(priv, data, size, NULL, NULL); } -static -void hostif_mib_get_request(struct ks_wlan_private *priv, - unsigned long mib_attribute) +static void hostif_mib_get_request(struct ks_wlan_private *priv, + u32 mib_attribute) { struct hostif_mib_get_request *pp; @@ -1192,7 +1191,7 @@ void hostif_mib_get_request(struct ks_wlan_private *priv, if (!pp) return; - pp->mib_attribute = cpu_to_le32((uint32_t)mib_attribute); + pp->mib_attribute = cpu_to_le32(mib_attribute); send_request_to_device(priv, pp, hif_align_size(sizeof(*pp))); } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/23] staging: ks7010: some new cleanups
The following series makes new cleanups for this driver. Some not used stuff has been deleted as well as some casts and other minor changes with types have been introduced. Sergio Paracuellos (23): staging: ks7010: remove not used definition WPA_CAPABILITY_PREAUTH staging: ks7010: remove no necessary blank line staging: ks7010: replace unsigned char type with u8 staging: ks7010: change cast from uint16_t to u16 staging: ks7010: change parameter type in ks_wlan_hw_rx function staging: ks7010: change uint8_t casts to u8 in ks_wlan_set_rate staging: ks7010: replace uint8_t with u8 in ks_wlan_set_tx_gain staging: ks7010: replace uint8_t with u8 in ks_wlan_set_rx_gain staging: ks7010: replace not standard uint type to unsigned int staging: ks7010: use u16 as type for casting in hostif_data_indication_wpa staging: ks7010: change some cast type from uint16_t to u16 in hostif_data_request staging: ks7010: change parameter type in hostif_mib_get_request staging: ks7010: avoid no needed cast in ks_wlan_cap staging: ks7010: use u16 as cast type in hostif_start_request staging: ks7010: replace casts to use type u16 in init_request staging: ks7010: use u16 as type for casting in hostif_ps_adhoc_set_request staging: ks7010: replace cast type in assignments in hostif_infrastructure_set_request staging: ks7010: replace cast type in assignment in hostif_adhoc_set_request staging: ks7010: replace cast types in assignments in hostif_phy_information_request staging: ks7010: replace uint* type into the u* ones in hostif_bss_scan_request staging: ks7010: change two parameter types in hostif_mic_failure_request staging: ks7010: use 'u16' for casts in assignments in hostif_sme_set_rsn staging: ks7010: replace cast type in assignment in hostif_sme_set_pmksa drivers/staging/ks7010/eap_packet.h | 2 - drivers/staging/ks7010/ks7010_sdio.c | 13 +++ drivers/staging/ks7010/ks_hostif.c | 72 ++-- drivers/staging/ks7010/ks_wlan.h | 2 +- drivers/staging/ks7010/ks_wlan_net.c | 12 +++--- 5 files changed, 48 insertions(+), 53 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/23] staging: ks7010: use u16 as type for casting in hostif_data_indication_wpa
Field 'counter' in mic_failure struct is being assigned casting value using uint16_t. Replace with u16 which is the correct type of the field and the preferred one. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 7b6a385..9d3f7e3 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -323,7 +323,7 @@ int hostif_data_indication_wpa(struct ks_wlan_private *priv, } else if (mic_failure->failure == 1) { mic_failure->failure = 2; mic_failure->counter = - (uint16_t)((now - mic_failure->last_failure_time) / HZ); + (u16)((now - mic_failure->last_failure_time) / HZ); /* range 1-60 */ if (!mic_failure->counter) mic_failure->counter = 1; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/23] staging: ks7010: use u16 as cast type in hostif_start_request
Use u16 as cast type in hostif_start_request function replacing uint16_t which was being used. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index adc6ccf..ee8dcb3 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1253,7 +1253,7 @@ void hostif_start_request(struct ks_wlan_private *priv, unsigned char mode) if (!pp) return; - pp->mode = cpu_to_le16((uint16_t)mode); + pp->mode = cpu_to_le16((u16)mode); send_request_to_device(priv, pp, hif_align_size(sizeof(*pp))); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/23] staging: ks7010: replace uint8_t with u8 in ks_wlan_set_rx_gain
In function ks_wlan_set_rx_gain a cast to uint8_t is being used to assign reception gain. 'rx_gain' field is defined as u8 so replace the cast to the correct type Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_wlan_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index c85ea83..dc5459a 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -2155,7 +2155,7 @@ static int ks_wlan_set_rx_gain(struct net_device *dev, if (*uwrq > 0xFF) return -EINVAL; - priv->gain.rx_gain = (uint8_t)*uwrq; + priv->gain.rx_gain = (u8)*uwrq; priv->gain.rx_mode = (priv->gain.rx_gain < 0xFF) ? 1 : 0; hostif_sme_enqueue(priv, SME_SET_GAIN); return 0; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/23] staging: ks7010: replace cast type in assignments in hostif_infrastructure_set_request
There are some assignments inside hostif_infrastructure_set_request function which are being used together with cpu_to_le16 using uint16_t as cast type. Replace all of them to use 'u16' instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 6d4702e..bf410e3 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1318,8 +1318,8 @@ void hostif_infrastructure_set_request(struct ks_wlan_private *priv, int event) pp->ssid.size = priv->reg.ssid.size; memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size); pp->beacon_lost_count = - cpu_to_le16((uint16_t)(priv->reg.beacon_lost_count)); - pp->auth_type = cpu_to_le16((uint16_t)(priv->reg.authenticate_type)); + cpu_to_le16((u16)(priv->reg.beacon_lost_count)); + pp->auth_type = cpu_to_le16((u16)(priv->reg.authenticate_type)); pp->channel_list.body[0] = 1; pp->channel_list.body[1] = 8; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/23] staging: ks7010: replace unsigned char type with u8
Variable 'byte' in ks7010_upload_firmware function is declared as unsigned char and is only being used to read hardware registers which are expected in sdio_read_byteb function as u8. Change 'byte' variable type to u8 which is preferred. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index d236dfe..f56db07 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -752,7 +752,7 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card) struct ks_wlan_private *priv = card->priv; struct sdio_func *func = ks7010_to_func(priv); unsigned int n; - unsigned char byte = 0; + u8 byte = 0; int ret; const struct firmware *fw_entry = NULL; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/23] staging: ks7010: replace not standard uint type to unsigned int
The field 'wakeup_count' in 'ks_wlan_private' struct is declared as 'uint' which is not a standard type. Replace in favour of 'unsigned int' which it is. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_wlan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h index 655f1e3..11dd263 100644 --- a/drivers/staging/ks7010/ks_wlan.h +++ b/drivers/staging/ks7010/ks_wlan.h @@ -513,7 +513,7 @@ struct ks_wlan_private { unsigned long last_doze; unsigned long last_wakeup; - uint wakeup_count; /* for detect wakeup loop */ + unsigned int wakeup_count; /* for detect wakeup loop */ }; static inline void inc_txqhead(struct ks_wlan_private *priv) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/23] staging: ks7010: replace cast types in assignments in hostif_phy_information_request
There are some assignments inside hostif_phy_information_request function which are being used together with cpu_to_le16 using uint16_t as cast type. Replace all of them to use 'u16' instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index b946f51..cf9e98f 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1403,11 +1403,11 @@ void hostif_phy_information_request(struct ks_wlan_private *priv) return; if (priv->reg.phy_info_timer) { - pp->type = cpu_to_le16((uint16_t)TIME_TYPE); - pp->time = cpu_to_le16((uint16_t)(priv->reg.phy_info_timer)); + pp->type = cpu_to_le16((u16)TIME_TYPE); + pp->time = cpu_to_le16((u16)(priv->reg.phy_info_timer)); } else { - pp->type = cpu_to_le16((uint16_t)NORMAL_TYPE); - pp->time = cpu_to_le16((uint16_t)0); + pp->type = cpu_to_le16((u16)NORMAL_TYPE); + pp->time = cpu_to_le16((u16)0); } send_request_to_device(priv, pp, hif_align_size(sizeof(*pp))); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/23] staging: ks7010: replace uint* type into the u* ones in hostif_bss_scan_request
In function hostif_bss_scan_request parameters 'scan_ssid' and 'scan_ssid_len' are declared as uint8_t. Change them to be 'u8' instead which is preferred. Also update two casts inside the same function to use 'u32' instead of 'uint32_t'. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index cf9e98f..5e7d3fa 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1453,8 +1453,8 @@ void hostif_sleep_request(struct ks_wlan_private *priv, static void hostif_bss_scan_request(struct ks_wlan_private *priv, -unsigned long scan_type, uint8_t *scan_ssid, -uint8_t scan_ssid_len) +unsigned long scan_type, u8 *scan_ssid, +u8 scan_ssid_len) { struct hostif_bss_scan_request *pp; @@ -1464,8 +1464,8 @@ void hostif_bss_scan_request(struct ks_wlan_private *priv, pp->scan_type = scan_type; - pp->ch_time_min = cpu_to_le32((uint32_t)110); /* default value */ - pp->ch_time_max = cpu_to_le32((uint32_t)130); /* default value */ + pp->ch_time_min = cpu_to_le32((u32)110);/* default value */ + pp->ch_time_max = cpu_to_le32((u32)130);/* default value */ pp->channel_list.body[0] = 1; pp->channel_list.body[1] = 8; pp->channel_list.body[2] = 2; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/23] staging: ks7010: remove not used definition WPA_CAPABILITY_PREAUTH
The WPA_CAPABILITY_PREAUTH definition is not being used at all so just remove it. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/eap_packet.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/ks7010/eap_packet.h b/drivers/staging/ks7010/eap_packet.h index ded85d9..1eee774 100644 --- a/drivers/staging/ks7010/eap_packet.h +++ b/drivers/staging/ks7010/eap_packet.h @@ -67,6 +67,4 @@ struct wpa_eapol_key { #define WPA_KEY_INFO_REQUEST BIT(11) #define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12) /* IEEE 802.11i/RSN only */ -#define WPA_CAPABILITY_PREAUTH BIT(0) - #endif /* EAP_PACKET_H */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/23] staging: ks7010: change parameter type in ks_wlan_hw_rx function
The parameter 'size' in function ks_wlan_hw_rx is declared as uint16_t and can be declared as size_t which makes more sense. It is being passed to hif_align_size function which also expects a size_t as parameter so just change its type. Also update two casts in calls to this function. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks7010_sdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index a51b5e8..e904740 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -420,7 +420,7 @@ static void rx_event_task(unsigned long dev) } } -static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size) +static void ks_wlan_hw_rx(struct ks_wlan_private *priv, size_t size) { int ret; struct rx_device_buffer *rx_buffer; @@ -526,7 +526,7 @@ static void ks7010_rw_function(struct work_struct *work) } if (byte & RSIZE_MASK) {/* Read schedule */ - ks_wlan_hw_rx(priv, (uint16_t)((byte & RSIZE_MASK) << 4)); + ks_wlan_hw_rx(priv, (size_t)((byte & RSIZE_MASK) << 4)); } if ((byte & WSTATUS_MASK)) tx_device_task(priv); @@ -586,7 +586,7 @@ static void ks_sdio_interrupt(struct sdio_func *func) } rsize = byte & RSIZE_MASK; if (rsize != 0) /* Read schedule */ - ks_wlan_hw_rx(priv, (uint16_t)(rsize << 4)); + ks_wlan_hw_rx(priv, (size_t)(rsize << 4)); if (byte & WSTATUS_MASK) { if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/23] staging: ks7010: replace uint8_t with u8 in ks_wlan_set_tx_gain
In function ks_wlan_set_tx_gain a cast to uint8_t is being used to assign transmission gain. 'tx_gain' field is defined as u8 so replace the cast to the correct type. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_wlan_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 1cd690a..c85ea83 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -2123,7 +2123,7 @@ static int ks_wlan_set_tx_gain(struct net_device *dev, if (*uwrq > 0xFF) return -EINVAL; - priv->gain.tx_gain = (uint8_t)*uwrq; + priv->gain.tx_gain = (u8)*uwrq; priv->gain.tx_mode = (priv->gain.tx_gain < 0xFF) ? 1 : 0; hostif_sme_enqueue(priv, SME_SET_GAIN); return 0; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/23] staging: ks7010: replace casts to use type u16 in init_request
There are soem assignments inside init_request function which are being used together with cpu_to_le16 using uint16_t as cast type. Replace all of them to use 'u16' instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index ee8dcb3..2681e2e 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -1281,9 +1281,9 @@ static __le16 ks_wlan_cap(struct ks_wlan_private *priv) static void init_request(struct ks_wlan_private *priv, struct hostif_request *req) { - req->phy_type = cpu_to_le16((uint16_t)(priv->reg.phy_type)); - req->cts_mode = cpu_to_le16((uint16_t)(priv->reg.cts_mode)); - req->scan_type = cpu_to_le16((uint16_t)(priv->reg.scan_type)); + req->phy_type = cpu_to_le16((u16)(priv->reg.phy_type)); + req->cts_mode = cpu_to_le16((u16)(priv->reg.cts_mode)); + req->scan_type = cpu_to_le16((u16)(priv->reg.scan_type)); req->rate_set.size = priv->reg.rate_set.size; req->capability = ks_wlan_cap(priv); memcpy(&req->rate_set.body[0], &priv->reg.rate_set.body[0], -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] Drivers: hv: vmbus: enable VMBus protocol version 5.0
On Sat, 12 May 2018 02:30:33 -0700 k...@linuxonhyperv.com wrote: > int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep) > { > + struct vmbus_channel_message_header *hdr; > union hv_connection_id conn_id; > int ret = 0; > int retries = 0; > u32 usec = 1; > > conn_id.asu32 = 0; > - conn_id.u.id = VMBUS_MESSAGE_CONNECTION_ID; > + conn_id.u.id = vmbus_connection.msg_conn_id; > > /* >* hv_post_message() can have transient failures because of > @@ -372,6 +400,18 @@ int vmbus_post_msg(void *buffer, size_t buflen, bool > can_sleep) > > switch (ret) { > case HV_STATUS_INVALID_CONNECTION_ID: > + /* > + * See vmbus_negotiate_version(): VMBus protocol 5.0 > + * requires that we must use > + * VMBUS_MESSAGE_CONNECTION_ID_4 for the Initiate > + * Contact message, but on old hosts that only > + * support VMBus protocol 4.0 or lower, here we get > + * HV_STATUS_INVALID_CONNECTION_ID and we should > + * return an error immediately without retrying. > + */ > + hdr = (struct vmbus_channel_message_header *)buffer; Hate to pick o the details, but buffer is void * so cast is not necessary here. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel