ARM: OMAP: clean up some smatch warnings, fix some printk(KERN_ERR ...
Resolve the following warnings from smatch: arch/arm/mach-omap2/gpmc.c:282 gpmc_cs_set_timings() info: why not propagate 'div' from gpmc_cs_calc_divider() instead of -1? arch/arm/mach-omap2/serial.c:328 omap_serial_init_port() error: 'pdev' dereferencing possible ERR_PTR() arch/arm/mach-omap2/timer.c:213 omap2_gp_clockevent_init() Error invalid range 4096 to -1 arch/arm/mach-omap2/gpio.c:63 omap2_gpio_dev_init() warn: possible memory leak of 'pdata' arch/arm/mach-omap2/omap_hwmod.c:1478 _assert_hardreset() warn: assigning -22 to unsigned variable 'ret' arch/arm/mach-omap2/omap_hwmod.c:1487 _assert_hardreset() warn: 4294963201 is more than 255 (max '(ret)' can be) so this is always the same. arch/arm/mach-omap2/omap_hwmod.c:1545 _read_hardreset() warn: assigning -22 to unsigned variable 'ret' arch/arm/mach-omap2/omap_hwmod.c:1554 _read_hardreset() warn: 4294963201 is more than 255 (max '(ret)' can be) so this is always the same. arch/arm/mach-omap2/dpll3xxx.c:629 omap3_clkoutx2_recalc() error: we previously assumed 'pclk' could be null (see line 627) arch/arm/mach-omap2/board-n8x0.c:422 n8x0_mmc_late_init() Error invalid range 14 to 13 arch/arm/mach-omap1/leds-h2p2-debug.c:71 h2p2_dbg_leds_event() error: potentially derefencing uninitialized 'fpga'. arch/arm/plat-omap/mux.c:79 omap_cfg_reg() Error invalid range 4096 to -1 Thanks to Tony Lindgren <tony@atomide.com> for pointing out that BUG() can be disabled. The changes in the first version that removed the subsequent return() after BUG() states have been dropped. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Tony Lindgren <tony@atomide.com>
This commit is contained in:
@@ -1438,8 +1438,8 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
|
||||
* Return the bit position of the reset line that match the
|
||||
* input name. Return -ENOENT if not found.
|
||||
*/
|
||||
static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name,
|
||||
struct omap_hwmod_rst_info *ohri)
|
||||
static int _lookup_hardreset(struct omap_hwmod *oh, const char *name,
|
||||
struct omap_hwmod_rst_info *ohri)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1475,7 +1475,7 @@ static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name,
|
||||
static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
|
||||
{
|
||||
struct omap_hwmod_rst_info ohri;
|
||||
u8 ret = -EINVAL;
|
||||
int ret = -EINVAL;
|
||||
|
||||
if (!oh)
|
||||
return -EINVAL;
|
||||
@@ -1484,7 +1484,7 @@ static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
|
||||
return -ENOSYS;
|
||||
|
||||
ret = _lookup_hardreset(oh, name, &ohri);
|
||||
if (IS_ERR_VALUE(ret))
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = soc_ops.assert_hardreset(oh, &ohri);
|
||||
@@ -1542,7 +1542,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
|
||||
static int _read_hardreset(struct omap_hwmod *oh, const char *name)
|
||||
{
|
||||
struct omap_hwmod_rst_info ohri;
|
||||
u8 ret = -EINVAL;
|
||||
int ret = -EINVAL;
|
||||
|
||||
if (!oh)
|
||||
return -EINVAL;
|
||||
@@ -1551,7 +1551,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
|
||||
return -ENOSYS;
|
||||
|
||||
ret = _lookup_hardreset(oh, name, &ohri);
|
||||
if (IS_ERR_VALUE(ret))
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return soc_ops.is_hardreset_asserted(oh, &ohri);
|
||||
|
||||
Reference in New Issue
Block a user