Skip to content

Kernel 7.2.x Compatibility #82

Description

@dtl131

Latest version cloned from git master does not build with kernel 7.2

make -C /lib/modules/7.2.2-1-siduction-amd64/build M=~/source/tp_smapi O=/lib/modules/7.2.2-1-siduction-amd64/build modules
make[1]: Entering directory '/usr/src/linux-headers-7.2.2-1-siduction-amd64'
make[2]: Entering directory '~/source/tp_smapi'
warning: pahole version differs from the one used to build the kernel
  The kernel was built with: 131
  You are using:             0
  CC [M]  thinkpad_ec.o
  CC [M]  tp_smapi.o
tp_smapi.c: In function ‘show_tp_ec_bat_str’:
tp_smapi.c:672:9: error: implicit declaration of function ‘strncpy’ [-Wimplicit-function-declaration]
  672 |         strncpy(buf, (char *)row+offset, maxlen);
      |         ^~~~~~~
tp_smapi.c:47:1: note: include ‘<string.h>’ or provide a declaration of ‘strncpy’
   46 | #include <linux/platform_device.h>
  +++ |+#include <string.h>
   47 | #include <asm/uaccess.h>
tp_smapi.c:672:9: warning: incompatible implicit declaration of built-in function ‘strncpy’ [-Wbuiltin-declaration-mismatch]
  672 |         strncpy(buf, (char *)row+offset, maxlen);
      |         ^~~~~~~
tp_smapi.c:672:9: note: include ‘<string.h>’ or provide a declaration of ‘strncpy’
make[4]: *** [/usr/src/linux-headers-7.2.2-1-siduction-amd64/scripts/Makefile.build:294: tp_smapi.o] Error 1
make[3]: *** [/usr/src/linux-headers-7.2.2-1-siduction-amd64/Makefile:2211: .] Error 2
make[2]: *** [/usr/src/linux-headers-7.2.2-1-siduction-amd64/Makefile:260: __sub-make] Error 2
make[2]: Leaving directory '~/source/tp_smapi'
make[1]: *** [Makefile:260: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-7.2.2-1-siduction-amd64'
make: *** [Makefile:46: modules] Error 2

Someone also reported this on Ubuntu Launchpad: https://bugs.launchpad.net/ubuntu/+source/tp-smapi/+bug/2165822

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions