1. 10 May, 2020 1 commit
    • Gustavo A. R. Silva's avatar
      Input: applespi - replace zero-length array with flexible-array · d34fced4
      Gustavo A. R. Silva authored
      The current codebase makes use of the zero-length array language
      extension to the C90 standard, but the preferred mechanism to declare
      variable-length types such as these ones is a flexible array member[1][2],
      introduced in C99:
      
      struct foo {
              int stuff;
              struct boo array[];
      };
      
      By making use of the mechanism above, we will get a compiler warning
      in case the flexible array does not occur last in the structure, which
      will help us prevent some kind of undefined behavior bugs from being
      inadvertently introduced[3] to the codebase from now on.
      
      Also, notice that, dynamic memory allocations won't be affected by
      this change:
      
      "Flexible array members have incomplete type, and so the sizeof operator
      may not be applied. As a quirk of the original implementation of
      zero-length arrays, sizeof evaluates to zero."[1]
      
      sizeof(flexible-array-member) triggers a warning because flexible array
      members have incomplete type[1]. There are some instances of code in
      which the sizeof operator is being incorrectly/erroneously applied to
      zero-length arrays and the result is zero. Such instances may be hiding
      some bugs. So, this work (flexible-array member conversions) will also
      help to get completely rid of those sorts of issues.
      
      This issue was found with the help of Coccinelle.
      
      [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
      [2] https://github.com/KSPP/linux/issues/21
      [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour")
      Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/20200507185347.GA14499@embeddedorSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      d34fced4
  2. 06 May, 2020 2 commits
    • Hans de Goede's avatar
      Input: axp20x-pek - always register interrupt handlers · 9747070c
      Hans de Goede authored
      On some X86 devices we do not register an input-device, because the
      power-button is also handled by the soc_button_array (GPIO) input driver,
      and we want to avoid reporting power-button presses to userspace twice.
      
      Sofar when we did this we also did not register our interrupt handlers,
      since those were only necessary to report input events.
      
      But on at least 2 device models the Medion Akoya E1239T and the GPD win,
      the GPIO pin used by the soc_button_array driver for the power-button
      cannot wakeup the system from suspend. Why this does not work is not clear,
      I've tried comparing the value of all relevant registers on the Cherry
      Trail SoC, with those from models where this does work. I've checked:
      PMC registers: FUNC_DIS, FUNC_DIS2, SOIX_WAKE_EN, D3_STS_0, D3_STS_1,
      D3_STDBY_STS_0, D3_STDBY_STS_1; PMC ACPI I/O regs: PM1_STS_EN, GPE0a_EN
      and they all have identical contents in the working and non working cases.
      I suspect that the firmware either sets some unknown register to a value
      causing this, or that it turns off a power-plane which is necessary for
      GPIO wakeups to work during suspend.
      
      What does work on the Medion Akoya E1239T is letting the AXP288 wakeup
      the system on a power-button press (the GPD win has a different PMIC).
      
      Move the registering of the power-button press/release interrupt-handler
      from axp20x_pek_probe_input_device() to axp20x_pek_probe() so that the
      PMIC will wakeup the system on a power-button press, even if we do not
      register an input device.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
      Link: https://lore.kernel.org/r/20200426155757.297087-1-hdegoede@redhat.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      9747070c
    • Wolfram Sang's avatar
      Input: lm8333 - update contact email · 18f42374
      Wolfram Sang authored
      The 'pengutronix' address is defunct for years. Use the proper contact
      address.
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      Link: https://lore.kernel.org/r/20200502142639.18925-1-wsa@kernel.orgSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      18f42374
  3. 28 Apr, 2020 4 commits
  4. 22 Apr, 2020 3 commits
  5. 20 Apr, 2020 1 commit
  6. 19 Apr, 2020 2 commits
  7. 15 Apr, 2020 2 commits
  8. 07 Apr, 2020 1 commit
  9. 01 Apr, 2020 3 commits
  10. 27 Mar, 2020 1 commit
  11. 26 Mar, 2020 1 commit
  12. 24 Mar, 2020 19 commits