From c726646010b1928464d05d05ebf051fd175fda91 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Wed, 9 Jun 2021 17:29:09 +0200 Subject: [PATCH] wireless: nxstyle fixes fixes for the style errors reported by nxstyle Signed-off-by: Alin Jerpelea --- wireless/bluetooth/btsak/btsak_advertise.c | 9 ++++-- wireless/bluetooth/btsak/btsak_features.c | 4 ++- wireless/bluetooth/btsak/btsak_info.c | 32 +++++++++---------- wireless/bluetooth/btsak/btsak_scan.c | 6 ++-- .../libutils/ieee802154_addrtostr.c | 9 +++--- 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/wireless/bluetooth/btsak/btsak_advertise.c b/wireless/bluetooth/btsak/btsak_advertise.c index 5ff576c16..40f5b1e29 100644 --- a/wireless/bluetooth/btsak/btsak_advertise.c +++ b/wireless/bluetooth/btsak/btsak_advertise.c @@ -73,7 +73,8 @@ static void btsak_advertise_showusage(FAR const char *progname, * ****************************************************************************/ -static void btsak_cmd_advertisestart(FAR struct btsak_s *btsak, FAR char *cmd, +static void btsak_cmd_advertisestart(FAR struct btsak_s *btsak, + FAR char *cmd, int argc, FAR char *argv[]) { struct btreq_s btreq; @@ -193,7 +194,8 @@ static void btsak_cmd_advertisestop(FAR struct btsak_s *btsak, FAR char *cmd, * ****************************************************************************/ -void btsak_cmd_advertise(FAR struct btsak_s *btsak, int argc, FAR char *argv[]) +void btsak_cmd_advertise(FAR struct btsak_s *btsak, + int argc, FAR char *argv[]) { int argind; @@ -222,7 +224,8 @@ void btsak_cmd_advertise(FAR struct btsak_s *btsak, int argc, FAR char *argv[]) } else { - fprintf(stderr, "ERROR: Unrecognized advertise command: %s\n", argv[argind]); + fprintf(stderr, + "ERROR: Unrecognized advertise command: %s\n", argv[argind]); btsak_advertise_showusage(btsak->progname, argv[0], EXIT_FAILURE); } } diff --git a/wireless/bluetooth/btsak/btsak_features.c b/wireless/bluetooth/btsak/btsak_features.c index 624b6c0a9..ece355f5d 100644 --- a/wireless/bluetooth/btsak/btsak_features.c +++ b/wireless/bluetooth/btsak/btsak_features.c @@ -76,7 +76,9 @@ static void btsak_features_showusage(FAR const char *progname, * ****************************************************************************/ -void btsak_cmd_features(FAR struct btsak_s *btsak, int argc, FAR char *argv[]) +void btsak_cmd_features(FAR struct btsak_s *btsak, + int argc, + FAR char *argv[]) { struct btreq_s btreq; int sockfd; diff --git a/wireless/bluetooth/btsak/btsak_info.c b/wireless/bluetooth/btsak/btsak_info.c index bafc817af..e8b40ae01 100644 --- a/wireless/bluetooth/btsak/btsak_info.c +++ b/wireless/bluetooth/btsak/btsak_info.c @@ -102,25 +102,25 @@ void btsak_cmd_info(FAR struct btsak_s *btsak, int argc, FAR char *argv[]) errno); } else - { - printf("Device: %s\n", btsak->ifname); - printf("BDAddr: %02x:%02x:%02x:%02x:%02x:%02x\n", + { + printf("Device: %s\n", btsak->ifname); + printf("BDAddr: %02x:%02x:%02x:%02x:%02x:%02x\n", btreq.btr_bdaddr.val[5], btreq.btr_bdaddr.val[4], btreq.btr_bdaddr.val[3], btreq.btr_bdaddr.val[2], btreq.btr_bdaddr.val[1], btreq.btr_bdaddr.val[0]); - printf("Flags: %04x\n", btreq.btr_flags); - printf("Free: %u\n", btreq.btr_num_cmd); - printf(" ACL: %u\n", btreq.btr_num_acl); - printf(" SCO: %u\n", btreq.btr_num_sco); - printf("Max:\n"); - printf(" ACL: %u\n", btreq.btr_max_acl); - printf(" SCO: %u\n", btreq.btr_max_sco); - printf("MTU:\n"); - printf(" ACL: %u\n", btreq.btr_acl_mtu); - printf(" SCO: %u\n", btreq.btr_sco_mtu); - printf("Policy: %u\n", btreq.btr_link_policy); - printf("Type: %u\n", btreq.btr_packet_type); - } + printf("Flags: %04x\n", btreq.btr_flags); + printf("Free: %u\n", btreq.btr_num_cmd); + printf(" ACL: %u\n", btreq.btr_num_acl); + printf(" SCO: %u\n", btreq.btr_num_sco); + printf("Max:\n"); + printf(" ACL: %u\n", btreq.btr_max_acl); + printf(" SCO: %u\n", btreq.btr_max_sco); + printf("MTU:\n"); + printf(" ACL: %u\n", btreq.btr_acl_mtu); + printf(" SCO: %u\n", btreq.btr_sco_mtu); + printf("Policy: %u\n", btreq.btr_link_policy); + printf("Type: %u\n", btreq.btr_packet_type); + } } close(sockfd); diff --git a/wireless/bluetooth/btsak/btsak_scan.c b/wireless/bluetooth/btsak/btsak_scan.c index be0c62537..b56f6224d 100644 --- a/wireless/bluetooth/btsak/btsak_scan.c +++ b/wireless/bluetooth/btsak/btsak_scan.c @@ -58,7 +58,8 @@ static void btsak_scan_showusage(FAR const char *progname, fprintf(stderr, "\t%s %s [-h] \n", progname, cmd); fprintf(stderr, "\nWhere the options do the following:\n\n"); - fprintf(stderr, "\tstart\t- Starts scanning. The -d option enables duplicate\n"); + fprintf(stderr, + "\tstart\t- Starts scanning. The -d option enables duplicate\n"); fprintf(stderr, "\t\t filtering.\n"); fprintf(stderr, "\tget\t- Shows new accumulated scan results\n"); fprintf(stderr, "\tstop\t- Stops scanning\n"); @@ -279,7 +280,8 @@ void btsak_cmd_scan(FAR struct btsak_s *btsak, int argc, FAR char *argv[]) } else { - fprintf(stderr, "ERROR: Unrecognized scan command: %s\n", argv[argind]); + fprintf(stderr, + "ERROR: Unrecognized scan command: %s\n", argv[argind]); btsak_scan_showusage(btsak->progname, argv[0], EXIT_FAILURE); } } diff --git a/wireless/ieee802154/libutils/ieee802154_addrtostr.c b/wireless/ieee802154/libutils/ieee802154_addrtostr.c index c98d074ec..60b480431 100644 --- a/wireless/ieee802154/libutils/ieee802154_addrtostr.c +++ b/wireless/ieee802154/libutils/ieee802154_addrtostr.c @@ -33,13 +33,13 @@ * Public Functions ****************************************************************************/ - int ieee802154_addrtostr(FAR char *buf, int len, FAR struct ieee802154_addr_s *addr) { #if 0 #ifndef CONFIG_BIG_ENDIAN - uint16_t panid = ((addr->panid & 0xff) << 8) | ((addr->panid >> 8) & 0xff); + uint16_t panid = ((addr->panid & 0xff) << 8) | + ((addr->panid >> 8) & 0xff); #else uint16_t panid = addr->panid; #endif @@ -51,7 +51,8 @@ int ieee802154_addrtostr(FAR char *buf, int len, else if (addr->mode == IEEE802154_ADDRMODE_SHORT) { #ifndef CONFIG_BIG_ENDIAN - uint16_t saddr = ((addr->saddr & 0xff) << 8) | ((addr->saddr >> 8) & 0xff); + uint16_t saddr = ((addr->saddr & 0xff) << 8) | + ((addr->saddr >> 8) & 0xff); #else uint16_t saddr = addr->saddr; #endif @@ -71,7 +72,7 @@ int ieee802154_addrtostr(FAR char *buf, int len, } else { - return snprintf(buf,len,""); + return snprintf(buf, len, ""); } return -1;