* [bug report] wifi: ath12k: last element unused?
@ 2023-02-16 14:00 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2023-02-16 14:00 UTC (permalink / raw)
To: quic_kvalo; +Cc: ath12k
Hello Kalle Valo,
The patch d889913205cf: "wifi: ath12k: driver for Qualcomm Wi-Fi 7
devices" from Nov 28, 2022, leads to the following Smatch static
checker warning:
drivers/net/wireless/ath/ath12k/dp_rx.c:1172 ath12k_get_ppdu_user_index()
warn: why is the last element skipped?
drivers/net/wireless/ath/ath12k/dp_rx.c
1167 static int ath12k_get_ppdu_user_index(struct htt_ppdu_stats *ppdu_stats,
1168 u16 peer_id)
1169 {
1170 int i;
1171
--> 1172 for (i = 0; i < HTT_PPDU_STATS_MAX_USERS - 1; i++) {
What's the - 1 for? The "HTT_PPDU_STATS_MAX_USERS - 1" is done in
several places so maybe it's correct but I couldn't figure out what's
stored in the last element of the array.
1173 if (ppdu_stats->user_stats[i].is_valid_peer_id) {
1174 if (peer_id == ppdu_stats->user_stats[i].peer_id)
1175 return i;
1176 } else {
1177 return i;
1178 }
1179 }
1180
1181 return -EINVAL;
1182 }
regards,
dan carpenter
--
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-16 14:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-16 14:00 [bug report] wifi: ath12k: last element unused? Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox