Skip to contentSkip to conversation

batman-adv: fix usage and declaration of batadv_bandwidth_units

PATCH Applied Antonio Quartulli 2 participants 2 messages Sep 22, 2013 – Sep 24, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: fix usage and declaration of batadv_bandwidth_units

Name in declaration does not reflect the one reporte din the kernel doc. Moreover a variable storing an enum should be of type enum rather than int (this helps the compiler to spott possible mistakes)

Introduced by 0853ec7fafe0a195754454832993c6b35e22b842 ("batman-adv: tvlv - gateway download/upload bandwidth container")

---
 gateway_common.c | 3 ++-
 gateway_common.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
gateway_common.c +2 -1
index ab9a5ac..b211b0f 100644
@@ -34,9 +34,10 @@
 static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff,
 				      uint32_t *down, uint32_t *up)
 {
-	int ret, bw_unit_type = BATADV_BW_UNIT_KBIT;
+	enum batadv_bandwidth_units bw_unit_type = BATADV_BW_UNIT_KBIT;
 	char *slash_ptr, *tmp_ptr;
 	long ldown, lup;
+	int ret;
 
 	slash_ptr = strchr(buff, '/');
 	if (slash_ptr)
gateway_common.h +1 -1
index 368d50e..56384a4 100644
@@ -31,7 +31,7 @@ enum batadv_gw_modes {
  * @BATADV_BW_UNIT_KBIT: unit type kbit
  * @BATADV_BW_UNIT_MBIT: unit type mbit
  */
-enum batadv_bandwidth_types {
+enum batadv_bandwidth_units {
 	BATADV_BW_UNIT_KBIT,
 	BATADV_BW_UNIT_MBIT,
 };
Signature · 1 line
1.8.1.5
#1 lore raw
Quoted 4 lines · On Sunday 22 September 2013 20:08:25 Antonio Quartulli wrote:

Name in declaration does not reflect the one reporte din the kernel doc. Moreover a variable storing an enum should be of type enum rather than int (this helps the compiler to spott possible mistakes)

Quoted 8 lines

Introduced by 0853ec7fafe0a195754454832993c6b35e22b842 ("batman-adv: tvlv - gateway download/upload bandwidth container")

---
 gateway_common.c | 3 ++-
 gateway_common.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Applied in revision 8b3e7b9.

Thanks,
Marek