Skip to content
Snippets Groups Projects
  1. Sep 03, 2024
  2. May 29, 2023
  3. Nov 09, 2022
    • Bhupesh Sharma's avatar
      tools: usb: ffs-aio-example: Fix build error with aarch64-*-gnu-gcc toolchain(s) · c5edb757
      Bhupesh Sharma authored
      
      The tools/usb/aio_simple.c file when cross-compiled with
      aarch64-*-gnu-gcc toolchain(s) leads to the following errors:
      
        aio_simple.c:30:10: fatal error: endian.h: No such file or directory
        30 | #include <endian.h>
            |          ^~~~~~~~~~
      
        aio_simple.c:88:14: note: (near initialization for
                            'descriptors.fs_count')
        aio_simple.c:110:14: error: initializer element is not constant
        110 |  .hs_count = htole32(3),
            |              ^~~~~~~
        aio_simple.c:110:14: note: (near initialization for
                            'descriptors.hs_count')
        aio_simple.c:124:22: error: initializer element is not constant
        124 |    .wMaxPacketSize = htole16(512),
            |                      ^~~~~~~
        aio_simple.c:124:22: note: (near initialization for
                             'descriptors.hs_descs.bulk_sink.wMaxPacketSize')
      
      Fix these compilation issues by:
       - Switching to _DEFAULT_SOURCE:
          _BSD_SOURCE is deprecated and gives a build warning. Let's use
          _DEFAULT_SOURCE instead.
       - Currently this file uses library htole16/32 function calls.
         Replace these with equivalent 'cpu_to_le16/32' calls.
      
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBhupesh Sharma <bhupesh.sharma@linaro.org>
      Link: https://lore.kernel.org/r/20221029161312.171165-1-bhupesh.sharma@linaro.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c5edb757
  4. Jul 08, 2022
  5. Apr 26, 2022
  6. Feb 15, 2022
    • Masahiro Yamada's avatar
      kbuild: replace $(if A,A,B) with $(or A,B) · 5c816641
      Masahiro Yamada authored
      
      $(or ...) is available since GNU Make 3.81, and useful to shorten the
      code in some places.
      
      Covert as follows:
      
        $(if A,A,B)  -->  $(or A,B)
      
      This patch also converts:
      
        $(if A, A, B) --> $(or A, B)
      
      Strictly speaking, the latter is not an equivalent conversion because
      GNU Make keeps spaces after commas; if A is not empty, $(if A, A, B)
      expands to " A", while $(or A, B) expands to "A".
      
      Anyway, preceding spaces are not significant in the code hunks I touched.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
      5c816641
  7. Sep 14, 2021
    • Faizel K B's avatar
      usb: testusb: Fix for showing the connection speed · f81c08f8
      Faizel K B authored
      
      testusb' application which uses 'usbtest' driver reports 'unknown speed'
      from the function 'find_testdev'. The variable 'entry->speed' was not
      updated from  the application. The IOCTL mentioned in the FIXME comment can
      only report whether the connection is low speed or not. Speed is read using
      the IOCTL USBDEVFS_GET_SPEED which reports the proper speed grade.  The
      call is implemented in the function 'handle_testdev' where the file
      descriptor was availble locally. Sample output is given below where 'high
      speed' is printed as the connected speed.
      
      sudo ./testusb -a
      high speed      /dev/bus/usb/001/011    0
      /dev/bus/usb/001/011 test 0,    0.000015 secs
      /dev/bus/usb/001/011 test 1,    0.194208 secs
      /dev/bus/usb/001/011 test 2,    0.077289 secs
      /dev/bus/usb/001/011 test 3,    0.170604 secs
      /dev/bus/usb/001/011 test 4,    0.108335 secs
      /dev/bus/usb/001/011 test 5,    2.788076 secs
      /dev/bus/usb/001/011 test 6,    2.594610 secs
      /dev/bus/usb/001/011 test 7,    2.905459 secs
      /dev/bus/usb/001/011 test 8,    2.795193 secs
      /dev/bus/usb/001/011 test 9,    8.372651 secs
      /dev/bus/usb/001/011 test 10,    6.919731 secs
      /dev/bus/usb/001/011 test 11,   16.372687 secs
      /dev/bus/usb/001/011 test 12,   16.375233 secs
      /dev/bus/usb/001/011 test 13,    2.977457 secs
      /dev/bus/usb/001/011 test 14 --> 22 (Invalid argument)
      /dev/bus/usb/001/011 test 17,    0.148826 secs
      /dev/bus/usb/001/011 test 18,    0.068718 secs
      /dev/bus/usb/001/011 test 19,    0.125992 secs
      /dev/bus/usb/001/011 test 20,    0.127477 secs
      /dev/bus/usb/001/011 test 21 --> 22 (Invalid argument)
      /dev/bus/usb/001/011 test 24,    4.133763 secs
      /dev/bus/usb/001/011 test 27,    2.140066 secs
      /dev/bus/usb/001/011 test 28,    2.120713 secs
      /dev/bus/usb/001/011 test 29,    0.507762 secs
      
      Signed-off-by: default avatarFaizel K B <faizel.kb@dicortech.com>
      Link: https://lore.kernel.org/r/20210902114444.15106-1-faizel.kb@dicortech.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f81c08f8
  8. May 07, 2021
  9. Mar 26, 2021
  10. Aug 19, 2020
  11. Jul 15, 2020
  12. Jun 27, 2020
  13. Jun 24, 2020
  14. Mar 25, 2020
  15. Jan 09, 2020
  16. Jan 06, 2020
  17. Nov 07, 2019
  18. Oct 28, 2019
  19. Jul 25, 2019
  20. May 30, 2019
    • Thomas Gleixner's avatar
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 · c942fddf
      Thomas Gleixner authored
      
      Based on 3 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version [author] [kishon] [vijay] [abraham]
        [i] [kishon]@[ti] [com] this program is distributed in the hope that
        it will be useful but without any warranty without even the implied
        warranty of merchantability or fitness for a particular purpose see
        the gnu general public license for more details
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version [author] [graeme] [gregory]
        [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
        [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
        [hk] [hemahk]@[ti] [com] this program is distributed in the hope
        that it will be useful but without any warranty without even the
        implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 1105 file(s).
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarAllison Randal <allison@lohutok.net>
      Reviewed-by: default avatarRichard Fontana <rfontana@redhat.com>
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c942fddf
    • Thomas Gleixner's avatar
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 · 1a59d1b8
      Thomas Gleixner authored
      
      Based on 1 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details you
        should have received a copy of the gnu general public license along
        with this program if not write to the free software foundation inc
        59 temple place suite 330 boston ma 02111 1307 usa
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 1334 file(s).
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarAllison Randal <allison@lohutok.net>
      Reviewed-by: default avatarRichard Fontana <rfontana@redhat.com>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1a59d1b8
  21. May 24, 2019
  22. May 21, 2019
  23. Oct 18, 2018
  24. Oct 02, 2018
  25. Jul 17, 2018
    • 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: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      a2b22ddd
  26. Jul 13, 2018
    • 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: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8975a68d
  27. May 31, 2018
  28. Mar 22, 2018
  29. Mar 09, 2018
Loading