ARM: tegra: resolve compilation time warnings
Sanjay Singh Rawat [Tue, 12 Jun 2012 16:53:56 +0000 (21:53 +0530)]
- Adding flag to treat warning as error.
- Handling warnings of unused variable, structures and functions,
wrong return type, wrong type comparision.

Bug 949219

Change-Id: I9d02387ce1073c4e46f69d01669285aa3754f1d9
Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com>
Reviewed-on: http://git-master/r/104968
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

12 files changed:
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/ahb.c
arch/arm/mach-tegra/board-cardhu.c
arch/arm/mach-tegra/board-enterprise-power.c
arch/arm/mach-tegra/board-kai-kbc.c
arch/arm/mach-tegra/p852/board-p852.c
arch/arm/mach-tegra/pcie.c
arch/arm/mach-tegra/sleep.h
arch/arm/mach-tegra/tegra3_clocks.c
arch/arm/mach-tegra/tegra3_usb_phy.c
arch/arm/mach-tegra/timer-t3.c
include/linux/tegra_audio.h

index e3e33ba..6a563be 100644 (file)
@@ -1,5 +1,7 @@
 GCOV_PROFILE := y
 
+subdir-ccflags-y := -Werror
+
 obj-y                                   += ahb.o
 obj-y                                   += apbio.o
 obj-y                                   += common.o
index b7f3fb5..e27ba58 100644 (file)
@@ -87,9 +87,10 @@ static inline void gizmo_writel(unsigned long value, unsigned long offset)
        writel(value, IO_TO_VIRT(TEGRA_AHB_GIZMO_BASE + offset));
 }
 
+#ifdef CONFIG_PM
+
 static u32 ahb_gizmo[29];
 
-#ifdef CONFIG_PM
 int tegra_ahbgizmo_suspend(void)
 {
        ahb_gizmo[0] = gizmo_readl(AHB_ARBITRATION_DISABLE);
index 458053d..6dc9b90 100644 (file)
@@ -881,6 +881,8 @@ static int __init cardhu_touch_init(void)
        return 0;
 }
 
+#if defined(CONFIG_USB_SUPPORT)
+
 static void cardu_usb_hsic_postsupend(void)
 {
 #ifdef CONFIG_TEGRA_BB_XMM_POWER
@@ -936,7 +938,7 @@ static struct tegra_usb_platform_data tegra_ehci2_hsic_xmm_pdata = {
        },
        .ops = &hsic_xmm_plat_ops,
 };
-
+#endif
 
 static int hsic_enable_gpio = -1;
 static int hsic_reset_gpio = -1;
@@ -998,6 +1000,7 @@ void hsic_power_off(void)
        }
 }
 
+#if defined(CONFIG_USB_SUPPORT)
 static struct tegra_usb_phy_platform_ops hsic_plat_ops = {
        .open = hsic_platform_open,
        .close = hsic_platform_close,
@@ -1050,15 +1053,14 @@ static struct tegra_usb_platform_data tegra_udc_pdata = {
        },
 };
 
-static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
-       .port_otg = true,
+static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
+       .port_otg = false,
        .has_hostpc = true,
        .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
-       .op_mode = TEGRA_USB_OPMODE_HOST,
+       .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "vdd_vbus_micro_usb",
-               .hot_plug = true,
+               .hot_plug = false,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
        },
@@ -1075,14 +1077,15 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        },
 };
 
-static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
+static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
        .port_otg = false,
        .has_hostpc = true,
        .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
-       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .hot_plug = false,
+               .vbus_reg = "vdd_vbus_typea_usb",
+               .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
        },
@@ -1091,7 +1094,7 @@ static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
                .elastic_limit = 16,
                .idle_wait_delay = 17,
                .term_range_adj = 6,
-               .xcvr_setup = 15,
+               .xcvr_setup = 8,
                .xcvr_lsfslew = 2,
                .xcvr_lsrslew = 2,
                .xcvr_setup_offset = 0,
@@ -1099,14 +1102,14 @@ static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
        },
 };
 
-static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
-       .port_otg = false,
+static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
+       .port_otg = true,
        .has_hostpc = true,
        .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
-       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "vdd_vbus_typea_usb",
+               .vbus_reg = "vdd_vbus_micro_usb",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -1116,7 +1119,7 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
                .elastic_limit = 16,
                .idle_wait_delay = 17,
                .term_range_adj = 6,
-               .xcvr_setup = 8,
+               .xcvr_setup = 15,
                .xcvr_lsfslew = 2,
                .xcvr_lsrslew = 2,
                .xcvr_setup_offset = 0,
@@ -1128,8 +1131,9 @@ static struct tegra_usb_otg_data tegra_otg_pdata = {
        .ehci_device = &tegra_ehci1_device,
        .ehci_pdata = &tegra_ehci1_utmi_pdata,
 };
+#endif
 
-#if CONFIG_USB_SUPPORT
+#if defined(CONFIG_USB_SUPPORT)
 static void cardhu_usb_init(void)
 {
        struct board_info bi;
index 5e5d407..042cfbb 100644 (file)
@@ -664,7 +664,6 @@ static struct platform_device *gpio_regs_devices[] = {
 
 static int __init enterprise_fixed_regulator_init(void)
 {
-       int i;
        struct board_info board_info;
        struct platform_device **fixed_regs_devices;
        int nfixreg_devs;
@@ -679,17 +678,11 @@ static int __init enterprise_fixed_regulator_init(void)
                nfixreg_devs = ARRAY_SIZE(fixed_regs_devices_a03);
        }
 
-       for (i = 0; i < nfixreg_devs; ++i) {
-               struct fixed_voltage_config *fixed_reg_pdata =
-                               fixed_regs_devices[i]->dev.platform_data;
-       }
        return platform_add_devices(fixed_regs_devices, nfixreg_devs);
 }
 
 static int __init enterprise_gpio_regulator_init(void)
 {
-       int i, j;
-
        return platform_add_devices(gpio_regs_devices,
                                    ARRAY_SIZE(gpio_regs_devices));
 }
index e55383a..7f0efdf 100644 (file)
@@ -86,10 +86,7 @@ static struct platform_device kai_keys_device = {
 
 int __init kai_keys_init(void)
 {
-       int i;
-
        pr_info("Registering gpio keys\n");
-
        platform_device_register(&kai_keys_device);
 
        return 0;
index ffdf5d3..039d9db 100644 (file)
@@ -682,10 +682,6 @@ static void __init p852_uart_init(void)
        }
 }
 
-static struct platform_device generic_codec_driver = {
-       .name = "generic-dit",
-};
-
 static void __init p852_flash_init(void)
 {
        if (p852_sku_peripherals & P852_SKU_NAND_ENABLE)
index 68e0fda..94ac556 100644 (file)
@@ -944,6 +944,7 @@ err_exit:
        return err;
 }
 
+#ifdef CONFIG_PM
 static int tegra_pcie_power_on(void)
 {
        int err = 0;
@@ -962,6 +963,7 @@ static int tegra_pcie_power_on(void)
 err_exit:
        return err;
 }
+#endif
 
 static int tegra_pcie_power_off(void)
 {
@@ -1310,6 +1312,7 @@ static int tegra_pci_probe(struct platform_device *pdev)
        return ret;
 }
 
+#ifdef CONFIG_PM
 static int tegra_pcie_save_state(struct pci_dev *pdev, int ndev)
 {
        int size;
@@ -1393,6 +1396,7 @@ static int tegra_pci_suspend(struct device *dev)
 
        return tegra_pcie_power_off();
 }
+
 static int tegra_pci_resume_noirq(struct device *dev)
 {
        struct pci_dev *pdev = NULL;
@@ -1432,6 +1436,7 @@ static int tegra_pci_resume(struct device *dev)
 
        return ret;
 }
+#endif
 
 static int tegra_pci_remove(struct platform_device *pdev)
 {
index 2557c3f..7d086e0 100644 (file)
@@ -209,8 +209,8 @@ void tegra_sleep_cpu_save(unsigned long v2p);
 void tegra_resume(void);
 
 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
-extern void tegra2_iram_start;
-extern void tegra2_iram_end;
+extern unsigned int tegra2_iram_start;
+extern unsigned int tegra2_iram_end;
 int  tegra2_cpu_is_resettable_soon(void);
 void tegra2_cpu_reset(int cpu);
 void tegra2_cpu_set_resettable_soon(void);
@@ -219,8 +219,8 @@ void tegra2_sleep_core(unsigned long v2p);
 void tegra2_hotplug_shutdown(void);
 void tegra2_sleep_wfi(unsigned long v2p);
 #else
-extern void tegra3_iram_start;
-extern void tegra3_iram_end;
+extern unsigned int tegra3_iram_start;
+extern unsigned int tegra3_iram_end;
 void tegra3_sleep_core(unsigned long v2p);
 void tegra3_sleep_cpu_secondary(unsigned long v2p);
 void tegra3_hotplug_shutdown(void);
index 9ff1833..4349901 100644 (file)
@@ -1692,12 +1692,14 @@ static void tegra3_pllp_clk_init(struct clk *c)
        tegra3_pllp_init_dependencies(c->u.pll.fixed_rate);
 }
 
+#if defined(CONFIG_PM_SLEEP)
 static void tegra3_pllp_clk_resume(struct clk *c)
 {
        unsigned long rate = c->u.pll.fixed_rate;
        tegra3_pll_clk_init(c);
        BUG_ON(rate != c->u.pll.fixed_rate);
 }
+#endif
 
 static struct clk_ops tegra_pllp_ops = {
        .init                   = tegra3_pllp_clk_init,
index 338b7e6..7253a15 100644 (file)
@@ -1076,8 +1076,9 @@ static unsigned int utmi_phy_xcvr_setup_value(struct tegra_usb_phy *phy)
        if (cfg->xcvr_use_fuses) {
                val = XCVR_SETUP(tegra_fuse_readl(FUSE_USB_CALIB_0));
                if (cfg->xcvr_use_lsb) {
-                       val = min(((val & XCVR_SETUP_LSB_MASK) + cfg->xcvr_setup_offset),
-                                       XCVR_SETUP_LSB_MAX_VAL);
+                       val = min((unsigned int) ((val & XCVR_SETUP_LSB_MASK)
+                               + cfg->xcvr_setup_offset),
+                               (unsigned int) XCVR_SETUP_LSB_MAX_VAL);
                        val |= (cfg->xcvr_setup & XCVR_SETUP_MSB_MASK);
                } else {
                        if (cfg->xcvr_setup_offset <= UTMIP_XCVR_MAX_OFFSET)
index df964fb..f23873b 100644 (file)
 #define TIMER6_OFFSET (TEGRA_TMR6_BASE-TEGRA_TMR1_BASE)
 
 static void __iomem *timer_reg_base = IO_ADDRESS(TEGRA_TMR1_BASE);
-static cpumask_t wake_timer_ready;
+
+#if defined(CONFIG_PM_SLEEP)
 static cpumask_t wake_timer_canceled;
+#if defined(CONFIG_HOTPLUG_CPU)
+static cpumask_t wake_timer_ready;
+#endif
+#endif
 
 #define timer_writel(value, reg) \
        __raw_writel(value, (u32)timer_reg_base + (reg))
index ddc9c93..650b0ac 100644 (file)
@@ -78,7 +78,7 @@ struct dam_srate {
 #ifdef CONFIG_SND_SOC_TEGRA
 extern bool tegra_is_voice_call_active(void);
 #else
-static inline bool tegra_is_voice_call_active()
+static inline bool tegra_is_voice_call_active(void)
 {
        return false;
 }