ring-buffer: Remove unused function __rb_data_page_index()
Subsystems (2)
PATCH 1/1 ring-buffer: Remove unused function __rb_data_page_index()
This fixes the following warning when building with clang:
kernel/trace/ring_buffer.c:1842:1: error: unused function
'__rb_data_page_index' [-Werror,-Wunused-function]
--- kernel/trace/ring_buffer.c | 6 ------ 1 file changed, 6 deletions(-)
kernel/trace/ring_buffer.c +0 -6
@@ -1800,12 +1800,6 @@ void ring_buffer_change_overwrite(struct ring_buffer *buffer, int val) }EXPORT_SYMBOL_GPL (ring_buffer_change_overwrite); -static __always_inline void * -__rb_data_page_index (struct buffer_data_page *bpage,unsigned index) -{ -return bpage->data + index; -} - static __always_inline void *__rb_page_index(struct buffer_page *bpage, unsigned index) {return bpage->page->data + index;
Signature · 1 line
2.13.0.303.g4ebf302169-goog
Hi,
This appears to have been introduced in 2009 by commit afbab76a62b6 ("ring-buffer: have read page swap increment counter with page entries"), which removed the user of the function but not the function itself. If folks were so inclined, this could be picked back to linux-stable, but I'm not sure it's worth it.
Quoted 17 lines · Matthias Kaehlcke
This fixes the following warning when building with clang:
kernel/trace/ring_buffer.c:1842:1: error: unused function'__rb_data_page_index' [-Werror,-Wunused-function]Signed-off-by Matthias Kaehlcke <[email protected]>--- kernel/trace/ring_buffer.c | 6 ------ 1 file changed, 6 deletions(-)kernel/trace/ring_buffer.c +0
-0@@ -1800,12 +1800,6 @@ void ring_buffer_change_overwrite(struct ring_buffer *buffer, int val) }EXPORT_SYMBOL_GPL (ring_buffer_change_overwrite);
kernel/trace/ring_buffer.c void ring_buffer_change_overwrite(struct ring_buffer *buffer, int val) · line 1805
Quoted 10 lines
kernel/trace/ring_buffer.c +0
-6-static __always_inline void * -__rb_data_page_index (struct buffer_data_page *bpage,unsigned index) -{ -return bpage->data + index; -} - static __always_inline void *__rb_page_index(struct buffer_page *bpage, unsigned index) {return bpage->page->data + index;
FWIW:
Steven Rostedt
maintainerQuoted 7 lines · On Thu, 18 May 2017 12:40:02 -0700 Doug Anderson <[email protected]> wrote:
Hi,
This appears to have been introduced in 2009 by commit
afbab76a62b6("ring-buffer: have read page swap increment counter with page entries"), which removed the user of the function but not the function itself. If folks were so inclined, this could be picked back to linux-stable, but I'm not sure it's worth it.
It doesn't do anything but waste some disk space in the source repository. It's a static inline function, which means it's not created unless something calls it.
Thus, not worth the stable churn.
-- Steve
Hi,
Quoted 11 lines · Steven Rostedt
Quoted 7 lines · On Thu, 18 May 2017 12:40:02 -0700 Doug Anderson <[email protected]> wrote:
Hi,
This appears to have been introduced in 2009 by commit
afbab76a62b6("ring-buffer: have read page swap increment counter with page entries"), which removed the user of the function but not the function itself. If folks were so inclined, this could be picked back to linux-stable, but I'm not sure it's worth it.
Quoted 5 lines
It doesn't do anything but waste some disk space in the source repository. It's a static inline function, which means it's not created unless something calls it.
Thus, not worth the stable churn.
Yup, that's sane. I guess not much chance of someone trying to get clang to run w/ no warnings by just picking stable patches. ;-)
-Doug
Steven Rostedt
maintainerQuoted 4 lines · On Wed, 17 May 2017 17:14:15 -0700 Matthias Kaehlcke <[email protected]> wrote:
This fixes the following warning when building with clang:
kernel/trace/ring_buffer.c:1842:1: error: unused function'__rb_data_page_index' [-Werror,-Wunused-function]
Ug, I this patch somehow fell through. I'm applying it now.
-- Steve
Quoted 23 lines
Signed-off-by Matthias Kaehlcke <[email protected]>--- kernel/trace/ring_buffer.c | 6 ------ 1 file changed, 6 deletions(-)kernel/trace/ring_buffer.c +0
-6@@ -1800,12 +1800,6 @@ void ring_buffer_change_overwrite(struct ring_buffer *buffer, int val) }EXPORT_SYMBOL_GPL (ring_buffer_change_overwrite); -static __always_inline void * -__rb_data_page_index (struct buffer_data_page *bpage,unsigned index) -{ -return bpage->data + index; -} - static __always_inline void *__rb_page_index(struct buffer_page *bpage, unsigned index) {return bpage->page->data + index;