1. 17 Jul, 2018 1 commit
    • Peter Senna Tschudin's avatar
      tools: usb: ffs-test: Fix build on big endian systems · a2b22ddd
      Peter Senna Tschudin authored
      The tools/usb/ffs-test.c file defines cpu_to_le16/32 by using the C
      library htole16/32 function calls. However, cpu_to_le16/32 are used when
      initializing structures, i.e in a context where a function call is not
      allowed.
      
      It works fine on little endian systems because htole16/32 are defined by
      the C library as no-ops. But on big-endian systems, they are actually
      doing something, which might involve calling a function, causing build
      failures, such as:
      
         ffs-test.c:48:25: error: initializer element is not constant
          #define cpu_to_le32(x)  htole32(x)
                                  ^~~~~~~
         ffs-test.c:128:12: note: in expansion of macro ‘cpu_to_le32’
            .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
                     ^~~~~~~~~~~
      
      To solve this, we code cpu_to_le16/32 in a way that allows them to be
      used when initializing structures. This fix was imported from
      meta-openembedded/android-tools/fix-big-endian-build.patch written by
      Thomas Petazzoni <thomas.petazzoni@free-electrons.com>.
      
      CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: Peter Senna Tschudin's avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      a2b22ddd
  2. 13 Jul, 2018 1 commit
    • Peter Senna Tschudin's avatar
      tools: usb: ffs-test: Fix build on big endian systems · 8975a68d
      Peter Senna Tschudin authored
      The tools/usb/ffs-test.c file defines cpu_to_le16/32 by using the C
      library htole16/32 function calls. However, cpu_to_le16/32 are used when
      initializing structures, i.e in a context where a function call is not
      allowed.
      
      It works fine on little endian systems because htole16/32 are defined by
      the C library as no-ops. But on big-endian systems, they are actually
      doing something, which might involve calling a function, causing build
      failures, such as:
      
         ffs-test.c:48:25: error: initializer element is not constant
          #define cpu_to_le32(x)  htole32(x)
                                  ^~~~~~~
         ffs-test.c:128:12: note: in expansion of macro ‘cpu_to_le32’
            .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
                     ^~~~~~~~~~~
      
      To solve this, we code cpu_to_le16/32 in a way that allows them to be
      used when initializing structures. This fix was imported from
      meta-openembedded/android-tools/fix-big-endian-build.patch written by
      Thomas Petazzoni <thomas.petazzoni@free-electrons.com>.
      
      CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: Peter Senna Tschudin's avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8975a68d
  3. 24 Jan, 2017 2 commits
  4. 02 Sep, 2014 2 commits
  5. 30 Jun, 2014 1 commit
  6. 27 Jun, 2014 1 commit
  7. 19 Jun, 2014 1 commit
  8. 07 Mar, 2013 1 commit
  9. 07 May, 2012 1 commit
  10. 28 Feb, 2012 1 commit
  11. 24 Jan, 2012 1 commit
  12. 01 Mar, 2011 1 commit
  13. 20 May, 2010 1 commit