public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH next] batman-adv: fix usage and declaration of batadv_bandwidth_units
@ 2013-09-22 18:08 Antonio Quartulli
  2013-09-24 12:34 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2013-09-22 18:08 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

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")

Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
---
 gateway_common.c | 3 ++-
 gateway_common.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gateway_common.c b/gateway_common.c
index ab9a5ac..b211b0f 100644
--- a/gateway_common.c
+++ b/gateway_common.c
@@ -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)
diff --git a/gateway_common.h b/gateway_common.h
index 368d50e..56384a4 100644
--- a/gateway_common.h
+++ b/gateway_common.h
@@ -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,
 };
-- 
1.8.1.5


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

end of thread, other threads:[~2013-09-24 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-22 18:08 [B.A.T.M.A.N.] [PATCH next] batman-adv: fix usage and declaration of batadv_bandwidth_units Antonio Quartulli
2013-09-24 12:34 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox