From 6d13b114c8fd725ce5a1113a5c8a89e7d96b6cf0 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Tue, 12 Jul 2016 10:36:15 +0200 Subject: unused variables: silence compiler warning drivers/media/platform/mxc/capture/ov5640_mipi.c:879:18: warning: 'sclk_rdiv_map' defined but not used [-Wunused-const-variable=] static const int sclk_rdiv_map[] = {1, 2, 4, 8}; ^~~~~~~~~~~~~ drivers/net/usb/usbnet.c:84:19: warning: 'driver_name' defined but not used [-Wunused-const-variable=] static const char driver_name [] = "usbnet"; ^~~~~~~~~~~ fs/cifs/netmisc.c:133:40: warning: 'mapping_table_ERRHRD' defined but not used [-Wunused-const-variable=] static const struct smb_to_posix_error mapping_table_ERRHRD[] = { ^~~~~~~~~~~~~~~~~~~~ kernel/cgroup.c:3839:36: warning: 'cgroup_pidlist_seq_operations' defined but not used [-Wunused-const-variable=] static const struct seq_operations cgroup_pidlist_seq_operations = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ net/core/net-sysfs.c:30:19: warning: 'fmt_long_hex' defined but not used [-Wunused-const-variable=] static const char fmt_long_hex[] = "%#lx\n"; ^~~~~~~~~~~~ net/core/rtnetlink.c:1266:32: warning: 'ifla_vf_policy' defined but not used [-Wunused-const-variable=] static const struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = { ^~~~~~~~~~~~~~ net/core/rtnetlink.c:1262:32: warning: 'ifla_vfinfo_policy' defined but not used [-Wunused-const-variable=] static const struct nla_policy ifla_vfinfo_policy[IFLA_VF_INFO_MAX+1] = { ^~~~~~~~~~~~~~~~~~ net/core/sysctl_net_core.c:26:12: warning: 'one' defined but not used [-Wunused-variable] static int one = 1; ^~~ net/ipv4/ping.c:1148:36: warning: 'ping_v4_seq_ops' defined but not used [-Wunused-const-variable=] static const struct seq_operations ping_v4_seq_ops = { ^~~~~~~~~~~~~~~ net/rfkill/rfkill-gpio.c:187:36: warning: 'rfkill_acpi_match' defined but not used [-Wunused-const-variable=] static const struct acpi_device_id rfkill_acpi_match[] = { drivers/net/wireless/rtlwifi/efuse.c:38:31: warning: 'RTL8712_SDIO_EFUSE_TABLE' defined but not used [-Wunused-const-variable=] static const struct efuse_map RTL8712_SDIO_EFUSE_TABLE[] = { ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/rtlwifi/efuse.c:34:17: warning: 'MAX_PGPKT_SIZE' defined but not used [-Wunused-const-variable=] static const u8 MAX_PGPKT_SIZE = 9; ^~~~~~~~~~~~~~ Signed-off-by: Max Krummenacher Acked-by: Stefan Agner --- drivers/media/platform/mxc/capture/ov5640_mipi.c | 2 +- drivers/net/usb/usbnet.c | 2 +- drivers/net/wireless/rtlwifi/efuse.c | 4 ++-- fs/cifs/netmisc.c | 2 +- kernel/cgroup.c | 2 +- net/core/net-sysfs.c | 2 +- net/core/rtnetlink.c | 5 +++-- net/core/sysctl_net_core.c | 2 +- net/ipv4/arp.c | 2 +- net/ipv4/ping.c | 2 +- net/rfkill/rfkill-gpio.c | 2 +- 11 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/mxc/capture/ov5640_mipi.c b/drivers/media/platform/mxc/capture/ov5640_mipi.c index 3d77dc784362..614ae35b7fe1 100644 --- a/drivers/media/platform/mxc/capture/ov5640_mipi.c +++ b/drivers/media/platform/mxc/capture/ov5640_mipi.c @@ -876,7 +876,7 @@ static void OV5640_stream_off(void) ov5640_write_reg(0x4202, 0x0f); } -static const int sclk_rdiv_map[] = {1, 2, 4, 8}; +static const int sclk_rdiv_map[] __maybe_unused = {1, 2, 4, 8}; static int OV5640_get_sysclk(void) { diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index f9e96c427558..6ffb1e5fe960 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -81,7 +81,7 @@ // randomly generated ethernet address static u8 node_id [ETH_ALEN]; -static const char driver_name [] = "usbnet"; +static const char driver_name [] __maybe_unused = "usbnet"; /* use ethtool to change the level for any given device */ static int msg_level = -1; diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c index 2ffc7298f686..b9de983fa6a7 100644 --- a/drivers/net/wireless/rtlwifi/efuse.c +++ b/drivers/net/wireless/rtlwifi/efuse.c @@ -31,11 +31,11 @@ #include "wifi.h" #include "efuse.h" -static const u8 MAX_PGPKT_SIZE = 9; +static const u8 MAX_PGPKT_SIZE __maybe_unused = 9; static const u8 PGPKT_DATA_SIZE = 8; static const int EFUSE_MAX_SIZE = 512; -static const struct efuse_map RTL8712_SDIO_EFUSE_TABLE[] = { +static const struct efuse_map RTL8712_SDIO_EFUSE_TABLE[] __maybe_unused = { {0, 0, 0, 2}, {0, 1, 0, 2}, {0, 2, 0, 2}, diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 049884552e76..12220f083ba8 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c @@ -130,7 +130,7 @@ static const struct smb_to_posix_error mapping_table_ERRSRV[] = { {0, 0} }; -static const struct smb_to_posix_error mapping_table_ERRHRD[] = { +static const struct smb_to_posix_error mapping_table_ERRHRD[] __maybe_unused = { {0, 0} }; diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 18711f326260..4380ca030574 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -3836,7 +3836,7 @@ static int cgroup_pidlist_show(struct seq_file *s, void *v) * seq_operations functions for iterating on pidlists through seq_file - * independent of whether it's tasks or procs */ -static const struct seq_operations cgroup_pidlist_seq_operations = { +static const struct seq_operations cgroup_pidlist_seq_operations __maybe_unused = { .start = cgroup_pidlist_start, .stop = cgroup_pidlist_stop, .next = cgroup_pidlist_next, diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 93886246a0b4..abcd3c53d0b7 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -27,7 +27,7 @@ #ifdef CONFIG_SYSFS static const char fmt_hex[] = "%#x\n"; -static const char fmt_long_hex[] = "%#lx\n"; +static const char fmt_long_hex[] __maybe_unused = "%#lx\n"; static const char fmt_dec[] = "%d\n"; static const char fmt_udec[] = "%u\n"; static const char fmt_ulong[] = "%lu\n"; diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8aadd6a072a4..ad239f01351f 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1259,11 +1259,12 @@ static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = { [IFLA_INFO_SLAVE_DATA] = { .type = NLA_NESTED }, }; -static const struct nla_policy ifla_vfinfo_policy[IFLA_VF_INFO_MAX+1] = { +static const struct nla_policy ifla_vfinfo_policy[IFLA_VF_INFO_MAX+1] + __maybe_unused= { [IFLA_VF_INFO] = { .type = NLA_NESTED }, }; -static const struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = { +static const struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] __maybe_unused = { [IFLA_VF_MAC] = { .len = sizeof(struct ifla_vf_mac) }, [IFLA_VF_VLAN] = { .len = sizeof(struct ifla_vf_vlan) }, [IFLA_VF_TX_RATE] = { .len = sizeof(struct ifla_vf_tx_rate) }, diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index e731c96eac4b..145b90f77eae 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c @@ -23,7 +23,7 @@ #include static int zero = 0; -static int one = 1; +static int one __maybe_unused = 1; static int ushort_max = USHRT_MAX; static int min_sndbuf = SOCK_MIN_SNDBUF; static int min_rcvbuf = SOCK_MIN_RCVBUF; diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 1a9b99e04465..4856bb26dd91 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -149,7 +149,7 @@ static const struct neigh_ops arp_direct_ops = { .connected_output = neigh_direct_output, }; -static const struct neigh_ops arp_broken_ops = { +static const struct neigh_ops arp_broken_ops __maybe_unused = { .family = AF_INET, .solicit = arp_solicit, .error_report = arp_error_report, diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 1e2e9bf62f1a..2478d8fae18c 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -1145,7 +1145,7 @@ static int ping_v4_seq_show(struct seq_file *seq, void *v) return 0; } -static const struct seq_operations ping_v4_seq_ops = { +static const struct seq_operations ping_v4_seq_ops __maybe_unused= { .show = ping_v4_seq_show, .start = ping_v4_seq_start, .next = ping_seq_next, diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index bd2a5b90400c..06adecaffeca 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -184,7 +184,7 @@ static int rfkill_gpio_remove(struct platform_device *pdev) return 0; } -static const struct acpi_device_id rfkill_acpi_match[] = { +static const struct acpi_device_id rfkill_acpi_match[] __maybe_unused = { { "BCM4752", RFKILL_TYPE_GPS }, { }, }; -- cgit v1.2.3