* [PATCH 1/3] staging: wfx: replace uint32_t with u32
@ 2019-11-06 1:09 Jules Irenge
2019-11-06 1:09 ` [PATCH 2/3] staging: wfx: replace uint8_t with u8 Jules Irenge
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jules Irenge @ 2019-11-06 1:09 UTC (permalink / raw)
To: outreachy-kernel; +Cc: jerome.pouiller, gregkh, Jules Irenge
Replace kernel type uint32_t with u32.
As per recommendation of checkpatch tool.
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
drivers/staging/wfx/bh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index 955ed3a1dd73..337af22b0150 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -239,7 +239,7 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
*/
static void ack_sdio_data(struct wfx_dev *wdev)
{
- uint32_t cfg_reg;
+ u32 cfg_reg;
config_reg_read(wdev, &cfg_reg);
if (cfg_reg & 0xFF) {
--
2.23.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] staging: wfx: replace uint8_t with u8
2019-11-06 1:09 [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jules Irenge
@ 2019-11-06 1:09 ` Jules Irenge
2019-11-06 1:09 ` [PATCH 3/3] staging: wfx: remove space after a cast Jules Irenge
2019-11-06 12:24 ` [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jerome Pouiller
2 siblings, 0 replies; 5+ messages in thread
From: Jules Irenge @ 2019-11-06 1:09 UTC (permalink / raw)
To: outreachy-kernel; +Cc: jerome.pouiller, gregkh, Jules Irenge
Replace kernel type uint8_t with u8.
As per recommendation of checkpatch tool.
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
drivers/staging/wfx/data_tx.c | 4 ++--
drivers/staging/wfx/data_tx.h | 18 +++++++++---------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index ea4205ac2149..76a474bf2e85 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -107,7 +107,7 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
for (i = 0; i < IEEE80211_TX_MAX_RATES; ++i) {
int rateid;
- uint8_t count;
+ u8 count;
if (rates[i].idx < 0)
break;
@@ -546,7 +546,7 @@ static uint8_t wfx_tx_get_rate_id(struct wfx_vif *wvif,
struct ieee80211_tx_info *tx_info)
{
bool tx_policy_renew = false;
- uint8_t rate_id;
+ u8 rate_id;
rate_id = wfx_tx_policy_get(wvif,
tx_info->driver_rates, &tx_policy_renew);
diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h
index f74d1988925d..f203697a9617 100644
--- a/drivers/staging/wfx/data_tx.h
+++ b/drivers/staging/wfx/data_tx.h
@@ -31,17 +31,17 @@ enum wfx_link_status {
struct wfx_link_entry {
unsigned long timestamp;
enum wfx_link_status status;
- uint8_t mac[ETH_ALEN];
- uint8_t old_mac[ETH_ALEN];
- uint8_t buffered[WFX_MAX_TID];
+ u8 mac[ETH_ALEN];
+ u8 old_mac[ETH_ALEN];
+ u8 buffered[WFX_MAX_TID];
struct sk_buff_head rx_queue;
};
struct tx_policy {
struct list_head link;
- uint8_t rates[12];
- uint8_t usage_count;
- uint8_t uploaded;
+ u8 rates[12];
+ u8 usage_count;
+ u8 uploaded;
};
struct tx_policy_cache {
@@ -55,9 +55,9 @@ struct tx_policy_cache {
struct wfx_tx_priv {
ktime_t xmit_timestamp;
struct ieee80211_key_conf *hw_key;
- uint8_t link_id;
- uint8_t raw_link_id;
- uint8_t tid;
+ u8 link_id;
+ u8 raw_link_id;
+ u8 tid;
} __packed;
void wfx_tx_policy_init(struct wfx_vif *wvif);
--
2.23.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] staging: wfx: remove space after a cast
2019-11-06 1:09 [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jules Irenge
2019-11-06 1:09 ` [PATCH 2/3] staging: wfx: replace uint8_t with u8 Jules Irenge
@ 2019-11-06 1:09 ` Jules Irenge
2019-11-06 12:24 ` [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jerome Pouiller
2 siblings, 0 replies; 5+ messages in thread
From: Jules Irenge @ 2019-11-06 1:09 UTC (permalink / raw)
To: outreachy-kernel; +Cc: jerome.pouiller, gregkh, Jules Irenge
Remove a space after a cast to fix an issue
raised by checkpatch tool.
"CHECK: No space is necessary after a cast."
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
drivers/staging/wfx/data_rx.c | 2 +-
drivers/staging/wfx/data_tx.c | 4 ++--
drivers/staging/wfx/data_tx.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index e7fcce8d0cc4..1d26c1b77725 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -50,7 +50,7 @@ static int wfx_handle_pspoll(struct wfx_vif *wvif, struct sk_buff *skb)
static int wfx_drop_encrypt_data(struct wfx_dev *wdev, struct hif_ind_rx *arg, struct sk_buff *skb)
{
- struct ieee80211_hdr *frame = (struct ieee80211_hdr *) skb->data;
+ struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data;
size_t hdrlen = ieee80211_hdrlen(frame->frame_control);
size_t iv_len, icv_len;
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 76a474bf2e85..ee01eaa8ae86 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -482,7 +482,7 @@ static uint8_t wfx_tx_get_raw_link_id(struct wfx_vif *wvif,
struct ieee80211_hdr *hdr)
{
struct wfx_sta_priv *sta_priv =
- sta ? (struct wfx_sta_priv *) &sta->drv_priv : NULL;
+ sta ? (struct wfx_sta_priv *)&sta->drv_priv : NULL;
const u8 *da = ieee80211_get_DA(hdr);
int ret;
@@ -615,7 +615,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
int queue_id = tx_info->hw_queue;
- size_t offset = (size_t) skb->data & 3;
+ size_t offset = (size_t)skb->data & 3;
int wmsg_len = sizeof(struct hif_msg) +
sizeof(struct hif_req_tx) + offset;
diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h
index f203697a9617..a8323d60d909 100644
--- a/drivers/staging/wfx/data_tx.h
+++ b/drivers/staging/wfx/data_tx.h
@@ -85,7 +85,7 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb)
static inline struct hif_req_tx *wfx_skb_txreq(struct sk_buff *skb)
{
struct hif_msg *hif = (struct hif_msg *)skb->data;
- struct hif_req_tx *req = (struct hif_req_tx *) hif->body;
+ struct hif_req_tx *req = (struct hif_req_tx *)hif->body;
return req;
}
--
2.23.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] staging: wfx: replace uint32_t with u32
2019-11-06 1:09 [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jules Irenge
2019-11-06 1:09 ` [PATCH 2/3] staging: wfx: replace uint8_t with u8 Jules Irenge
2019-11-06 1:09 ` [PATCH 3/3] staging: wfx: remove space after a cast Jules Irenge
@ 2019-11-06 12:24 ` Jerome Pouiller
2019-11-07 15:05 ` gregkh
2 siblings, 1 reply; 5+ messages in thread
From: Jerome Pouiller @ 2019-11-06 12:24 UTC (permalink / raw)
To: Jules Irenge; +Cc: outreachy-kernel, gregkh
Hello Jules,
On Wednesday 6 November 2019 02:09:09 CET Jules Irenge wrote:
> Replace kernel type uint32_t with u32.
> As per recommendation of checkpatch tool.
>
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> ---
> drivers/staging/wfx/bh.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
> index 955ed3a1dd73..337af22b0150 100644
> --- a/drivers/staging/wfx/bh.c
> +++ b/drivers/staging/wfx/bh.c
> @@ -239,7 +239,7 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
> */
> static void ack_sdio_data(struct wfx_dev *wdev)
> {
> - uint32_t cfg_reg;
> + u32 cfg_reg;
Why there are two spaces between u32 and cfg_reg?
>
> config_reg_read(wdev, &cfg_reg);
> if (cfg_reg & 0xFF) {
> --
> 2.23.0
There are plenty of other occurrences of uintXX_t:
$ git grep '\buint[0-9]*_t\b' drivers/staging/wfx | wc -l
628
Why do you solve this one particularly?
In add, the driver use more often uintXX_t than uXX:
$ git grep '\bu[0-9]\+\b' drivers/staging/wfx | wc -l
171
In other parts of kernel, uintXX_t are not rare:
$ git grep '\buint[0-9]*_t\b' | grep -v staging | wc -l
94005
I have a slight preference for uintXX_t, because it is less specific to
kernel (and because vim highlights uintXX_t but does not highlight uXX).
Anyway, I am agree to uniformize these types.
Thanks for your contribution.
--
Jérôme Pouiller
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] staging: wfx: replace uint32_t with u32
2019-11-06 12:24 ` [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jerome Pouiller
@ 2019-11-07 15:05 ` gregkh
0 siblings, 0 replies; 5+ messages in thread
From: gregkh @ 2019-11-07 15:05 UTC (permalink / raw)
To: Jerome Pouiller; +Cc: Jules Irenge, outreachy-kernel
On Wed, Nov 06, 2019 at 12:24:03PM +0000, Jerome Pouiller wrote:
> Hello Jules,
>
> On Wednesday 6 November 2019 02:09:09 CET Jules Irenge wrote:
> > Replace kernel type uint32_t with u32.
> > As per recommendation of checkpatch tool.
> >
> > Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> > ---
> > drivers/staging/wfx/bh.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
> > index 955ed3a1dd73..337af22b0150 100644
> > --- a/drivers/staging/wfx/bh.c
> > +++ b/drivers/staging/wfx/bh.c
> > @@ -239,7 +239,7 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
> > */
> > static void ack_sdio_data(struct wfx_dev *wdev)
> > {
> > - uint32_t cfg_reg;
> > + u32 cfg_reg;
> Why there are two spaces between u32 and cfg_reg?
Yes, that's not ok, I can't take this patch as-is for that reason alone.
>
> >
> > config_reg_read(wdev, &cfg_reg);
> > if (cfg_reg & 0xFF) {
> > --
> > 2.23.0
>
> There are plenty of other occurrences of uintXX_t:
>
> $ git grep '\buint[0-9]*_t\b' drivers/staging/wfx | wc -l
> 628
>
> Why do you solve this one particularly?
>
>
> In add, the driver use more often uintXX_t than uXX:
>
> $ git grep '\bu[0-9]\+\b' drivers/staging/wfx | wc -l
> 171
>
> In other parts of kernel, uintXX_t are not rare:
>
> $ git grep '\buint[0-9]*_t\b' | grep -v staging | wc -l
> 94005
>
> I have a slight preference for uintXX_t, because it is less specific to
> kernel (and because vim highlights uintXX_t but does not highlight uXX).
uintXX_t really doesn't make sense in the kernel, as the "namespace" is
wrong, but we tolerate it. Ideally you will use the right types.
Also, use the vim-addon-linux-coding-style pluging, makes writing kernel
code using vim much easier.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-11-07 15:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 1:09 [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jules Irenge
2019-11-06 1:09 ` [PATCH 2/3] staging: wfx: replace uint8_t with u8 Jules Irenge
2019-11-06 1:09 ` [PATCH 3/3] staging: wfx: remove space after a cast Jules Irenge
2019-11-06 12:24 ` [PATCH 1/3] staging: wfx: replace uint32_t with u32 Jerome Pouiller
2019-11-07 15:05 ` gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.