arm: OABI compat: fix build when EPOLL is not enabled
PATCH v3 1/1 arm: OABI compat: fix build when EPOLL is not enabled
When CONFIG_EPOLL is not set/enabled, sys_oabi-compat.c has build errors. Fix these by surrounding them with ifdef CONFIG_EPOLL/endif and providing stubs for the "EPOLL is not set" case.
../arch/arm/kernel/sys_oabi-compat.c: In function 'sys_oabi_epoll_ctl':../arch/arm/kernel/sys_oabi-compat.c:257:6: error: implicit declaration of function 'ep_op_has_event' [-Werror=implicit-function-declaration]
257 | if (ep_op_has_event(op) &&
| ^~~~~~~~~~~~~~~
../arch/arm/kernel/sys_oabi-compat.c:264:9: error: implicit declaration of function 'do_epoll_ctl'; did you mean 'sys_epoll_ctl'? [-Werror=implicit-function-declaration]
264 | return do_epoll_ctl(epfd, op, fd, &kernel, false);
| ^~~~~~~~~~~~---
v2: use correct Fixes: tag (thanks, rmk)
v3: add patches@ to Cc: list
arch/arm/kernel/sys_oabi-compat.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm/kernel/sys_oabi-compat.c +15 -0
@@ -248,6 +248,7 @@ struct oabi_epoll_event {__u64 data; } __attribute__ ((packed,aligned(4))); +#ifdef CONFIG_EPOLL asmlinkage long sys_oabi_epoll_ctl (int epfd,int op,int fd,struct oabi_epoll_event __user *event) {
@@ -298,6 +299,20 @@ asmlinkage long sys_oabi_epoll_wait(intkfree (kbuf);return err ? -EFAULT : ret; } +#else +asmlinkage long sys_oabi_epoll_ctl (int epfd,int op,int fd, +struct oabi_epoll_event __user *event) +{ +return -EINVAL ; +} + +asmlinkage long sys_oabi_epoll_wait (int epfd, +struct oabi_epoll_event __user *events, +int maxevents,int timeout) +{ +return -EINVAL ; +} +#endif struct oabi_sembuf {unsigned short sem_num;
Quoted 12 lines · Randy Dunlap
When
CONFIG_EPOLLis not set/enabled,sys_oabi-compat.chas build errors. Fix these by surrounding them with ifdef CONFIG_EPOLL/endif and providing stubs for the "EPOLL is not set" case.
../arch/arm/kernel/sys_oabi-compat.c: In function 'sys_oabi_epoll_ctl':../arch/arm/kernel/sys_oabi-compat.c:257:6: error: implicit declaration of function 'ep_op_has_event' [-Werror=implicit-function-declaration]
257 | if (ep_op_has_event(op)&&| ^~~~~~~~~~~~~~~ ../arch/arm/kernel/sys_oabi-compat.c:264:9: error: implicit declaration of function 'do_epoll_ctl'; did you mean 'sys_epoll_ctl'? [-Werror=implicit-function-declaration] 264 | return do_epoll_ctl(epfd, op, fd, &kernel, false); | ^~~~~~~~~~~~
Quoted 8 lines
Fixes c281634c8652 ("ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()")Signed-off-by Randy Dunlap <[email protected]>Cc Russell King <[email protected]>Cc Nicolas Pitre <[email protected]>Cc Alexander Viro <[email protected]>
Quoted 39 lines
---
v2: use correct Fixes: tag (thanks, rmk)
v3: add patches@ to Cc: listarch/arm/kernel/sys_oabi-compat.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/arm/kernel/sys_oabi-compat.c +15
-0@@ -248,6 +248,7 @@ struct oabi_epoll_event {__u64 data; } __attribute__ ((packed,aligned(4))); +#ifdef CONFIG_EPOLL asmlinkage long sys_oabi_epoll_ctl (int epfd,int op,int fd,struct oabi_epoll_event __user *event) {@@ -298,6 +299,20 @@ asmlinkage long sys_oabi_epoll_wait(intkfree (kbuf);return err ? -EFAULT : ret; } +#else +asmlinkage long sys_oabi_epoll_ctl (int epfd,int op,int fd, +struct oabi_epoll_event __user *event) +{ +return -EINVAL ; +} + +asmlinkage long sys_oabi_epoll_wait (int epfd, +struct oabi_epoll_event __user *events, +int maxevents,int timeout) +{ +return -EINVAL ; +} +#endif struct oabi_sembuf {unsigned short sem_num;