aymanbagabas / Huawei-WMI

Huawei WMI laptop extras linux driver
GNU General Public License v2.0
229 stars 15 forks source link

Unable to compile for 6.3.7 kernel #75

Closed Timarrr closed 1 year ago

Timarrr commented 1 year ago

Describe the bug Compilation fails on kernel 6.3.7 with incompatible pointer types error

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/aymanbagabas/Huawei-WMI
  2. make
  3. 490 |         .add_battery = huawei_wmi_battery_add,
      |                        ^~~~~~~~~~~~~~~~~~~~~~
    /home/mango/Huawei-WMI/huawei-wmi.c:490:24: note: (near initialization for ‘huawei_wmi_battery_hook.add_battery’)
    /home/mango/Huawei-WMI/huawei-wmi.c:491:27: error: initialization of ‘int (*)(struct power_supply *, struct acpi_battery_hook *)’ from incompatible pointer type ‘int (*)(struct power_supply *)’ [-Werror=incompatible-pointer-types]
    491 |         .remove_battery = huawei_wmi_battery_remove,
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~
    /home/mango/Huawei-WMI/huawei-wmi.c:491:27: note: (near initialization for ‘huawei_wmi_battery_hook.remove_battery’)
    cc1: some warnings being treated as errors
    make[2]: *** [scripts/Makefile.build:252: /home/mango/Huawei-WMI/huawei-wmi.o] Error 1
    make[1]: *** [Makefile:2025: /home/mango/Huawei-WMI] Error 2
    make: *** [Makefile:7: modules] Error 2

Expected behavior Successful compilation and installation of module

Screenshots image

(please complete the following information):

Additional context If any

KamilFatkhiev commented 1 year ago

Hello Ayman! I have the same problem on 6.2.0-31-generic kernel. image

aymanbagabas commented 1 year ago

Could you try the latest code from master?

KamilFatkhiev commented 1 year ago

I've tried with the latest code from master and got this. image

igor1malo commented 1 year ago

Adding #include <linux/version.h> fixes the build for me. I sent PR #77