tool api fs: Correctly encode errno for read/write open failures
Subsystems (3)
Sasha Levin
maintainerPATCH 1/3 tool api fs: Correctly encode errno for read/write open failures
From: Ian Rogers <[email protected]>
[ Upstream commit 05be17eed774aaf56f6b1e12714325ca3a266c04 ]
Switch from returning -1 to -errno so that callers can determine types of failure.
--- tools/lib/api/fs/fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/lib/api/fs/fs.c +3 -3
@@ -323,7 +323,7 @@ int filename__read_int(const char *filename, int *value)int fd =open (filename,O_RDONLY ), err =-1 ;if (fd <0 ) -return -1 ; +return -errno;if (read (fd, line,sizeof (line)) >0 ) { *value =atoi (line);
@@ -341,7 +341,7 @@ static int filename__read_ull_base(const char *filename,int fd =open (filename,O_RDONLY ), err =-1 ;if (fd <0 ) -return -1 ; +return -errno;if (read (fd, line,sizeof (line)) >0 ) { *value =strtoull (line,NULL , base);
@@ -428,7 +428,7 @@ int filename__write_int(const char *filename, int value)char buf[64 ];if (fd <0 ) -return err; +return -errno;sprintf (buf,"%d" , value);if (write (fd, buf,sizeof (buf)) ==sizeof (buf))
Signature · 1 line
2.39.5
Sasha Levin
maintainerPATCH 2/3 Input: allocate keycode for phone linking
From: Illia Ostapyshyn <[email protected]>
[ Upstream commit 1bebc7869c99d466f819dd2cffaef0edf7d7a035 ]
The F11 key on the new Lenovo Thinkpad T14 Gen 5, T16 Gen 3, and P14s Gen 5 laptops includes a symbol showing a smartphone and a laptop chained together. According to the user manual, it starts the Microsoft Phone Link software used to connect to Android/iOS devices and relay messages/calls or sync data.
As there are no suitable keycodes for this action, introduce a new one.
--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/input-event-codes.h +1 -0
@@ -519,6 +519,7 @@#define KEY_NOTIFICATION_CENTER 0x1bc/* Show/hide the notification center */ #define KEY_PICKUP_PHONE 0x1bd/* Answer incoming call */ #define KEY_HANGUP_PHONE 0x1be/* Decline incoming call */ +#define KEY_LINK_PHONE 0x1bf/* AL Phone Syncing */ #define KEY_DEL_EOL 0x1c0#define KEY_DEL_EOS 0x1c1
Signature · 1 line
2.39.5
Sasha Levin
maintainerPATCH 3/3 platform/x86: acer-wmi: Ignore AC events
In reply to Sasha LevinFrom: Armin Wolf <[email protected]>
[ Upstream commit f6bfa25c6665f8721421ea94fe506cc22f1d4b43 ]
On the Acer Swift SFG14-41, the events 8 - 1 and 8 - 0 are printed on AC connect/disconnect. Ignore those events to avoid spamming the kernel log with error messages.
--- drivers/platform/x86/acer-wmi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/platform/x86/acer-wmi.c +4 -0
@@ -88,6 +88,7 @@ enum acer_wmi_event_ids {WMID_HOTKEY_EVENT =0x1 ,WMID_ACCEL_OR_KBD_DOCK_EVENT =0x5 ,WMID_GAMING_TURBO_KEY_EVENT =0x7 , + WMID_AC_EVENT = 0x8, }; static const struct key_entry acer_wmi_keymap[] __initconst = {
@@ -2067,6 +2068,9 @@ static void acer_wmi_notify(u32 value, void *context)if (return_value.key_num ==0x4 )acer_toggle_turbo ();break ; +case WMID_AC_EVENT : +/* We ignore AC events here */ +break ;default :pr_warn ("Unknown function number - %d - %d\n" , return_value.function, return_value.key_num);
Signature · 1 line
2.39.5