1. 13 4月, 2012 10 次提交
    • P
      ARM: OMAP1: board files: deduplicate and clean some NAND-related code · 31cde044
      Paul Walmsley 提交于
      The H2, H3, Perseus2, and FSample board files all contain the same
      duplicated code to handle NAND commands.  That code is missing
      some casts around conversions from unsigned long to void __iomem *.
      
      Consolidate the duplicated code into a new file,
      arch/arm/mach-omap1/board-nand.c.  Resolve the sparse warnings by
      adding appropriate casts:
      
      arch/arm/mach-omap1/board-h2.c:193:9: warning: incorrect type in argument 1 (different base types)
      arch/arm/mach-omap1/board-h2.c:193:9:    expected void const volatile [noderef] <asn:2>*<noident>
      arch/arm/mach-omap1/board-h2.c:193:9:    got unsigned long
      arch/arm/mach-omap1/board-perseus2.c:157:9: warning: incorrect type in argument 1 (different base types)
      arch/arm/mach-omap1/board-perseus2.c:157:9:    expected void const volatile [noderef] <asn:2>*<noident>
      arch/arm/mach-omap1/board-perseus2.c:157:9:    got unsigned long
      arch/arm/mach-omap1/board-fsample.c:199:9: warning: incorrect type in argument 1 (different base types)
      arch/arm/mach-omap1/board-fsample.c:199:9:    expected void const volatile [noderef] <asn:2>*<noident>
      arch/arm/mach-omap1/board-fsample.c:199:9:    got unsigned long
      arch/arm/mach-omap1/board-h3.c:195:9: warning: incorrect type in argument 1 (different base types)
      arch/arm/mach-omap1/board-h3.c:195:9:    expected void const volatile [noderef] <asn:2>*<noident>
      arch/arm/mach-omap1/board-h3.c:195:9:    got unsigned long
      
      Thanks to Arnd Bergmann <arnd@arndb.de> for suggesting a cleaner
      implementation of omap1_nand_cmd_ctl(), avoiding some casts.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Brian Swetland <swetland@google.com>
      Cc: Imre Deak <imre.deak@nokia.com>
      Cc: Greg Lonnon <glonnon@ridgerun.com>
      Cc: Kevin Hilman <kjh@hilman.org>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      31cde044
    • P
      ARM: OMAP: USB: remove unnecessary sideways include · 6cc1a738
      Paul Walmsley 提交于
      Remove the include of mach-omap2/common.h from plat-omap/usb.c.  It
      appears to be unneeded.  Removing it also resolves the sparse warning:
      
      arch/arm/plat-omap/../mach-omap2/common.h:183:12: warning: symbol 'omap_intc_of_init' was not declared. Should it be static?
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      6cc1a738
    • P
      ARM: OMAP: DMA: use constant array maximum, drop some LCD DMA code · bc4d8b5f
      Paul Walmsley 提交于
      gcc can apparently handle stack-allocated arrays that use a dynamic
      variable as the array maximum.  Rather than using a mutable quantity,
      simply use a constant maximum possible size.  To me, code clarity is
      improved; and it also avoids the following sparse warnings:
      
      arch/arm/plat-omap/dma.c:886:40: error: bad constant expression
      arch/arm/plat-omap/dma.c:892:17: error: cannot size expression
      arch/arm/plat-omap/dma.c:970:40: error: bad constant expression
      arch/arm/plat-omap/dma.c:972:17: error: cannot size expression
      
      Also drop some dead code from the OMAP1 LCD DMA code:
      
      arch/arm/mach-omap1/lcd_dma.c:80:6: warning: symbol 'omap_set_lcd_dma_src_port' was not declared. Should it be static?
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      bc4d8b5f
    • P
      ARM: OMAP: OCM RAM: use memset_io() when clearing SRAM · 7cc0442c
      Paul Walmsley 提交于
      We currently treat the OCM RAM memory as memory that hangs off an
      I/O bus, so use memset_io() to clear it rather than memset().
      This also takes care of this sparse warning:
      
      arch/arm/plat-omap/sram.c:199:9: warning: cast removes address space of expression
      
      There is still one SRAM-related sparse warning, but it appears that
      fixing it correctly will take some time and thought.
      
      N.B., at some point, the OCM RAM IP block interface code should probably
      be reimplemented as an MTD device or something similar under drivers/.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      7cc0442c
    • P
      ARM: OMAP: fix 'using plain integer as NULL pointer' sparse warnings · a7022d60
      Paul Walmsley 提交于
      sparse warns when 0 is passed to a function expecting a pointer argument.
      Resolve these warnings by replacing the 0 with NULL.
      
      arch/arm/plat-omap/include/plat/dmtimer.h:319:34: warning: Using plain integer as NULL pointer
      arch/arm/plat-omap/include/plat/dmtimer.h:324:35: warning: Using plain integer as NULL pointer
      arch/arm/mach-omap2/irq.c:294:22: warning: Using plain integer as NULL pointer
      arch/arm/mach-omap1/board-palmz71.c:292:50: warning: Using plain integer as NULL pointer
      arch/arm/mach-omap1/board-palmz71.c:295:73: warning: Using plain integer as NULL pointer
      arch/arm/mach-omap1/ams-delta-fiq.c:105:63: warning: Using plain integer as NULL pointer
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      a7022d60
    • P
      ARM: OMAP2+: GPMC: resolve type-conversion warning from sparse · 355f8eee
      Paul Walmsley 提交于
      arch/arm/mach-omap2/gpmc.c passes a return value from ioremap() as the
      fifth argument to request_irq() without casting it.  This causes
      sparse to generate the following warning:
      
      arch/arm/mach-omap2/gpmc.c:759:63: warning: incorrect type in argument 5 (different address spaces)
      arch/arm/mach-omap2/gpmc.c:759:63:    expected void *dev
      arch/arm/mach-omap2/gpmc.c:759:63:    got void [noderef] <asn:2>*static [toplevel] [assigned] gpmc_base
      
      It turns out that it's not necessary to pass this.  gpmc_base is a
      file-scoped static variable, the ISR is located in the same file ... and
      the ISR doesn't even touch the passed-in variable.  So, just replace it with
      NULL in request_irq().
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      355f8eee
    • P
      ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus · d3645d39
      Paul Walmsley 提交于
      The OMAP1 OHCI driver needs to enable the OCPI IP block before it can
      work.  Previously, the driver was simply calling a symbol defined in
      the OMAP platform code, but this is incorrect: drivers should be fully
      decoupled from platform and architecture code.
      
      So instead, modify the driver to call through a platform_data function
      pointer instead.  We skip any DT aspect, since OMAP1 is not scheduled
      to be converted to DT in the near future.
      
      This resolves the following sparse warning:
      
      It also gets rid of a cpu_is_omap16xx() call in a driver.
      
      In the long term, it probably makes sense to move the OCPI bus code to
      somewhere under drivers/.  This should avoid the whole platform_data/DT
      issue with this function.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Anand Gadiyar <gadiyar@ti.com>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      d3645d39
    • P
      ARM: OMAP1: OCPI: move to mach-omap1/ · 6f3c1af2
      Paul Walmsley 提交于
      Move the OMAP1 OCPI "bus" code to arch/arm/mach-omap1, since it is
      only used on OMAP1 devices.  In the long term, it probably makes sense
      to move the OCPI bus code to somewhere under drivers/.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Tony Lindgren <tony@atomide.com>
      6f3c1af2
    • P
      ARM: OMAP: add includes for missing prototypes · e2ed89fc
      Paul Walmsley 提交于
      Several C files in arch/arm/mach-omap* and arch/arm/plat-omap declare
      functions that are used by other files, but don't include the header
      file where the prototype is declared.  This results in the following
      warnings from sparse:
      
          arch/arm/mach-omap2/irq.c:114:5: warning: symbol 'omap_irq_pending' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:186:13: warning: symbol 'omap2_init_irq' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:191:13: warning: symbol 'omap3_init_irq' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:196:13: warning: symbol 'ti81xx_init_irq' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:233:39: warning: symbol 'omap2_intc_handle_irq' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:242:6: warning: symbol 'omap_intc_save_context' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:265:6: warning: symbol 'omap_intc_restore_context' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:291:6: warning: symbol 'omap3_intc_suspend' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:297:6: warning: symbol 'omap3_intc_prepare_idle' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:306:6: warning: symbol 'omap3_intc_resume_idle' was not declared. Should it be static?
          arch/arm/mach-omap2/irq.c:312:39: warning: symbol 'omap3_intc_handle_irq' was not declared. Should it be static?
          arch/arm/mach-omap2/omap-secure.c:59:12: warning: symbol 'omap_secure_ram_reserve_memblock' was not declared. Should it be static?
          arch/arm/mach-omap2/board-zoom-display.c:133:13: warning: symbol 'zoom_display_init' was not declared. Should it be static?
          arch/arm/plat-omap/common.c:73:13: warning: symbol 'omap_init_consistent_dma_size' was not declared. Should it be static?
          arch/arm/mach-omap1/irq.c:61:5: warning: symbol 'omap_irq_flags' was not declared. Should it be static?
          arch/arm/mach-omap1/irq.c:179:13: warning: symbol 'omap1_init_irq' was not declared. Should it be static?
          arch/arm/mach-omap1/reset.c:11:6: warning: symbol 'omap1_restart' was not declared. Should it be static?
      
      Fix by including the appropriate header files.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: Senthilvadivu Guruswamy <svadivu@ti.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      
      e2ed89fc
    • P
      ARM: OMAP2+: declare file-local functions as static · 8c3d4534
      Paul Walmsley 提交于
      Several function declarations used only in the files in which they're
      declared should include the static keyword, but don't:
      
          arch/arm/mach-omap2/serial.c:248:6: warning: symbol 'cmdline_find_option' was not declared. Should it be static?
          arch/arm/mach-omap2/omap-wakeupgen.c:259:6: warning: symbol 'irq_sar_clear' was not declared. Should it be static?
          arch/arm/mach-omap2/board-rx51-peripherals.c:878:27: warning: symbol 'rx51_vibra_data' was not declared. Should it be static?
          arch/arm/mach-omap2/board-rx51-peripherals.c:882:27: warning: symbol 'rx51_audio_data' was not declared. Should it be static?
          arch/arm/mach-omap2/board-omap4panda.c:201:29: warning: symbol 'omap_panda_wlan_data' was not declared. Should it be static?
          arch/arm/mach-omap2/board-omap4panda.c:393:24: warning: symbol 'omap4_panda_dvi_device' was not declared. Should it be static?
          arch/arm/mach-omap2/board-omap4panda.c:403:12: warning: symbol 'omap4_panda_dvi_init' was not declared. Should it be static?
          arch/arm/mach-omap2/board-omap4panda.c:464:6: warning: symbol 'omap4_panda_display_init' was not declared. Should it be static?
          arch/arm/mach-omap2/hsmmc.c:434:6: warning: symbol 'omap_init_hsmmc' was not declared. Should it be static?
          arch/arm/mach-omap2/hwspinlock.c:31:12: warning: symbol 'hwspinlocks_init' was not declared. Should it be static?
          arch/arm/mach-omap1/timer.c:58:12: warning: symbol 'omap1_dm_timer_init' was not declared. Should it be static?
          arch/arm/mach-omap1/fpga.c:90:6: warning: symbol 'innovator_fpga_IRQ_demux' was not declared. Should it be static?
      
      Mark all of these as static.
      
      Thanks to Arnd Bergmann <arnd@arndb.de> for pointing out a typo in the
      original patch description.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Govindraj R <govindraj.raja@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: David Anders <x0132446@ti.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      8c3d4534
  2. 06 4月, 2012 2 次提交
    • S
      simple_open: automatically convert to simple_open() · 234e3405
      Stephen Boyd 提交于
      Many users of debugfs copy the implementation of default_open() when
      they want to support a custom read/write function op.  This leads to a
      proliferation of the default_open() implementation across the entire
      tree.
      
      Now that the common implementation has been consolidated into libfs we
      can replace all the users of this function with simple_open().
      
      This replacement was done with the following semantic patch:
      
      <smpl>
      @ open @
      identifier open_f != simple_open;
      identifier i, f;
      @@
      -int open_f(struct inode *i, struct file *f)
      -{
      (
      -if (i->i_private)
      -f->private_data = i->i_private;
      |
      -f->private_data = i->i_private;
      )
      -return 0;
      -}
      
      @ has_open depends on open @
      identifier fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...
      -.open = open_f,
      +.open = simple_open,
      ...
      };
      </smpl>
      
      [akpm@linux-foundation.org: checkpatch fixes]
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      234e3405
    • R
      ARM: fix __io macro for PCMCIA · 1ac02d79
      Rob Herring 提交于
      With commit c334bc15 (ARM: make mach/io.h include optional), PCMCIA was
      broken. PCMCIA depends on __io() returning a valid i/o address, and most
      ARM platforms require IO_SPACE_LIMIT be set to 0xffffffff for PCMCIA. This
      needs a better fix with a fixed i/o address mapping, but for now we just
      restore things to the previous behavior.
      
      This fixes at91, omap1, pxa and sa11xx. pxa needs io.h if PCI is enabled,
      but PCMCIA is not. sa11xx already has IO_SPACE_LIMIT set to 0xffffffff,
      so it doesn't need an io.h.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Andrew Victor <linux@maxim.org.za>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Tested-by: Paul Parsons <lost.distance@yahoo.com> (pxa270)
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      1ac02d79
  3. 05 4月, 2012 18 次提交
  4. 04 4月, 2012 10 次提交