1. 20 7月, 2016 4 次提交
  2. 12 7月, 2016 3 次提交
  3. 29 6月, 2016 1 次提交
    • A
      dsa: b53: avoid 'maybe-uninitialized' warning · 5eca2914
      Arnd Bergmann 提交于
      In some configurations, gcc produces a warning for correct code
      in this driver:
      
      drivers/net/dsa/b53/b53_mmap.c: In function 'b53_mmap_read64':
      drivers/net/dsa/b53/b53_mmap.c:107:10: error: 'hi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        *val = ((u64)hi << 32) | lo;
                ^~~~~~~
      drivers/net/dsa/b53/b53_mmap.c: In function 'b53_mmap_read48':
      drivers/net/dsa/b53/b53_mmap.c:91:11: error: 'hi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         *val = ((u64)hi << 32) | lo;
                 ^~~~~~~
      drivers/net/dsa/b53/b53_mmap.c:83:11: error: 'hi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         *val = ((u64)hi << 16) | lo;
      
      I have seen the warning before and at the time thought I had fixed
      it with 55e7f6ab ("dsa: b53: fix big-endian register access"),
      however it now came back in a different randconfig build that happens
      to have different inlining decisions in the compiler.
      
      The mistake that gcc makes here is that it thinks the second call to
      readl() might fail because the address 'reg + 4' is not a multiple
      of four despite having knowing that 'reg' itself is a multiple of four.
      
      By open-coding the two reads without the redundant alignment check,
      we can avoid the warning and produce slightly better object code, but
      get slightly longer source code instead.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5eca2914
  4. 25 6月, 2016 2 次提交
  5. 24 6月, 2016 1 次提交
  6. 21 6月, 2016 14 次提交
  7. 17 6月, 2016 1 次提交
    • A
      dsa: b53: fix big-endian register access · 55e7f6ab
      Arnd Bergmann 提交于
      The b53 dsa register access confusingly uses __raw register accessors
      when both the CPU and the device are big-endian, but it uses little-
      endian accessors when the same device is used from a little-endian
      CPU, which makes no sense.
      
      This uses normal accessors in device-endianess all the time, which
      will work in all four combinations of register and CPU endianess,
      and it will have the same barrier semantics in all cases.
      
      This also seems to take care of a (false positive) warning I'm getting:
      
      drivers/net/dsa/b53/b53_mmap.c: In function 'b53_mmap_read64':
      drivers/net/dsa/b53/b53_mmap.c:109:10: error: 'hi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        *val = ((u64)hi << 32) | lo;
      
      I originally planned to submit another patch for that warning
      and did this one as a preparation cleanup, but it does seem to be
      sufficient by itself.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55e7f6ab
  8. 10 6月, 2016 9 次提交
  9. 09 6月, 2016 1 次提交
  10. 05 6月, 2016 4 次提交