Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1038207: tp-smapi-dkms: module fails to build for Linux 6.4: error: macro "DEFINE_SEMAPHORE" requires 2 arguments, but only 1 given

466 views
Skip to first unread message

Andreas Beckmann

unread,
Jun 16, 2023, 10:20:05 AM6/16/23
to
Package: tp-smapi-dkms
Version: 0.43-3
Severity: important
Tags: sid trixie
User: debi...@lists.debian.org
Usertags: piuparts


DKMS make.log for tp_smapi-0.43 for kernel 6.4.0-0-amd64 (x86_64)
Fri Jun 16 14:10:47 UTC 2023
make: Entering directory '/usr/src/linux-headers-6.4.0-0-amd64'
CC [M] /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.o
CC [M] /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.o
CC [M] /var/lib/dkms/tp_smapi/0.43/build/hdaps.o
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:42: error: macro "DEFINE_SEMAPHORE" requires 2 arguments, but only 1 given
94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
| ^
In file included from /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:45:
/usr/src/linux-headers-6.4.0-0-common/include/linux/semaphore.h:34: note: macro "DEFINE_SEMAPHORE" defined here
34 | #define DEFINE_SEMAPHORE(_name, _n) \
|
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:8: error: type defaults to 'int' in declaration of 'DEFINE_SEMAPHORE' [-Werror=implicit-int]
94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
| ^~~~~~~~~~~~~~~~
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: In function 'thinkpad_ec_lock':
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:112:35: error: 'thinkpad_ec_mutex' undeclared (first use in this function); did you mean 'thinkpad_ec_lock'?
112 | ret = down_interruptible(&thinkpad_ec_mutex);
| ^~~~~~~~~~~~~~~~~
| thinkpad_ec_lock
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:112:35: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: In function 'thinkpad_ec_try_lock':
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:126:30: error: 'thinkpad_ec_mutex' undeclared (first use in this function); did you mean 'thinkpad_ec_lock'?
126 | return down_trylock(&thinkpad_ec_mutex);
| ^~~~~~~~~~~~~~~~~
| thinkpad_ec_lock
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: In function 'thinkpad_ec_unlock':
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:138:13: error: 'thinkpad_ec_mutex' undeclared (first use in this function); did you mean 'thinkpad_ec_lock'?
138 | up(&thinkpad_ec_mutex);
| ^~~~~~~~~~~~~~~~~
| thinkpad_ec_lock
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: In function 'thinkpad_ec_try_lock':
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:127:1: error: control reaches end of non-void function [-Werror=return-type]
127 | }
| ^
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c: At top level:
/var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:8: warning: 'DEFINE_SEMAPHORE' defined but not used [-Wunused-variable]
94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [/usr/src/linux-headers-6.4.0-0-common/scripts/Makefile.build:257: /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:115:36: error: macro "DEFINE_SEMAPHORE" requires 2 arguments, but only 1 given
115 | static DEFINE_SEMAPHORE(smapi_mutex);
| ^
In file included from /usr/src/linux-headers-6.4.0-0-common/include/linux/fs.h:25,
from /usr/src/linux-headers-6.4.0-0-common/include/linux/proc_fs.h:10,
from /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:41:
/usr/src/linux-headers-6.4.0-0-common/include/linux/semaphore.h:34: note: macro "DEFINE_SEMAPHORE" defined here
34 | #define DEFINE_SEMAPHORE(_name, _n) \
|
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:115:8: error: type defaults to 'int' in declaration of 'DEFINE_SEMAPHORE' [-Werror=implicit-int]
115 | static DEFINE_SEMAPHORE(smapi_mutex);
| ^~~~~~~~~~~~~~~~
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c: In function 'store_battery_start_charge_thresh':
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:780:15: error: 'smapi_mutex' undeclared (first use in this function)
780 | down(&smapi_mutex);
| ^~~~~~~~~~~
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:780:15: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c: In function 'store_battery_stop_charge_thresh':
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:822:15: error: 'smapi_mutex' undeclared (first use in this function)
822 | down(&smapi_mutex);
| ^~~~~~~~~~~
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c: At top level:
/var/lib/dkms/tp_smapi/0.43/build/tp_smapi.c:115:8: warning: 'DEFINE_SEMAPHORE' defined but not used [-Wunused-variable]
115 | static DEFINE_SEMAPHORE(smapi_mutex);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [/usr/src/linux-headers-6.4.0-0-common/scripts/Makefile.build:257: /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.o] Error 1
make: *** [/usr/src/linux-headers-6.4.0-0-common/Makefile:2051: /var/lib/dkms/tp_smapi/0.43/build] Error 2
make: Leaving directory '/usr/src/linux-headers-6.4.0-0-amd64'


Andreas

Evgeni Golov

unread,
Jun 16, 2023, 12:40:05 PM6/16/23
to
Hi!

On Fri, Jun 16, 2023 at 04:13:51PM +0200, Andreas Beckmann wrote:
> DKMS make.log for tp_smapi-0.43 for kernel 6.4.0-0-amd64 (x86_64)
> Fri Jun 16 14:10:47 UTC 2023
> make: Entering directory '/usr/src/linux-headers-6.4.0-0-amd64'
> CC [M] /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.o
> CC [M] /var/lib/dkms/tp_smapi/0.43/build/tp_smapi.o
> CC [M] /var/lib/dkms/tp_smapi/0.43/build/hdaps.o
> /var/lib/dkms/tp_smapi/0.43/build/thinkpad_ec.c:94:42: error: macro "DEFINE_SEMAPHORE" requires 2 arguments, but only 1 given
> 94 | static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
> | ^

Thanks for the report!

I don't have a machine to test this right now, but I think the following
patch should fix the issue:
https://github.com/linux-thinkpad/tp_smapi/pull/45

Evgeni

Marc Haber

unread,
Jul 5, 2023, 6:00:05 AM7/5/23
to
On Fri, Jun 16, 2023 at 06:19:47PM +0200, Evgeni Golov wrote:
> I don't have a machine to test this right now, but I think the following
> patch should fix the issue:
> https://github.com/linux-thinkpad/tp_smapi/pull/45

I can confirm that the module compiles with this patch

Greetings
Marc

Francois Marier

unread,
Jul 28, 2023, 3:10:05 PM7/28/23
to
I just hit this bug upgrading the kernel package in unstable.

The patch worked for me as well. It would be good to get that uploaded as
soon as possible since it's going to affect lots of people now that 6.4 is
the default.

Francois
0 new messages