1. 16 11月, 2012 2 次提交
    • H
      mtd: cmdlinepart: fix the overflow of big mtd partitions · 6f9f59ee
      Huang Shijie 提交于
      When the kernel parses the following cmdline
      
      	#mtdparts=gpmi-nand:16m(boot),16m(kernel),1g(home),4g(test),-(usr)
      
      for a big nand chip Micron MT29F64G08AFAAAWP(8GB), we got the following wrong
      result:
      
      	.............................................
      		"mtd: partition size too small (0)"
      	.............................................
      
      We can not get any partition.
      
      The "4g(test)" partition triggers a overflow of the "size". The memparse()
      returns 4g to the "size", but the size is "unsigned long" type, so a overflow
      occurs, the "size" becomes zero in the end.
      
      This patch changes the "size"/"offset" to "unsigned long long" type,
      and replaces the UINT_MAX with ULLONG_MAX for macros SIZE_REMAINING and
      OFFSET_CONTINUOUS.
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      6f9f59ee
    • V
      mtd: map: Fix compilation warning · 3e9ce49e
      Viresh Kumar 提交于
      This patch is an attempt to fix following compilation warning.
      
      In file included from drivers/mtd/chips/cfi_cmdset_0001.c:35:0:
      drivers/mtd/chips/cfi_cmdset_0001.c: In function 'cfi_intelext_write_words':
      include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      I could have used uninitialized_var() too, but didn't used it as the final else
      part of map_word_load() is missing. So there is a chance that it might be passed
      uninitialized. Better initialize to zero.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      3e9ce49e
  2. 15 11月, 2012 36 次提交
  3. 09 11月, 2012 2 次提交