ACPI_CALL on Fedora 34

I want to enable/activate the "tpacpi-bat" battery feature but seem to have
a difficult time.

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi    = active (data, thresholds)
tpacpi-bat = inactive (kernel module 'acpi_call' not installed)
tp-smapi   = inactive (ThinkPad not supported)

When compiling the "acpi_call" package from GitHub - julianpoma/acpi_call: acpi_call module for Lenovo Thinkpads

make -C /lib/modules/5.12.9-300.fc34.x86_64/build M=/tmp/acpi_call modules
make[1]: Entering directory '/usr/src/kernels/5.12.9-300.fc34.x86_64'
  CC [M]  /tmp/acpi_call/acpi_call.o
/tmp/acpi_call/acpi_call.c: In function ‘init_acpi_call’:
/tmp/acpi_call/acpi_call.c:355:53: error: passing argument 4 of ‘proc_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  355 |                                                     &proc_acpi_operations);
      |                                                     ^~~~~~~~~~~~~~~~~~~~~
      |                                                     |
      |                                                     struct file_operations *
In file included from /tmp/acpi_call/acpi_call.c:6:
./include/linux/proc_fs.h:109:122: note: expected ‘const struct proc_ops *’ but argument is of type ‘struct file_operations *’
  109 | e, umode_t mode, struct proc_dir_entry *parent, const struct proc_ops *proc_ops);
      |                                                 ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: /tmp/acpi_call/acpi_call.o] Error 1
make[1]: *** [Makefile:1852: /tmp/acpi_call] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.12.9-300.fc34.x86_64'
make: *** [Makefile:8: default] Error 2

I don't know what any of this means and don't have the time to go much into this. Is there an alternative to being built manually?

Have you read this?

Thanks for responding.

I tried all the steps within the article but still same failure above.

I think that the module was written for kernel version 3.x so, that's
why I'm having that make error in my original post.

Hi @samthewildone,

the compiler has treated the incompatible pointer type warning as an error. For that warning, you normally could try

make CFLAGS="-Wno-incompatible-pointer-types"

in order to try to suppress the warning. But in your case (Kernel 5.12) it will not work because it keeps an error due to the too big difference between the data/pointer types, means that the old one can't be casted/converted into the new one:

Kernel 4.x: struct proc_dir_entry *proc_create(..., const struct file_operations *proc_fops)
Kernel 5.x: struct proc_dir_entry *proc_create(..., const struct proc_ops *proc_ops)

So your guess regarding the kernel version was correct.

Try to install the akmod-acpi_call package instead. Additionally, you have to add a line to your modules file via

echo acpi_call >> /etc/modules

in order to make the module boot-safe and then call modprobe acpi_call in order to load the module in the running kernel. You can validate that with lsmod | grep acpi_call.

Further information you may find here: Fedora — TLP 1.6 documentation

2 Likes