diff options
author | Sachin Nikam <snikam@nvidia.com> | 2010-05-12 12:52:55 +0530 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-05-12 19:40:40 -0700 |
commit | f08aaa2cefd32204ab8c0010454756a34df06c52 (patch) | |
tree | dc330820d155d92606a046ab1b9da0109896af2b | |
parent | bae2012ac2c01124c6e102b3d2e7fb623169a965 (diff) |
warnings: Cleaning up compilation warnings from tegra code
Bug 682070
warnings like:
- defined but not used
- unused variable
- format type
- control reaches to the end of non-void function
Image builds and boots properly after these changes.
Change-Id: I91578a9684b42fcf9652cf76e492f1020194e6e6
Reviewed-on: http://git-master/r/1339
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Tested-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board_nvodm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/include/nvcommon.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/iovmm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/localtimer.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/nvrm/dispatch/nvrm_transport_dispatch.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_rtc.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/timer.c | 2 | ||||
-rw-r--r-- | drivers/input/keyboard/tegra-kbc.c | 8 | ||||
-rw-r--r-- | drivers/mtd/devices/tegra_mtd_nand.c | 11 | ||||
-rw-r--r-- | drivers/power/nvec_battery.c | 6 |
10 files changed, 23 insertions, 22 deletions
diff --git a/arch/arm/mach-tegra/board_nvodm.c b/arch/arm/mach-tegra/board_nvodm.c index f13f503a3683..bc3be0e24ef6 100644 --- a/arch/arm/mach-tegra/board_nvodm.c +++ b/arch/arm/mach-tegra/board_nvodm.c @@ -495,8 +495,6 @@ static struct spi_board_info tegra_spi_ipc_devices[] __initdata = static void __init register_spi_ipc_devices(void) { - NvError err; - NvU32 irq; NvU32 instance = 0xFFFF; NvU32 cs = 0xFFFF; const NvOdmPeripheralConnectivity *pConnectivity = NULL; diff --git a/arch/arm/mach-tegra/include/nvcommon.h b/arch/arm/mach-tegra/include/nvcommon.h index 4936555d80a4..93c97c387c21 100644 --- a/arch/arm/mach-tegra/include/nvcommon.h +++ b/arch/arm/mach-tegra/include/nvcommon.h @@ -225,6 +225,10 @@ typedef NvS32 NvSPtr; * This macro wraps its argument with the equivalent of "#if NV_DEBUG", but * also can be used where "#ifdef"'s can't, like inside a macro. */ +#ifndef NV_DEBUG +#define NV_DEBUG 0 +#endif + #if NV_DEBUG #define NV_DEBUG_CODE(x) x #else diff --git a/arch/arm/mach-tegra/iovmm.c b/arch/arm/mach-tegra/iovmm.c index a2f99806946d..5c64734d6341 100644 --- a/arch/arm/mach-tegra/iovmm.c +++ b/arch/arm/mach-tegra/iovmm.c @@ -534,7 +534,7 @@ int tegra_iovmm_client_lock(struct tegra_iovmm_client *client) { int ret; - if (!client) return; + if (!client) return -EINVAL; ret = wait_event_interruptible(client->domain->delay_lock, _iovmm_client_lock(client)!=-EAGAIN); diff --git a/arch/arm/mach-tegra/localtimer.c b/arch/arm/mach-tegra/localtimer.c index 58bef261ab0a..ee7d690f782c 100644 --- a/arch/arm/mach-tegra/localtimer.c +++ b/arch/arm/mach-tegra/localtimer.c @@ -62,7 +62,7 @@ void local_timer_rescale(unsigned long cpu_freq_khz) if (cpu_freq_scale_mult == 0) { cpu_freq_scale_mult = ((timer_prescaler + 1) << CPU_FREQ_SCALE_SHIFT) / cpu_freq_khz; - printk("Local timer scaling factor %d, shift %d\n", + printk("Local timer scaling factor %lu, shift %d\n", cpu_freq_scale_mult, CPU_FREQ_SCALE_SHIFT); return; } diff --git a/arch/arm/mach-tegra/nvrm/dispatch/nvrm_transport_dispatch.c b/arch/arm/mach-tegra/nvrm/dispatch/nvrm_transport_dispatch.c index 0ab58edd8f17..d3da88180177 100644 --- a/arch/arm/mach-tegra/nvrm/dispatch/nvrm_transport_dispatch.c +++ b/arch/arm/mach-tegra/nvrm/dispatch/nvrm_transport_dispatch.c @@ -572,7 +572,7 @@ static NvError NvRmTransportGetPortName_dispatch_( void *InBuffer, NvU32 InSize, } } clean: - if ( PortName != PortNameBuff ) + if ( PortName != (NvU8 *)PortNameBuff ) NvOsFree( PortName ); return err_; } @@ -624,7 +624,7 @@ static NvError NvRmTransportOpen_dispatch_( void *InBuffer, NvU32 InSize, void * p_out->ret_ = NvRmTransportOpen( p_in->hRmDevice, pPortName, RecvMessageSemaphore, &p_out->phTransport ); clean: - if( pPortName != PortNameBuff ) + if( pPortName != (char *)PortNameBuff ) NvOsFree( pPortName ); NvOsSemaphoreDestroy( RecvMessageSemaphore ); return err_; diff --git a/arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_rtc.c b/arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_rtc.c index 88bfa06fa940..1c4d61a01a98 100644 --- a/arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_rtc.c +++ b/arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_rtc.c @@ -163,7 +163,9 @@ Max8907bRtcCountWrite( NvU8 BcdDD, BcdMM, BcdYY1, BcdYY2; NvU16 YYYY; struct rtc_time tm; +#if NV_DEBUG NvU32 data1; +#endif NVODMPMU_PRINTF(("\n Rtc write count=0x%x ", Count)); // convert seconds since reference time into date @@ -224,6 +226,8 @@ Max8907bRtcCountWrite( NVODMPMU_PRINTF(("\n Max8907bRtcCountWrite() error. ")); return NV_FALSE; } + + return NV_TRUE; } NvBool diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c index 07810db19891..3664fde41357 100644 --- a/arch/arm/mach-tegra/timer.c +++ b/arch/arm/mach-tegra/timer.c @@ -174,7 +174,7 @@ static unsigned long measure_input_freq(unsigned int *m, unsigned int *n) static void __init tegra_timer_init(void) { void __iomem *tmr; - unsigned int m, n; + unsigned int m = 0, n = 0; unsigned long val; tmr = IO_ADDRESS(TEGRA_TMR1_BASE + TIMERUS_OFFS); diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index efd584dcd125..98781d04d9ac 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -212,7 +212,7 @@ static void tegra_kbc_report_keys(struct tegra_kbc *kbc, int *fifo) u32 kp_ent_val[(KBC_MAX_KPENT + 3) / 4]; u32 *kp_ents = kp_ent_val; u32 kp_ent; - unsigned long flags; + unsigned long flags = 0; int i, j, valid=0; local_irq_save(flags); @@ -261,7 +261,7 @@ static void tegra_kbc_report_keys(struct tegra_kbc *kbc, int *fifo) static void tegra_kbc_key_repeat(struct work_struct *work) { struct tegra_kbc *kbc; - unsigned long flags; + unsigned long flags = 0; u32 val; int fifo[KBC_MAX_KPENT]; int i; @@ -294,7 +294,7 @@ static void tegra_kbc_key_repeat(struct work_struct *work) static void tegra_kbc_close(struct input_dev *dev) { struct tegra_kbc *kbc = input_get_drvdata(dev); - unsigned long flags; + unsigned long flags = 0; u32 val; spin_lock_irqsave(&kbc->lock, flags); @@ -366,7 +366,7 @@ static void tegra_kbc_config_pins(struct tegra_kbc *kbc) static int tegra_kbc_open(struct input_dev *dev) { struct tegra_kbc *kbc = input_get_drvdata(dev); - unsigned long flags; + unsigned long flags = 0; u32 val = 0; enable_power(kbc); diff --git a/drivers/mtd/devices/tegra_mtd_nand.c b/drivers/mtd/devices/tegra_mtd_nand.c index 6af0b3176dc8..e10d3030cedd 100644 --- a/drivers/mtd/devices/tegra_mtd_nand.c +++ b/drivers/mtd/devices/tegra_mtd_nand.c @@ -289,8 +289,8 @@ static int tegra_nand_erase(struct mtd_info *mtd, struct erase_info *instr) for (i=0;i<NDFLASH_CS_MAX;i++) pageNumbers[i] = -1; - pr_debug("tegra_nand_erase: addr=0x%08x len=%d\n", instr->addr, - instr->len); + pr_debug("tegra_nand_erase: addr=0x%08x len=%d\n", (unsigned int)instr->addr, + (int)instr->len); if ((instr->addr + instr->len) > mtd->size) { pr_err("tegra_nand_erase: Can't erase past end of device\n"); @@ -667,10 +667,8 @@ static int tegra_nand_write_oob(struct mtd_info *mtd, loff_t to, return do_write_oob(mtd, to, ops); } -static int tegra_nand_suspend(struct platform_device *dev, - pm_message_t state) +static int tegra_nand_suspend(struct mtd_info *mtd) { - struct mtd_info *mtd = platform_get_drvdata(dev); NvError Err; /* Call ddk suspend API */ @@ -686,9 +684,8 @@ static int tegra_nand_suspend(struct platform_device *dev, return 0; } -static int tegra_nand_resume(struct platform_device *dev) +static int tegra_nand_resume(struct mtd_info *mtd) { - struct mtd_info *mtd = platform_get_drvdata(dev); NvError Err; /* call Ddk resume code */ diff --git a/drivers/power/nvec_battery.c b/drivers/power/nvec_battery.c index f9d8c8b41b43..bf38a0be1250 100644 --- a/drivers/power/nvec_battery.c +++ b/drivers/power/nvec_battery.c @@ -176,7 +176,7 @@ static struct device_attribute tegra_battery_attr = { .store = tegra_battery_store_property, }; -void NvBatteryEventHandlerThread(void) +void NvBatteryEventHandlerThread(void *args) { NvU8 BatteryState = 0, BatteryEvent = 0; @@ -588,7 +588,7 @@ Cleanup: return -1; } -static int nvec_battery_remove(struct nvec_device *pdev) +static void nvec_battery_remove(struct nvec_device *pdev) { unsigned int i = 0; @@ -621,8 +621,6 @@ static int nvec_battery_remove(struct nvec_device *pdev) batt_dev = NULL; } - - return 0; } static int nvec_battery_suspend(struct nvec_device *dev, |