Skip to contentSkip to conversation

Input: gameport - use IS_REACHABLE() instead of open-coding it

PATCH In review Dmitry Torokhov 2 participants 2 messages Jul 6, 2023 Input drivers

lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: gameport - use IS_REACHABLE() instead of open-coding it

Replace an open-coded preprocessor conditional with an equivalent helper.

---
 include/linux/gameport.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/gameport.h +1 -1
index 0a221e768ea4..07e370113b2b 100644
@@ -63,7 +63,7 @@ struct gameport_driver {
 int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode);
 void gameport_close(struct gameport *gameport);
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#if IS_REACHABLE(CONFIG_GAMEPORT)
 
 void __gameport_register_port(struct gameport *gameport, struct module *owner);
 /* use a define to avoid include chaining to get THIS_MODULE */
Signature · 5 lines
2.41.0.255.g8b1d071c50-goog


-- 
Dmitry
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dmitry Torokhov

Replace an open-coded preprocessor conditional with an equivalent helper.

Thanks.

Quoted 17 lines
---
 include/linux/gameport.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/gameport.h +1 -1
index 0a221e768ea4..07e370113b2b 100644
@@ -63,7 +63,7 @@ struct gameport_driver {
 int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode);
 void gameport_close(struct gameport *gameport);
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#if IS_REACHABLE(CONFIG_GAMEPORT)
 
 void __gameport_register_port(struct gameport *gameport, struct module *owner);
 /* use a define to avoid include chaining to get THIS_MODULE */
Signature · 1 line
~Randy