From: kernel test robot <lkp@intel.com>
To: Sven Peter <sven@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [sven:wip/smc-hid 21/22] drivers/input/misc/macsmc-hid.c:39:3: error: expected expression
Date: Tue, 27 May 2025 08:41:20 +0800 [thread overview]
Message-ID: <202505270847.kK2FpmSF-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sven/linux.git wip/smc-hid
head: 85195bb074dd61b098eb62a878369dd5c4815832
commit: ee13e23037b7b78af00901c86613bf572b53baf3 [21/22] Input: macsmc-hid: New driver to handle the Apple Mac SMC buttons/lid
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20250527/202505270847.kK2FpmSF-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250527/202505270847.kK2FpmSF-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505270847.kK2FpmSF-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/input/misc/macsmc-hid.c:39:3: error: expected expression
u8 button = (event >> 8) & 0xff;
^
>> drivers/input/misc/macsmc-hid.c:41:11: error: use of undeclared identifier 'button'
switch (button) {
^
drivers/input/misc/macsmc-hid.c:76:3: error: expected expression
u8 lid_state = !!((event >> 8) & 0xff);
^
>> drivers/input/misc/macsmc-hid.c:77:31: error: use of undeclared identifier 'lid_state'; did you mean 'node_state'?
if (smchid->wakeup_mode && !lid_state) {
^~~~~~~~~
node_state
include/linux/nodemask.h:427:28: note: 'node_state' declared here
static __always_inline int node_state(int node, enum node_states state)
^
drivers/input/misc/macsmc-hid.c:77:31: warning: address of function 'node_state' will always evaluate to 'true' [-Wpointer-bool-conversion]
if (smchid->wakeup_mode && !lid_state) {
~^~~~~~~~~
drivers/input/misc/macsmc-hid.c:77:31: note: prefix with the address-of operator to silence this warning
if (smchid->wakeup_mode && !lid_state) {
^
&
drivers/input/misc/macsmc-hid.c:81:46: error: use of undeclared identifier 'lid_state'; did you mean 'node_state'?
input_report_switch(smchid->input, SW_LID, lid_state);
^~~~~~~~~
node_state
include/linux/nodemask.h:427:28: note: 'node_state' declared here
static __always_inline int node_state(int node, enum node_states state)
^
1 warning and 5 errors generated.
vim +39 drivers/input/misc/macsmc-hid.c
31
32 static int macsmc_hid_event(struct notifier_block *nb, unsigned long event, void *data)
33 {
34 struct macsmc_hid *smchid = container_of(nb, struct macsmc_hid, nb);
35 u16 type = event >> 16;
36
37 switch (type) {
38 case SMC_EV_BTN:
> 39 u8 button = (event >> 8) & 0xff;
40 u8 state = !!(event & 0xff);
> 41 switch (button) {
42 case BTN_POWER:
43 case BTN_TOUCHID:
44 if (smchid->wakeup_mode) {
45 if (state) {
46 dev_info(smchid->dev, "Button wakeup\n");
47 pm_wakeup_hard_event(smchid->dev);
48 }
49 } else {
50 input_report_key(smchid->input, KEY_POWER, state);
51 input_sync(smchid->input);
52 }
53 break;
54 case BTN_POWER_HELD2:
55 /*
56 * If we get here, we have about 4 seconds before forced shutdown.
57 * Try to do an emergency shutdown to make sure the NVMe cache is
58 * flushed. macOS actually does this by panicing (!)...
59 */
60 if (state) {
61 dev_crit(smchid->dev, "Triggering forced shutdown!\n");
62 if (kernel_can_power_off())
63 kernel_power_off();
64 else /* Missing macsmc-reboot driver? */
65 kernel_restart("SMC power button triggered restart");
66 }
67 break;
68 case BTN_POWER_HELD1: /* power button held down; ignore */
69 break;
70 default:
71 dev_warn(smchid->dev, "Unknown SMC button event: %04lx\n", event & 0xffff);
72 break;
73 }
74 return NOTIFY_OK;
75 case SMC_EV_LID:
76 u8 lid_state = !!((event >> 8) & 0xff);
> 77 if (smchid->wakeup_mode && !lid_state) {
78 dev_info(smchid->dev, "Lid wakeup\n");
79 pm_wakeup_hard_event(smchid->dev);
80 }
81 input_report_switch(smchid->input, SW_LID, lid_state);
82 input_sync(smchid->input);
83 return NOTIFY_OK;
84 }
85
86 return NOTIFY_DONE;
87 }
88
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-05-27 0:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202505270847.kK2FpmSF-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sven@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.