public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@meshcoding.com>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Antonio Quartulli <antonio@meshcoding.com>
Subject: [B.A.T.M.A.N.] [PATCH next] batman-adv: fix usage and declaration of batadv_bandwidth_units
Date: Sun, 22 Sep 2013 20:08:25 +0200	[thread overview]
Message-ID: <1379873305-1292-1-git-send-email-antonio@meshcoding.com> (raw)

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


             reply	other threads:[~2013-09-22 18:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-22 18:08 Antonio Quartulli [this message]
2013-09-24 12:34 ` [B.A.T.M.A.N.] [PATCH next] batman-adv: fix usage and declaration of batadv_bandwidth_units Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379873305-1292-1-git-send-email-antonio@meshcoding.com \
    --to=antonio@meshcoding.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox