Skip to content

Commit

Permalink
Merge tag 'omap-cleanup-a2-for-3.5' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/pjw/omap-pending into cleanup-sparse

Resolve static analysis warnings generated by files in
arch/arm/mach-omap1, arch/arm/mach-omap2, and arch/arm/plat-omap.
Fixes all but one sparse warning and most of the useful
cppcheck warnings (excepting the warnings generated by the
dmtimer integration code which is going up via 3.4-rc fixes)
  • Loading branch information
Tony Lindgren committed Apr 18, 2012
2 parents e816b57 + eeb3711 commit 09f45b8
Show file tree
Hide file tree
Showing 53 changed files with 161 additions and 165 deletions.
13 changes: 9 additions & 4 deletions arch/arm/mach-omap1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ endif

obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o

# OCPI interconnect support for 1710, 1610 and 5912
obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o

# Power Management
obj-$(CONFIG_PM) += pm.o sleep.o

Expand All @@ -28,13 +31,15 @@ usb-fs-$(CONFIG_USB) := usb.o
obj-y += $(usb-fs-m) $(usb-fs-y)

# Specific board support
obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o board-h2-mmc.o
obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o board-h2-mmc.o \
board-nand.o
obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o
obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
obj-$(CONFIG_MACH_OMAP_PERSEUS2) += board-perseus2.o
obj-$(CONFIG_MACH_OMAP_FSAMPLE) += board-fsample.o
obj-$(CONFIG_MACH_OMAP_PERSEUS2) += board-perseus2.o board-nand.o
obj-$(CONFIG_MACH_OMAP_FSAMPLE) += board-fsample.o board-nand.o
obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o
obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o board-h3-mmc.o
obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o board-h3-mmc.o \
board-nand.o
obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o
obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o
obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/ams-delta-fiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void __init ams_delta_init_fiq(void)
}

retval = request_irq(INT_DEFERRED_FIQ, deferred_fiq,
IRQ_TYPE_EDGE_RISING, "deferred_fiq", 0);
IRQ_TYPE_EDGE_RISING, "deferred_fiq", NULL);
if (retval < 0) {
pr_err("Failed to get deferred_fiq IRQ, ret=%d\n", retval);
release_fiq(&fh);
Expand Down
16 changes: 1 addition & 15 deletions arch/arm/mach-omap1/board-fsample.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,6 @@ static struct platform_device nor_device = {
.resource = &nor_resource,
};

static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{
struct nand_chip *this = mtd->priv;
unsigned long mask;

if (cmd == NAND_CMD_NONE)
return;

mask = (ctrl & NAND_CLE) ? 0x02 : 0;
if (ctrl & NAND_ALE)
mask |= 0x04;
writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
}

#define FSAMPLE_NAND_RB_GPIO_PIN 62

static int nand_dev_ready(struct mtd_info *mtd)
Expand All @@ -216,7 +202,7 @@ static struct platform_nand_data nand_data = {
.part_probe_types = part_probes,
},
.ctrl = {
.cmd_ctrl = nand_cmd_ctl,
.cmd_ctrl = omap1_nand_cmd_ctl,
.dev_ready = nand_dev_ready,
},
};
Expand Down
17 changes: 1 addition & 16 deletions arch/arm/mach-omap1/board-h2.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,6 @@ static struct mtd_partition h2_nand_partitions[] = {
},
};

static void h2_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{
struct nand_chip *this = mtd->priv;
unsigned long mask;

if (cmd == NAND_CMD_NONE)
return;

mask = (ctrl & NAND_CLE) ? 0x02 : 0;
if (ctrl & NAND_ALE)
mask |= 0x04;
writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
}

#define H2_NAND_RB_GPIO_PIN 62

static int h2_nand_dev_ready(struct mtd_info *mtd)
Expand All @@ -212,9 +198,8 @@ static struct platform_nand_data h2_nand_platdata = {
.part_probe_types = h2_part_probes,
},
.ctrl = {
.cmd_ctrl = h2_nand_cmd_ctl,
.cmd_ctrl = omap1_nand_cmd_ctl,
.dev_ready = h2_nand_dev_ready,

},
};

Expand Down
16 changes: 1 addition & 15 deletions arch/arm/mach-omap1/board-h3.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,6 @@ static struct mtd_partition nand_partitions[] = {
},
};

static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{
struct nand_chip *this = mtd->priv;
unsigned long mask;

if (cmd == NAND_CMD_NONE)
return;

mask = (ctrl & NAND_CLE) ? 0x02 : 0;
if (ctrl & NAND_ALE)
mask |= 0x04;
writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
}

#define H3_NAND_RB_GPIO_PIN 10

static int nand_dev_ready(struct mtd_info *mtd)
Expand All @@ -214,7 +200,7 @@ static struct platform_nand_data nand_platdata = {
.part_probe_types = part_probes,
},
.ctrl = {
.cmd_ctrl = nand_cmd_ctl,
.cmd_ctrl = omap1_nand_cmd_ctl,
.dev_ready = nand_dev_ready,

},
Expand Down
37 changes: 37 additions & 0 deletions arch/arm/mach-omap1/board-nand.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* linux/arch/arm/mach-omap1/board-nand.c
*
* Common OMAP1 board NAND code
*
* Copyright (C) 2004, 2012 Texas Instruments, Inc.
* Copyright (C) 2002 MontaVista Software, Inc.
* Copyright (C) 2001 RidgeRun, Inc.
* Author: RidgeRun, Inc.
* Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>

#include "common.h"

void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{
struct nand_chip *this = mtd->priv;
unsigned long mask;

if (cmd == NAND_CMD_NONE)
return;

mask = (ctrl & NAND_CLE) ? 0x02 : 0;
if (ctrl & NAND_ALE)
mask |= 0x04;

writeb(cmd, this->IO_ADDR_W + mask);
}

4 changes: 2 additions & 2 deletions arch/arm/mach-omap1/board-palmz71.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ palmz71_gpio_setup(int early)
gpio_direction_input(PALMZ71_USBDETECT_GPIO);
if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
palmz71_powercable, IRQF_SAMPLE_RANDOM,
"palmz71-cable", 0))
"palmz71-cable", NULL))
printk(KERN_ERR
"IRQ request for power cable failed!\n");
palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 0);
palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), NULL);
}
}

Expand Down
16 changes: 1 addition & 15 deletions arch/arm/mach-omap1/board-perseus2.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,6 @@ static struct platform_device nor_device = {
.resource = &nor_resource,
};

static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{
struct nand_chip *this = mtd->priv;
unsigned long mask;

if (cmd == NAND_CMD_NONE)
return;

mask = (ctrl & NAND_CLE) ? 0x02 : 0;
if (ctrl & NAND_ALE)
mask |= 0x04;
writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
}

#define P2_NAND_RB_GPIO_PIN 62

static int nand_dev_ready(struct mtd_info *mtd)
Expand All @@ -174,7 +160,7 @@ static struct platform_nand_data nand_data = {
.part_probe_types = part_probes,
},
.ctrl = {
.cmd_ctrl = nand_cmd_ctl,
.cmd_ctrl = omap1_nand_cmd_ctl,
.dev_ready = nand_dev_ready,
},
};
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-omap1/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ int omap1_select_table_rate(struct clk *clk, unsigned long rate)
{
/* Find the highest supported frequency <= rate and switch to it */
struct mpu_rate * ptr;
unsigned long dpll1_rate, ref_rate;
unsigned long ref_rate;

dpll1_rate = ck_dpll1_p->rate;
ref_rate = ck_ref_p->rate;

for (ptr = omap1_rate_table; ptr->rate; ptr++) {
Expand Down
11 changes: 10 additions & 1 deletion arch/arm/mach-omap1/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define __ARCH_ARM_MACH_OMAP1_COMMON_H

#include <plat/common.h>
#include <linux/mtd/mtd.h>

#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
void omap7xx_map_io(void);
Expand Down Expand Up @@ -56,8 +57,16 @@ void omap1_init_early(void);
void omap1_init_irq(void);
void omap1_restart(char, const char *);

extern void __init omap_check_revision(void);

extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
unsigned int ctrl);

extern struct sys_timer omap1_timer;
extern bool omap_32k_timer_init(void);
extern void __init omap_init_consistent_dma_size(void);

extern u32 omap_irq_flags;

extern int ocpi_enable(void);

#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/fpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static void fpga_mask_ack_irq(struct irq_data *d)
fpga_ack_irq(d);
}

void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc)
static void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc)
{
u32 stat;
int fpga_irq;
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-omap1/id.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include <mach/hardware.h>

#include "common.h"

#define OMAP_DIE_ID_0 0xfffe1800
#define OMAP_DIE_ID_1 0xfffe1804
#define OMAP_PRODUCTION_ID_0 0xfffe2000
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-omap1/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@

#include <plat/mux.h>
#include <plat/tc.h>
#include <plat/dma.h>

#include "iomap.h"
#include "common.h"
#include "clock.h"

extern void omap_check_revision(void);

/*
* The machine specific code may provide the extra mapping besides the
* default mapping provided here.
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-omap1/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

#include <mach/hardware.h>

#include "common.h"

#define IRQ_BANK(irq) ((irq) >> 5)
#define IRQ_BIT(irq) ((irq) & 0x1f)

Expand Down
7 changes: 1 addition & 6 deletions arch/arm/mach-omap1/lcd_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static struct lcd_dma_info {
void *cb_data;

int active;
unsigned long addr, size;
unsigned long addr;
int rotate, data_type, xres, yres;
int vxres;
int mirror;
Expand All @@ -77,11 +77,6 @@ void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
}
EXPORT_SYMBOL(omap_set_lcd_dma_b1);

void omap_set_lcd_dma_src_port(int port)
{
lcd_dma.src_port = port;
}

void omap_set_lcd_dma_ext_controller(int external)
{
lcd_dma.ext_ctrl = external;
Expand Down
7 changes: 5 additions & 2 deletions arch/arm/plat-omap/ocpi.c → arch/arm/mach-omap1/ocpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Minimal OCP bus support for omap16xx
*
* Copyright (C) 2003 - 2005 Nokia Corporation
* Copyright (C) 2012 Texas Instruments, Inc.
* Written by Tony Lindgren <tony@atomide.com>
*
* Modified for clock framework by Paul Mundt <paul.mundt@nokia.com>.
Expand Down Expand Up @@ -35,6 +36,8 @@

#include <mach/hardware.h>

#include "common.h"

#define OCPI_BASE 0xfffec320
#define OCPI_FAULT (OCPI_BASE + 0x00)
#define OCPI_CMD_FAULT (OCPI_BASE + 0x04)
Expand Down Expand Up @@ -64,7 +67,7 @@ int ocpi_enable(void)
/* Enable access for OHCI in OCPI */
val = omap_readl(OCPI_PROT);
val &= ~0xff;
//val &= (1 << 0); /* Allow access only to EMIFS */
/* val &= (1 << 0); Allow access only to EMIFS */
omap_writel(val, OCPI_PROT);

val = omap_readl(OCPI_SEC);
Expand All @@ -86,7 +89,7 @@ static int __init omap_ocpi_init(void)

clk_enable(ocpi_ck);
ocpi_enable();
printk("OMAP OCPI interconnect driver loaded\n");
pr_info("OMAP OCPI interconnect driver loaded\n");

return 0;
}
Expand Down
9 changes: 4 additions & 5 deletions arch/arm/mach-omap1/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,10 @@ static int omap_pm_read_proc(

static void omap_pm_init_proc(void)
{
struct proc_dir_entry *entry;

entry = create_proc_read_entry("driver/omap_pm",
S_IWUSR | S_IRUGO, NULL,
omap_pm_read_proc, NULL);
/* XXX Appears to leak memory */
create_proc_read_entry("driver/omap_pm",
S_IWUSR | S_IRUGO, NULL,
omap_pm_read_proc, NULL);
}

#endif /* DEBUG && CONFIG_PROC_FS */
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-omap1/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <mach/hardware.h>

#include "common.h"

void omap1_restart(char mode, const char *cmd)
{
/*
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-omap1/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
return 0;
}


int __init omap1_dm_timer_init(void)
static int __init omap1_dm_timer_init(void)
{
int i;
int ret;
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <plat/mux.h>
#include <plat/usb.h>

#include "common.h"

/* These routines should handle the standard chip-specific modes
* for usb0/1/2 ports, covering basic mux and transceiver setup.
*
Expand Down Expand Up @@ -138,6 +140,7 @@ static inline void ohci_device_init(struct omap_usb_config *pdata)
if (cpu_is_omap7xx())
ohci_resources[1].start = INT_7XX_USB_HHC_1;
pdata->ohci_device = &ohci_device;
pdata->ocpi_enable = &ocpi_enable;
}

#else
Expand Down
Loading

0 comments on commit 09f45b8

Please sign in to comment.