Signed-off-by: Mark Rustad <[email protected]>
---
fcoeadm_display.c | 12 ++++++------
fcoemon.c | 14 +++++++-------
fcping.c | 8 +++-----
fipvlan.c | 38 ++++++++++++++++++++------------------
lib/sa_log.c | 6 ------
libopenfcoe.c | 6 +++---
6 files changed, 39 insertions(+), 45 deletions(-)
diff --git a/fcoeadm_display.c b/fcoeadm_display.c
index 0b8be4a..287e370 100644
--- a/fcoeadm_display.c
+++ b/fcoeadm_display.c
@@ -1015,7 +1015,7 @@ static void hba_table_list_destroy(struct
hba_name_table_list *hba_table_list)
hba_table_list = NULL;
}
-static enum fcoe_status fcoeadm_loadhba()
+static enum fcoe_status fcoeadm_loadhba(void)
{
if (HBA_STATUS_OK != HBA_LoadLibrary())
return EHBAAPIERR;
@@ -1403,7 +1403,7 @@ out:
static struct sa_table fcoe_ctlr_table;
-void print_fcoe_fcf_device(void *ep, UNUSED void *arg)
+static void print_fcoe_fcf_device(void *ep, UNUSED void *arg)
{
struct fcoe_fcf_device *fcf = (struct fcoe_fcf_device *)ep;
char temp[MAX_STR_LEN];
@@ -1429,7 +1429,7 @@ void print_fcoe_fcf_device(void *ep, UNUSED void *arg)
printf("\n");
}
-void print_interface_fcoe_fcf_device(void *ep, void *arg)
+static void print_interface_fcoe_fcf_device(void *ep, void *arg)
{
struct fcoe_ctlr_device *ctlr = (struct fcoe_ctlr_device *)ep;
const char *ifname = arg;
@@ -1466,7 +1466,7 @@ enum fcoe_status display_fcf_info(const char *ifname)
return rc;
}
-void print_interface_fcoe_lesb_stats(void *ep, void *arg)
+static void print_interface_fcoe_lesb_stats(void *ep, void *arg)
{
struct fcoe_ctlr_device *ctlr = (struct fcoe_ctlr_device *)ep;
const char *ifname = arg;
@@ -1482,8 +1482,8 @@ void print_interface_fcoe_lesb_stats(void *ep, void *arg)
}
}
-void print_interface_fcoe_lesb_stats_header(const char *ifname,
- int interval)
+static void
+print_interface_fcoe_lesb_stats_header(const char *ifname, int interval)
{
printf("\n");
printf("%-7s interval: %-2d\n", ifname, interval);
diff --git a/fcoemon.c b/fcoemon.c
index babba56..21ee3fd 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -927,7 +927,7 @@ static int fcm_link_init(void)
static struct fcoe_port *
fcm_port_create(char *ifname, enum clif_flags flags, int cmd);
-struct fcoe_port *fcm_new_vlan(int ifindex, int vid, bool vn2vn)
+static struct fcoe_port *fcm_new_vlan(int ifindex, int vid, bool vn2vn)
{
char real_name[IFNAMSIZ];
char vlan_name[IFNAMSIZ];
@@ -957,8 +957,8 @@ struct fcoe_port *fcm_new_vlan(int ifindex, int vid, bool
vn2vn)
return p;
}
-
-int fcm_vlan_disc_handler(struct fiphdr *fh, struct sockaddr_ll *sa, void *arg)
+static int
+fcm_vlan_disc_handler(struct fiphdr *fh, struct sockaddr_ll *sa, void *arg)
{
int vid;
unsigned char mac[ETHER_ADDR_LEN];
@@ -1098,7 +1098,7 @@ static void fcm_vlan_dev_real_dev(char *vlan_ifname, char
*real_ifname)
* This function parses the linkinfo rtattr and returns
* 1 if it is kind vlan otherwise returns 0.
*/
-int fcm_is_linkinfo_vlan(struct rtattr *ap)
+static int fcm_is_linkinfo_vlan(struct rtattr *ap)
{
struct rtattr *info;
int len;
@@ -1579,7 +1579,7 @@ static int fcoe_vid_from_ifname(const char *ifname)
return -1;
}
-void fcm_process_link_msg(struct ifinfomsg *ip, int len, unsigned type)
+static void fcm_process_link_msg(struct ifinfomsg *ip, int len, unsigned type)
{
struct fcoe_port *p;
struct rtattr *ap;
@@ -2923,7 +2923,7 @@ void fcm_vlan_disc_timeout(void *arg)
sa_timer_set(&p->vlan_disc_timer, FCM_VLAN_DISC_TIMEOUT);
}
-int fcm_start_vlan_disc(struct fcoe_port *p)
+static int fcm_start_vlan_disc(struct fcoe_port *p)
{
int s;
if (p->fip_socket < 0) {
@@ -3164,7 +3164,7 @@ static void fcm_netif_advance(struct fcm_netif *ff)
* as necessary with a CREATE or DESTROY next action.
* 2. Process FCoE port list - handle next actions, update states, clean up
*/
-static void fcm_handle_changes()
+static void fcm_handle_changes(void)
{
struct fcm_netif *ff;
struct fcoe_port *p;
diff --git a/fcping.c b/fcping.c
index 8e9e7ed..18369a2 100644
--- a/fcping.c
+++ b/fcping.c
@@ -78,8 +78,7 @@ static const char *cmdname;
#define FC_WKA_FABRIC_CONTROLLER ((fc_fid_t)0xfffffd)
#define FC_WKA_DIRECTORY_SERVICE ((fc_fid_t)0xfffffc)
-static void
-fp_usage()
+static void fp_usage(void)
{
fprintf(stderr,
"Usage: %s [ -fqx ] [ -i <interval> ] [ -c <count> ] -h <hba> "
@@ -677,8 +676,7 @@ fp_ns_get_id(uint32_t op, fc_wwn_t wwn, char *response,
size_t *resp_len)
return 0;
}
-static int
-fp_lookup_target()
+static int fp_lookup_target(void)
{
char response[32];
size_t resp_len;
@@ -782,7 +780,7 @@ out:
* (default to be FC_MAX_PAYLOAD). For any FCID that is in FC-LS Table 30 WKA,
* use FP_LEN_MAX for ECHO data, i.e., FC_MAX_PAYLOAD - 4.
*/
-static void fp_check_data_len()
+static void fp_check_data_len(void)
{
fc_fid_t sid;
uint32_t slen = 0;
diff --git a/fipvlan.c b/fipvlan.c
index c6ed7c6..6f8cf39 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -87,7 +87,7 @@ char *exe;
static struct pollfd *pfd = NULL;
static int pfd_len = 0;
-void pfd_add(int fd)
+static void pfd_add(int fd)
{
struct pollfd *npfd;
int i;
@@ -107,7 +107,7 @@ void pfd_add(int fd)
pfd_len++;
}
-void pfd_remove(int fd)
+static void pfd_remove(int fd)
{
struct pollfd *npfd;
int i;
@@ -169,7 +169,7 @@ static struct fcf *lookup_fcf(struct fcf_list_head *head,
int ifindex,
return NULL;
}
-struct iff *lookup_iff(int ifindex, char *ifname)
+static struct iff *lookup_iff(int ifindex, const char *ifname)
{
struct iff *iff;
struct iff *vlan;
@@ -190,7 +190,7 @@ struct iff *lookup_iff(int ifindex, char *ifname)
return NULL;
}
-struct iff *lookup_vlan(int ifindex, short int vid)
+static struct iff *lookup_vlan(int ifindex, short int vid)
{
struct iff *real_dev, *vlan;
TAILQ_FOREACH(real_dev, &interfaces, list_node)
@@ -201,7 +201,7 @@ struct iff *lookup_vlan(int ifindex, short int vid)
return NULL;
}
-struct iff *find_vlan_real_dev(struct iff *vlan)
+static struct iff *find_vlan_real_dev(struct iff *vlan)
{
struct iff *real_dev;
TAILQ_FOREACH(real_dev, &interfaces, list_node) {
@@ -232,7 +232,8 @@ struct fip_tlv_ptrs {
* @len: total length of all TLVs, in double words
* @tlv_ptrs: pointers to type specific structures to fill out
*/
-unsigned int fip_parse_tlvs(void *ptr, int len, struct fip_tlv_ptrs *tlv_ptrs)
+static unsigned int
+fip_parse_tlvs(void *ptr, int len, struct fip_tlv_ptrs *tlv_ptrs)
{
struct fip_tlv_hdr *tlv = ptr;
unsigned int bitmap = 0;
@@ -286,6 +287,7 @@ static int fip_recv_vlan_note(struct fiphdr *fh, int
ifindex, bool vn2vn)
required_tlvs = (1 << FIP_TLV_MAC_ADDR) | (1 << FIP_TLV_VLAN);
+ tlvs.mac = NULL; /* Silence incorrect GCC warning */
bitmap = fip_parse_tlvs((fh + 1), len, &tlvs);
if ((bitmap & required_tlvs) != required_tlvs)
return -1;
@@ -319,8 +321,8 @@ static int fip_recv_vlan_note(struct fiphdr *fh, int
ifindex, bool vn2vn)
return 0;
}
-int fip_vlan_handler(struct fiphdr *fh, struct sockaddr_ll *sa,
- UNUSED void *arg)
+static int fip_vlan_handler(struct fiphdr *fh, struct sockaddr_ll *sa,
+ UNUSED void *arg)
{
/* We only care about VLAN Notifications */
if (ntohs(fh->fip_proto) != FIP_PROTO_VLAN) {
@@ -353,7 +355,7 @@ int fip_vlan_handler(struct fiphdr *fh, struct sockaddr_ll
*sa,
* rtnl_recv_newlink - parse response to RTM_GETLINK, or an RTM_NEWLINK event
* @nh: netlink message header, beginning of received netlink frame
*/
-void rtnl_recv_newlink(struct nlmsghdr *nh)
+static void rtnl_recv_newlink(struct nlmsghdr *nh)
{
struct ifinfomsg *ifm = NLMSG_DATA(nh);
struct rtattr *ifla[__IFLA_MAX];
@@ -467,7 +469,7 @@ static void help(int status)
exit(status);
}
-void parse_cmdline(int argc, char **argv)
+static void parse_cmdline(int argc, char **argv)
{
char c;
@@ -527,7 +529,7 @@ void parse_cmdline(int argc, char **argv)
config.namec = argc - optind;
}
-int rtnl_listener_handler(struct nlmsghdr *nh, UNUSED void *arg)
+static int rtnl_listener_handler(struct nlmsghdr *nh, UNUSED void *arg)
{
switch (nh->nlmsg_type) {
case RTM_NEWLINK:
@@ -653,7 +655,7 @@ static int fcoe_bus_instance_start(const char *ifname)
return 0;
}
-void determine_libfcoe_interface()
+static void determine_libfcoe_interface(void)
{
if (!access(FCOE_BUS_CREATE, F_OK)) {
FIP_LOG_DBG("Using /sys/bus/fcoe interfaces\n");
@@ -728,7 +730,7 @@ static int print_results(void)
return 0;
}
-void recv_loop(int timeout)
+static void recv_loop(int timeout)
{
int i;
int rc;
@@ -753,7 +755,7 @@ void recv_loop(int timeout)
}
}
-void find_interfaces(int ns)
+static void find_interfaces(int ns)
{
send_getlink_dump(ns);
rtnl_recv(ns, rtnl_listener_handler, NULL);
@@ -799,7 +801,7 @@ static int probe_fip_interface(struct iff *iff)
return 0;
}
-int send_vlan_requests(void)
+static int send_vlan_requests(void)
{
struct iff *iff;
int i;
@@ -822,7 +824,7 @@ int send_vlan_requests(void)
return skipped;
}
-void do_vlan_discovery(void)
+static void do_vlan_discovery(void)
{
struct iff *iff;
int retry_count = 0;
@@ -847,7 +849,7 @@ retry:
}
}
-void cleanup_interfaces(void)
+static void cleanup_interfaces(void)
{
struct iff *iff;
int i;
@@ -887,7 +889,7 @@ static inline int capget(cap_user_header_t hdrp,
cap_user_data_t datap)
return syscall(__NR_capget, hdrp, datap);
}
-int checkcaps()
+static int checkcaps(void)
{
struct __user_cap_header_struct caphdr = {
.version = _LINUX_CAPABILITY_VERSION_3,
diff --git a/lib/sa_log.c b/lib/sa_log.c
index 65f7e40..3659e44 100644
--- a/lib/sa_log.c
+++ b/lib/sa_log.c
@@ -154,12 +154,6 @@ u_int sa_log_flags; /* timestamp and
other option flags */
int sa_log_time_delta_min = 1; /* minimum diff to print in millisec */
char *sa_log_prefix; /* string to print before any message
*/
-void
-sa_log_set_option(u_int flags)
-{
- sa_log_flags = flags;
-}
-
/*
* Put timestamp on front of each log line, as controlled by tunables above.
*/
diff --git a/libopenfcoe.c b/libopenfcoe.c
index 94a37e3..07090d5 100644
--- a/libopenfcoe.c
+++ b/libopenfcoe.c
@@ -114,7 +114,7 @@ static void read_fcoe_fcf_device(void *ep, UNUSED void *arg)
sa_sys_read_u32(fcf->path, "vlan_id", &fcf->vlan_id);
}
-void read_fcoe_fcf(void *ep, UNUSED void *arg)
+static void read_fcoe_fcf(void *ep, UNUSED void *arg)
{
struct fcoe_ctlr_device *ctlr = (struct fcoe_ctlr_device *)ep;
@@ -125,7 +125,7 @@ void read_fcoe_fcf(void *ep, UNUSED void *arg)
sa_table_iterate(&ctlr->fcfs, read_fcoe_fcf_device, NULL);
}
-void free_fcoe_fcf_device(void *ep, UNUSED void *arg)
+static void free_fcoe_fcf_device(void *ep, UNUSED void *arg)
{
struct fcoe_fcf_device *fcf = (struct fcoe_fcf_device *)ep;
@@ -147,7 +147,7 @@ static int find_fchost(struct dirent *dp, void *arg)
return 0;
}
-int read_fcoe_ctlr_device(struct dirent *dp, void *arg)
+static int read_fcoe_ctlr_device(struct dirent *dp, void *arg)
{
struct sa_table *ctlrs = arg;
struct fcoe_ctlr_device *ctlr;
_______________________________________________
fcoe-devel mailing list
[email protected]
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel