Skip to contentSkip to conversation

block: Change extern inline to static inline

PATCH Applied Tobias Klauser 2 participants 2 messages Nov 18, 2016 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 block: Change extern inline to static inline

With compilers which follow the C99 standard (like modern versions of gcc and clang), "extern inline" does the opposite thing from older versions of gcc (emits code for an externally linkable version of the inline function).

"static inline" does the intended behavior in all cases instead.

Description taken from commit 6d91857d4826 ("staging, rtl8192e,
LLVMLinux: Change extern inline to static inline").

This also fixes the following GCC warning when building with CONFIG_PM disabled:

./include/linux/blkdev.h:1143:20: warning: no previous prototype for 'blk_set_runtime_active' [-Wmissing-prototypes]

Fixes d07ab6d11477 ("block: Add blk_set_runtime_active()")
---
 include/linux/blkdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blkdev.h +1 -1
index 00eb55e63d33..5fdad2d7e895 100644
@@ -1187,7 +1187,7 @@ static inline int blk_pre_runtime_suspend(struct request_queue *q)
 static inline void blk_post_runtime_suspend(struct request_queue *q, int err) {}
 static inline void blk_pre_runtime_resume(struct request_queue *q) {}
 static inline void blk_post_runtime_resume(struct request_queue *q, int err) {}
-extern inline void blk_set_runtime_active(struct request_queue *q) {}
+static inline void blk_set_runtime_active(struct request_queue *q) {}
 #endif
 
 /*
Signature · 1 line
2.11.0.rc0.7.gbe5a750
maintainer Applied
#1 lore raw
Quoted 7 lines · Tobias Klauser

With compilers which follow the C99 standard (like modern versions of gcc and clang), "extern inline" does the opposite thing from older versions of gcc (emits code for an externally linkable version of the inline function).

"static inline" does the intended behavior in all cases instead.

Quoted 8 lines

Description taken from commit 6d91857d4826 ("staging, rtl8192e,
LLVMLinux: Change extern inline to static inline").

This also fixes the following GCC warning when building with CONFIG_PM disabled:

./include/linux/blkdev.h:1143:20: warning: no previous prototype for 'blk_set_runtime_active' [-Wmissing-prototypes]

Applied, thanks.

Signature · 1 line
Jens Axboe