Skip to content

Commit

Permalink
fabric/info: Cleanup fi_info source
Browse files Browse the repository at this point in the history
Move braces, add static, etc.

Signed-off-by: Sean Hefty <[email protected]>
  • Loading branch information
shefty committed Jun 26, 2015
1 parent fc72f18 commit 80709a4
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions util/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static const char *help_strings[][2] = {
{"", ""}
};

void usage()
static void usage(void)
{
int i = 0;
const struct option *ptr = longopts;
Expand All @@ -93,7 +93,7 @@ void usage()
#define ORCASE(SYM) \
do { if (strcmp(#SYM, inputstr) == 0) return SYM; } while (0);

uint64_t str2cap(char *inputstr)
static uint64_t str2cap(char *inputstr)
{
ORCASE(FI_MSG);
ORCASE(FI_RMA);
Expand Down Expand Up @@ -128,7 +128,7 @@ uint64_t str2cap(char *inputstr)
return 0;
}

uint64_t str2mode(char *inputstr)
static uint64_t str2mode(char *inputstr)
{
ORCASE(FI_CONTEXT);
ORCASE(FI_LOCAL_MR);
Expand All @@ -139,7 +139,7 @@ uint64_t str2mode(char *inputstr)
return 0;
}

enum fi_ep_type str2ep_type(char *inputstr)
static enum fi_ep_type str2ep_type(char *inputstr)
{
ORCASE(FI_EP_UNSPEC);
ORCASE(FI_EP_MSG);
Expand All @@ -150,7 +150,7 @@ enum fi_ep_type str2ep_type(char *inputstr)
return FI_EP_UNSPEC;
}

uint32_t str2addr_format(char *inputstr)
static uint32_t str2addr_format(char *inputstr)
{
ORCASE(FI_FORMAT_UNSPEC);
ORCASE(FI_SOCKADDR);
Expand All @@ -162,7 +162,7 @@ uint32_t str2addr_format(char *inputstr)
return FI_FORMAT_UNSPEC;
}

uint64_t tokparse(char *caps, uint64_t (*str2flag) (char *inputstr))
static uint64_t tokparse(char *caps, uint64_t (*str2flag) (char *inputstr))
{
uint64_t flags = 0;
char *tok;
Expand All @@ -173,7 +173,8 @@ uint64_t tokparse(char *caps, uint64_t (*str2flag) (char *inputstr))
return flags;
}

int print_vars() {
static int print_vars(void)
{
int ret, count;
struct fi_param *params;
char delim;
Expand Down Expand Up @@ -201,7 +202,8 @@ int print_vars() {
return ret;
}

int print_short_info(struct fi_info *info) {
static int print_short_info(struct fi_info *info)
{
for (struct fi_info *cur = info; cur; cur = cur->next) {
printf("%s: %s\n", cur->fabric_attr->prov_name, cur->fabric_attr->name);
printf(" version: %d.%d\n", FI_MAJOR(cur->fabric_attr->prov_version),
Expand All @@ -212,7 +214,8 @@ int print_short_info(struct fi_info *info) {
return EXIT_SUCCESS;
}

int print_long_info(struct fi_info *info) {
static int print_long_info(struct fi_info *info)
{
for (struct fi_info *cur = info; cur; cur = cur->next) {
printf("---\n");
printf("%s", fi_tostr(cur, FI_TYPE_INFO));
Expand Down

0 comments on commit 80709a4

Please sign in to comment.