diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-06-03 16:19:11 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-28 02:44:58 -0400 |
commit | 97ea4ba1f9a20d6e1921ef4d61e2248e82b429fb (patch) | |
tree | f03186f707c856655f735bda3894eb9130ad9604 /net/batman-adv | |
parent | 3964f7285eba48b971b11dc51ba0a6e41cb995b3 (diff) |
batman-adv: Prefix gateway defines with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/bat_sysfs.c | 26 | ||||
-rw-r--r-- | net/batman-adv/gateway_common.h | 6 |
2 files changed, 18 insertions, 14 deletions
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c index 725e7d74f567..a6c27f0621af 100644 --- a/net/batman-adv/bat_sysfs.c +++ b/net/batman-adv/bat_sysfs.c | |||
@@ -361,13 +361,16 @@ static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr, | |||
361 | 361 | ||
362 | switch (atomic_read(&bat_priv->gw_mode)) { | 362 | switch (atomic_read(&bat_priv->gw_mode)) { |
363 | case GW_MODE_CLIENT: | 363 | case GW_MODE_CLIENT: |
364 | bytes_written = sprintf(buff, "%s\n", GW_MODE_CLIENT_NAME); | 364 | bytes_written = sprintf(buff, "%s\n", |
365 | BATADV_GW_MODE_CLIENT_NAME); | ||
365 | break; | 366 | break; |
366 | case GW_MODE_SERVER: | 367 | case GW_MODE_SERVER: |
367 | bytes_written = sprintf(buff, "%s\n", GW_MODE_SERVER_NAME); | 368 | bytes_written = sprintf(buff, "%s\n", |
369 | BATADV_GW_MODE_SERVER_NAME); | ||
368 | break; | 370 | break; |
369 | default: | 371 | default: |
370 | bytes_written = sprintf(buff, "%s\n", GW_MODE_OFF_NAME); | 372 | bytes_written = sprintf(buff, "%s\n", |
373 | BATADV_GW_MODE_OFF_NAME); | ||
371 | break; | 374 | break; |
372 | } | 375 | } |
373 | 376 | ||
@@ -386,15 +389,16 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, | |||
386 | if (buff[count - 1] == '\n') | 389 | if (buff[count - 1] == '\n') |
387 | buff[count - 1] = '\0'; | 390 | buff[count - 1] = '\0'; |
388 | 391 | ||
389 | if (strncmp(buff, GW_MODE_OFF_NAME, strlen(GW_MODE_OFF_NAME)) == 0) | 392 | if (strncmp(buff, BATADV_GW_MODE_OFF_NAME, |
393 | strlen(BATADV_GW_MODE_OFF_NAME)) == 0) | ||
390 | gw_mode_tmp = GW_MODE_OFF; | 394 | gw_mode_tmp = GW_MODE_OFF; |
391 | 395 | ||
392 | if (strncmp(buff, GW_MODE_CLIENT_NAME, | 396 | if (strncmp(buff, BATADV_GW_MODE_CLIENT_NAME, |
393 | strlen(GW_MODE_CLIENT_NAME)) == 0) | 397 | strlen(BATADV_GW_MODE_CLIENT_NAME)) == 0) |
394 | gw_mode_tmp = GW_MODE_CLIENT; | 398 | gw_mode_tmp = GW_MODE_CLIENT; |
395 | 399 | ||
396 | if (strncmp(buff, GW_MODE_SERVER_NAME, | 400 | if (strncmp(buff, BATADV_GW_MODE_SERVER_NAME, |
397 | strlen(GW_MODE_SERVER_NAME)) == 0) | 401 | strlen(BATADV_GW_MODE_SERVER_NAME)) == 0) |
398 | gw_mode_tmp = GW_MODE_SERVER; | 402 | gw_mode_tmp = GW_MODE_SERVER; |
399 | 403 | ||
400 | if (gw_mode_tmp < 0) { | 404 | if (gw_mode_tmp < 0) { |
@@ -409,13 +413,13 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, | |||
409 | 413 | ||
410 | switch (atomic_read(&bat_priv->gw_mode)) { | 414 | switch (atomic_read(&bat_priv->gw_mode)) { |
411 | case GW_MODE_CLIENT: | 415 | case GW_MODE_CLIENT: |
412 | curr_gw_mode_str = GW_MODE_CLIENT_NAME; | 416 | curr_gw_mode_str = BATADV_GW_MODE_CLIENT_NAME; |
413 | break; | 417 | break; |
414 | case GW_MODE_SERVER: | 418 | case GW_MODE_SERVER: |
415 | curr_gw_mode_str = GW_MODE_SERVER_NAME; | 419 | curr_gw_mode_str = BATADV_GW_MODE_SERVER_NAME; |
416 | break; | 420 | break; |
417 | default: | 421 | default: |
418 | curr_gw_mode_str = GW_MODE_OFF_NAME; | 422 | curr_gw_mode_str = BATADV_GW_MODE_OFF_NAME; |
419 | break; | 423 | break; |
420 | } | 424 | } |
421 | 425 | ||
diff --git a/net/batman-adv/gateway_common.h b/net/batman-adv/gateway_common.h index 6f8a4d0cbbb6..31bbc3c070a6 100644 --- a/net/batman-adv/gateway_common.h +++ b/net/batman-adv/gateway_common.h | |||
@@ -26,9 +26,9 @@ enum gw_modes { | |||
26 | GW_MODE_SERVER, | 26 | GW_MODE_SERVER, |
27 | }; | 27 | }; |
28 | 28 | ||
29 | #define GW_MODE_OFF_NAME "off" | 29 | #define BATADV_GW_MODE_OFF_NAME "off" |
30 | #define GW_MODE_CLIENT_NAME "client" | 30 | #define BATADV_GW_MODE_CLIENT_NAME "client" |
31 | #define GW_MODE_SERVER_NAME "server" | 31 | #define BATADV_GW_MODE_SERVER_NAME "server" |
32 | 32 | ||
33 | void batadv_gw_bandwidth_to_kbit(uint8_t gw_class, int *down, int *up); | 33 | void batadv_gw_bandwidth_to_kbit(uint8_t gw_class, int *down, int *up); |
34 | ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff, | 34 | ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff, |