All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: Add cast to u8 to FREQ2FBIN macro
@ 2017-04-06 21:21 Matthias Kaehlcke
  2017-04-06 21:29 ` Joe Perches
  2017-04-19 14:01 ` Kalle Valo
  0 siblings, 2 replies; 7+ messages in thread
From: Matthias Kaehlcke @ 2017-04-06 21:21 UTC (permalink / raw)
  To: Kalle Valo, ath9k Development
  Cc: linux-kernel, linux-wireless, netdev, Grant Grundler, Matthias Kaehlcke

The macro results are assigned to u8 variables/fields. Adding the cast
fixes plenty of clang warnings about "implicit conversion from 'int' to
'u8'".

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 drivers/net/wireless/ath/ath9k/eeprom.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index 30bf722e33ed..31390af6c33e 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -106,7 +106,7 @@
 #define AR9285_RDEXT_DEFAULT    0x1F
 
 #define ATH9K_POW_SM(_r, _s)	(((_r) & 0x3f) << (_s))
-#define FREQ2FBIN(x, y)		((y) ? ((x) - 2300) : (((x) - 4800) / 5))
+#define FREQ2FBIN(x, y)		(u8)((y) ? ((x) - 2300) : (((x) - 4800) / 5))
 #define FBIN2FREQ(x, y)		((y) ? (2300 + x) : (4800 + 5 * x))
 #define ath9k_hw_use_flash(_ah)	(!(_ah->ah_flags & AH_USE_EEPROM))
 
-- 
2.12.2.715.g7642488e1d-goog

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-04-19 14:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 21:21 [PATCH] ath9k: Add cast to u8 to FREQ2FBIN macro Matthias Kaehlcke
2017-04-06 21:29 ` Joe Perches
2017-04-06 23:54   ` Matthias Kaehlcke
2017-04-06 23:54     ` Matthias Kaehlcke
2017-04-07  2:36     ` Joe Perches
2017-04-07  2:36       ` Joe Perches
2017-04-19 14:01 ` Kalle Valo

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.