1. 07 7月, 2012 38 次提交
  2. 06 7月, 2012 2 次提交
    • H
      mtd: nandsim: don't open code a do_div helper · 596fd462
      Herton Ronaldo Krzesinski 提交于
      We don't need to open code the divide function, just use div_u64 that
      already exists and do the same job. While this is a straightforward
      clean up, there is more to that, the real motivation for this.
      
      While building on a cross compiling environment in armel, using gcc
      4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5), I was getting the following build
      error:
      
      ERROR: "__aeabi_uldivmod" [drivers/mtd/nand/nandsim.ko] undefined!
      
      After investigating with objdump and hand built assembly version
      generated with the compiler, I narrowed __aeabi_uldivmod as being
      generated from the divide function. When nandsim.c is built with
      -fno-inline-functions-called-once, that happens when
      CONFIG_DEBUG_SECTION_MISMATCH is enabled, the do_div optimization in
      arch/arm/include/asm/div64.h doesn't work as expected with the open
      coded divide function: even if the do_div we are using doesn't have a
      constant divisor, the compiler still includes the else parts of the
      optimized do_div macro, and translates the divisions there to use
      __aeabi_uldivmod, instead of only calling __do_div_asm -> __do_div64 and
      optimizing/removing everything else out.
      
      So to reproduce, gcc 4.6 plus CONFIG_DEBUG_SECTION_MISMATCH=y and
      CONFIG_MTD_NAND_NANDSIM=m should do it, building on armel.
      
      After this change, the compiler does the intended thing even with
      -fno-inline-functions-called-once, and optimizes out as expected the
      constant handling in the optimized do_div on arm. As this also avoids a
      build issue, I'm marking for Stable, as I think is applicable for this
      case.
      Signed-off-by: NHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
      Cc: stable@vger.kernel.org
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      596fd462
    • M
      mtd: ABI documentation: clarification of bitflip_threshold · 021796b8
      Mike Dunn 提交于
      The -EUCLEAN return value applies to mtd_read_oob() as well as mtd_read(), but
      only mtd_read() was mentioned in the blurd on bitflip_threshold in the ABI
      documentation.
      Signed-off-by: NMike Dunn <mikedunn@newsguy.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      021796b8