powerpc/sparse: Make a bunch of things static
authorDaniel Axtens <dja@axtens.net>
Tue, 6 Sep 2016 05:32:40 +0000 (15:32 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 13 Sep 2016 07:35:47 +0000 (17:35 +1000)
Squash a bunch of sparse warnings by making things static.

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
22 files changed:
arch/powerpc/kernel/module.c
arch/powerpc/kernel/nvram_64.c
arch/powerpc/oprofile/cell/spu_profiler.c
arch/powerpc/oprofile/cell/spu_task_sync.c
arch/powerpc/perf/core-book3s.c
arch/powerpc/perf/hv-gpci.c
arch/powerpc/perf/power7-pmu.c
arch/powerpc/perf/power8-pmu.c
arch/powerpc/perf/power9-pmu.c
arch/powerpc/platforms/cell/cbe_regs.c
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/cell/ras.c
arch/powerpc/platforms/maple/setup.c
arch/powerpc/platforms/pasemi/gpio_mdio.c
arch/powerpc/platforms/pasemi/iommu.c
arch/powerpc/platforms/pasemi/setup.c
arch/powerpc/platforms/powermac/pfunc_core.c
arch/powerpc/platforms/powermac/smp.c
arch/powerpc/platforms/powernv/npu-dma.c
arch/powerpc/platforms/pseries/dlpar.c
arch/powerpc/platforms/pseries/scanlog.c
arch/powerpc/sysdev/mmio_nvram.c

index d1f1b35bf0c72b098b45c83e9cbf3480db03f01e..30b89d5cbb0378989a50ba7fb182bbfb887421c3 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/sort.h>
 #include <asm/setup.h>
 
-LIST_HEAD(module_bug_list);
+static LIST_HEAD(module_bug_list);
 
 static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
                                    const Elf_Shdr *sechdrs,
index 64174bf95611456e1a05d8c09f875e84b3c7331b..46c3c76f171b84088c0b819bb95b3386a75679b4 100644 (file)
@@ -851,7 +851,7 @@ static long dev_nvram_ioctl(struct file *file, unsigned int cmd,
        }
 }
 
-const struct file_operations nvram_fops = {
+static const struct file_operations nvram_fops = {
        .owner          = THIS_MODULE,
        .llseek         = dev_nvram_llseek,
        .read           = dev_nvram_read,
index b129d007e7fe34355de00d171d0a1282c3e05517..b19265de91784158abcb17c3e6fed4282c30bae6 100644 (file)
@@ -43,7 +43,7 @@ static unsigned int profiling_interval;
 #define SPU_PC_MASK         0xFFFF
 
 DEFINE_SPINLOCK(oprof_spu_smpl_arry_lck);
-unsigned long oprof_spu_smpl_arry_lck_flags;
+static unsigned long oprof_spu_smpl_arry_lck_flags;
 
 void set_spu_profiling_frequency(unsigned int freq_khz, unsigned int cycles_reset)
 {
index ef2142ff7dbd30a3e8b933b395ca99210d16b9f4..83d2b4ef7f0de61297fcd1dbc5b37bf2dc9478e1 100644 (file)
@@ -36,7 +36,7 @@
 static DEFINE_SPINLOCK(buffer_lock);
 static DEFINE_SPINLOCK(cache_lock);
 static int num_spu_nodes;
-int spu_prof_num_nodes;
+static int spu_prof_num_nodes;
 
 struct spu_buffer spu_buff[MAX_NUMNODES * SPUS_PER_NODE];
 struct delayed_work spu_work;
@@ -88,7 +88,7 @@ static void spu_buff_add(unsigned long int value, int spu)
 /* This function copies the per SPU buffers to the
  * OProfile kernel buffer.
  */
-void sync_spu_buff(void)
+static void sync_spu_buff(void)
 {
        int spu;
        unsigned long flags;
index 4ed377f0f7b232e891d2d1f33d055ea43bae2020..72c27b8d2cf3240f201eabeb723afcdb0ff9b0de 100644 (file)
@@ -2158,7 +2158,7 @@ static void perf_event_interrupt(struct pt_regs *regs)
                irq_exit();
 }
 
-int power_pmu_prepare_cpu(unsigned int cpu)
+static int power_pmu_prepare_cpu(unsigned int cpu)
 {
        struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
 
index 7aa37236bb70bf38ae4d4bb2cc5e9e118d1ad5da..43fabb3cae0fa2cd1895732332f8929cb88e147e 100644 (file)
@@ -131,7 +131,7 @@ static const struct attribute_group *attr_groups[] = {
 #define HGPCI_MAX_DATA_BYTES \
        (HGPCI_REQ_BUFFER_SIZE - sizeof(struct hv_get_perf_counter_info_params))
 
-DEFINE_PER_CPU(char, hv_gpci_reqb[HGPCI_REQ_BUFFER_SIZE]) __aligned(sizeof(uint64_t));
+static DEFINE_PER_CPU(char, hv_gpci_reqb[HGPCI_REQ_BUFFER_SIZE]) __aligned(sizeof(uint64_t));
 
 struct hv_gpci_request_buffer {
        struct hv_get_perf_counter_info_params params;
index a383c23a907048df6b3c3dee72704179b9cba584..7963658dbc22f8294a4f8aa54475c2f2d521aa09 100644 (file)
@@ -416,7 +416,7 @@ static struct attribute *power7_pmu_format_attr[] = {
        NULL,
 };
 
-struct attribute_group power7_pmu_format_group = {
+static struct attribute_group power7_pmu_format_group = {
        .name = "format",
        .attrs = power7_pmu_format_attr,
 };
index 5fde2b192fec280aa5abb61342a3d268c342dc59..ab830d106ec57ff48d703c555c9c1f49eba2b004 100644 (file)
@@ -204,7 +204,7 @@ static struct attribute *power8_pmu_format_attr[] = {
        NULL,
 };
 
-struct attribute_group power8_pmu_format_group = {
+static struct attribute_group power8_pmu_format_group = {
        .name = "format",
        .attrs = power8_pmu_format_attr,
 };
index 7883463038529a3fef60ccf8a2f9a4d5aa3d0334..8e9a81967ff8516b8c04d47e65df92c7daeeba1c 100644 (file)
@@ -119,7 +119,7 @@ static struct attribute *power9_pmu_format_attr[] = {
        NULL,
 };
 
-struct attribute_group power9_pmu_format_group = {
+static struct attribute_group power9_pmu_format_group = {
        .name = "format",
        .attrs = power9_pmu_format_attr,
 };
index 1428d583c238ccd270e260e131b92e3748ec7346..b926438d73af7deb317d8ccc2a83dec7c75cc7af 100644 (file)
@@ -189,7 +189,7 @@ static struct device_node *cbe_get_be_node(int cpu_id)
        return NULL;
 }
 
-void __init cbe_fill_regs_map(struct cbe_regs_map *map)
+static void __init cbe_fill_regs_map(struct cbe_regs_map *map)
 {
        if(map->be_node) {
                struct device_node *be, *np;
index f7d1a4953ea092cd98204bbce25a40bb56e37716..640772af9bcba810d51a9f9b7cf195b92aff813e 100644 (file)
@@ -651,7 +651,7 @@ static int dma_fixed_dma_supported(struct device *dev, u64 mask)
 
 static int dma_set_mask_and_switch(struct device *dev, u64 dma_mask);
 
-struct dma_map_ops dma_iommu_fixed_ops = {
+static struct dma_map_ops dma_iommu_fixed_ops = {
        .alloc          = dma_fixed_alloc_coherent,
        .free           = dma_fixed_free_coherent,
        .map_sg         = dma_fixed_map_sg,
index 2d4f60c0119aa72bdf0e63c5fa8c6d49b8c1968a..460ab392f0e791ff2c73d561ccd4c5b2fac92018 100644 (file)
@@ -298,7 +298,7 @@ int cbe_sysreset_hack(void)
 }
 #endif /* CONFIG_PPC_IBM_CELL_RESETBUTTON */
 
-int __init cbe_ptcal_init(void)
+static int __init cbe_ptcal_init(void)
 {
        int ret;
        ptcal_start_tok = rtas_token("ibm,cbe-start-ptcal");
index 3c30c7a4534ddc02cad6f760488c0c59482f00ba..b7f937563827d91a3f0e331d1b87f5a7ed536787 100644 (file)
@@ -156,7 +156,7 @@ static void __noreturn maple_halt(void)
 }
 
 #ifdef CONFIG_SMP
-struct smp_ops_t maple_smp_ops = {
+static struct smp_ops_t maple_smp_ops = {
        .probe          = smp_mpic_probe,
        .message_pass   = smp_mpic_message_pass,
        .kick_cpu       = smp_generic_kick_cpu,
@@ -176,7 +176,7 @@ static void __init maple_use_rtas_reboot_and_halt_if_present(void)
        }
 }
 
-void __init maple_setup_arch(void)
+static void __init maple_setup_arch(void)
 {
        /* init to some ~sane value until calibrate_delay() runs */
        loops_per_jiffy = 50000000;
index ddf635000c6b7d526460f8f5b19eaad712052313..c23e60959aa84c04810cec2e0d6d82443f7dff3e 100644 (file)
@@ -306,7 +306,7 @@ static struct platform_driver gpio_mdio_driver =
        },
 };
 
-int gpio_mdio_init(void)
+static int gpio_mdio_init(void)
 {
        struct device_node *np;
 
@@ -326,7 +326,7 @@ int gpio_mdio_init(void)
 }
 module_init(gpio_mdio_init);
 
-void gpio_mdio_exit(void)
+static void gpio_mdio_exit(void)
 {
        platform_driver_unregister(&gpio_mdio_driver);
        if (gpio_regs)
index c61667e8bb06c51385fbe21c18b288aeb889f2da..e74adc4e7fd8ead2b6a8b9eb8bcf5a51be694041 100644 (file)
@@ -199,7 +199,7 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev)
        set_iommu_table_base(&dev->dev, &iommu_table_iobmap);
 }
 
-int __init iob_init(struct device_node *dn)
+static int __init iob_init(struct device_node *dn)
 {
        unsigned long tmp;
        u32 regword;
index e86c1bd08f1f6ef09472f92204058998fc8e16ed..1d0c3a621a38b578e7fd1db7e32f22b3744e00ff 100644 (file)
@@ -105,7 +105,7 @@ static void pas_take_timebase(void)
        arch_spin_unlock(&timebase_lock);
 }
 
-struct smp_ops_t pas_smp_ops = {
+static struct smp_ops_t pas_smp_ops = {
        .probe          = smp_mpic_probe,
        .message_pass   = smp_mpic_message_pass,
        .kick_cpu       = smp_generic_kick_cpu,
@@ -115,7 +115,7 @@ struct smp_ops_t pas_smp_ops = {
 };
 #endif /* CONFIG_SMP */
 
-void __init pas_setup_arch(void)
+static void __init pas_setup_arch(void)
 {
 #ifdef CONFIG_SMP
        /* Setup SMP callback */
index 43075081721f7ea93c51240bc92a5b73573e4759..695e8c4d4224de4ebbae3d0c4e1616b6d5b21456 100644 (file)
@@ -804,7 +804,7 @@ void pmf_unregister_driver(struct device_node *np)
 }
 EXPORT_SYMBOL_GPL(pmf_unregister_driver);
 
-struct pmf_function *__pmf_find_function(struct device_node *target,
+static struct pmf_function *__pmf_find_function(struct device_node *target,
                                         const char *name, u32 flags)
 {
        struct device_node *actor = of_node_get(target);
index 834868b9fdc99af91b802fa0d51580ca6375e5ae..5a8564c2092a8f6c6524f3c1b19d9ebaeb6d3b54 100644 (file)
@@ -979,7 +979,7 @@ static void pmac_cpu_die(void)
 #endif /* CONFIG_HOTPLUG_CPU */
 
 /* Core99 Macs (dual G4s and G5s) */
-struct smp_ops_t core99_smp_ops = {
+static struct smp_ops_t core99_smp_ops = {
        .message_pass   = smp_mpic_message_pass,
        .probe          = smp_core99_probe,
 #ifdef CONFIG_PPC64
index 00e1a0195c78c13432c0a1ddf9349111038720a6..aec85e778028232fdd275bd318bbba7c7ff40fd4 100644 (file)
@@ -115,7 +115,7 @@ static u64 dma_npu_get_required_mask(struct device *dev)
        return 0;
 }
 
-struct dma_map_ops dma_npu_ops = {
+static struct dma_map_ops dma_npu_ops = {
        .map_page               = dma_npu_map_page,
        .map_sg                 = dma_npu_map_sg,
        .alloc                  = dma_npu_alloc,
index 4748124faa10e9e82448b59fadceac9a17385bf7..2511ccf186af5e8109e869e647f927ede8c8cbfa 100644 (file)
@@ -27,7 +27,7 @@
 #include <asm/uaccess.h>
 #include <asm/rtas.h>
 
-struct workqueue_struct *pseries_hp_wq;
+static struct workqueue_struct *pseries_hp_wq;
 
 struct pseries_hp_work {
        struct work_struct work;
@@ -377,7 +377,7 @@ static int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_elog)
        return rc;
 }
 
-void pseries_hp_work_fn(struct work_struct *work)
+static void pseries_hp_work_fn(struct work_struct *work)
 {
        struct pseries_hp_work *hp_work =
                        container_of(work, struct pseries_hp_work, work);
index b502ab61aafa897e30261fac7cd5d0492617a098..7d28cabf1206080695792c1ce59f3ab1447237dd 100644 (file)
@@ -156,7 +156,7 @@ static int scanlog_release(struct inode * inode, struct file * file)
        return 0;
 }
 
-const struct file_operations scanlog_fops = {
+static const struct file_operations scanlog_fops = {
        .owner          = THIS_MODULE,
        .read           = scanlog_read,
        .write          = scanlog_write,
index 69f5814ae6d42684c753db9a29f4ece7d5054a7e..c31f634f197344ed4d59df3a99470fd6ddafbc54 100644 (file)
@@ -89,7 +89,7 @@ static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index)
        return count;
 }
 
-void mmio_nvram_write_val(int addr, unsigned char val)
+static void mmio_nvram_write_val(int addr, unsigned char val)
 {
        unsigned long flags;