Skip to contentSkip to conversation

staging: wfx: cleanups

PATCH Superseded Jules Irenge 2 participants 5 messages Nov 2, 2019 Staging

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover staging: wfx: cleanups

Changes since v2
- includes previously sent into a patch series as per suggestion
- merge 2 patches solving same issues into a single one.
- improve on log message : used replace instead of fixing as per coccinnelle recommendation.

Jules Irenge (2):
staging: wfx: fix warning of using plain integer
staging: wfx: replace integer assignment to bool value

 drivers/staging/wfx/queue.c | 4 ++--
 drivers/staging/wfx/sta.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/2 staging: wfx: fix warning of using plain integer

Fix warning of using plain integer as NULL pointer. Issue reported by sparse tool.

---
 drivers/staging/wfx/queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wfx/queue.c +1 -1
index ef3ee55cf621..5d29bce65f71 100644
@@ -565,7 +565,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
 		}
 
 		if (ret)
-			return 0;
+			return NULL;
 
 		queue_num = queue - wdev->tx_queue;
 
Signature · 1 line
2.21.0
#2 lore raw

Re: [Outreachy kernel] [PATCH v2 1/2] staging: wfx: fix warning of using plain integer

Quoted 1 line · Jules Irenge

Fix warning of using plain integer as NULL pointer.

This neither says what is done nor why it is done. Replace 0 by NULL as the return value of a pointer-returning function.

julia

Quoted 28 lines

Issue reported by sparse tool.

---
 drivers/staging/wfx/queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wfx/queue.c +1 -2
index ef3ee55cf621..5d29bce65f71 100644
@@ -565,7 +565,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
 		}
 
 		if (ret)
-			return 0;
+			return NULL;
 
 		queue_num = queue - wdev->tx_queue;
 
--

2.21.0

--
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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191102171950.24950-2-jbi.octave%40gmail.com.

#3 lore raw

PATCH v2 2/2 staging: wfx: replace integer assignment to bool value

In reply to Jules Irenge

Replace integer assignment to bool value.
Recommended by coccinelle tool.

---
 drivers/staging/wfx/queue.c | 2 +-
 drivers/staging/wfx/sta.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wfx/queue.c +1 -1
index 5d29bce65f71..71e92744fed0 100644
@@ -550,7 +550,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
 			spin_unlock_bh(&wvif->ps_state_lock);
 
 			if (vif_more) {
-				more = 1;
+				more = true;
 				tx_allowed_mask = vif_tx_allowed_mask;
 				queue = vif_queue;
 				ret = 0;
drivers/staging/wfx/sta.c +1 -1
index 688586e823c0..ea5707ff8847 100644
@@ -291,7 +291,7 @@ u64 wfx_prepare_multicast(struct ieee80211_hw *hw, struct netdev_hw_addr_list *m
 			ether_addr_copy(wvif->mcast_filter.address_list[i], ha->addr);
 			i++;
 		}
-		wvif->mcast_filter.enable = 1;
+		wvif->mcast_filter.enable = true;
 		wvif->mcast_filter.num_addresses = count;
 	}
 
Signature · 1 line
2.21.0
#4 lore raw

Re: [Outreachy kernel] [PATCH v2 2/2] staging: wfx: replace integer assignment to bool value

Quoted 1 line · Jules Irenge

Replace integer assignment to bool value.

Maybe "Replace 1 by true when it is stored in a boolean variable".

That would explain both what is done (1 -> true) and why (boolean variable).

julia

Quoted 42 lines

Recommended by coccinelle tool.

---
 drivers/staging/wfx/queue.c | 2 +-
 drivers/staging/wfx/sta.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wfx/queue.c +1 -1
index 5d29bce65f71..71e92744fed0 100644
@@ -550,7 +550,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
 			spin_unlock_bh(&wvif->ps_state_lock);
 
 			if (vif_more) {
-				more = 1;
+				more = true;
 				tx_allowed_mask = vif_tx_allowed_mask;
 				queue = vif_queue;
 				ret = 0;
drivers/staging/wfx/sta.c +1 -2
index 688586e823c0..ea5707ff8847 100644
@@ -291,7 +291,7 @@ u64 wfx_prepare_multicast(struct ieee80211_hw *hw, struct netdev_hw_addr_list *m
 			ether_addr_copy(wvif->mcast_filter.address_list[i], ha->addr);
 			i++;
 		}
-		wvif->mcast_filter.enable = 1;
+		wvif->mcast_filter.enable = true;
 		wvif->mcast_filter.num_addresses = count;
 	}
 
--

2.21.0

--
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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191102171950.24950-3-jbi.octave%40gmail.com.