Skip to contentSkip to conversation

ring-buffer: Remove unused function __rb_data_page_index()

PATCH In review Matthias Kaehlcke 3 participants 5 messages May 18, 2017 – Dec 4, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 4ae268e687fe..a6b87582c4ff 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw

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]
---
 kernel/trace/ring_buffer.c | 6 ------
 1 file changed, 6 deletions(-)
kernel/trace/ring_buffer.c +0 -0
index 4ae268e687fe..a6b87582c4ff 100644
@@ -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:

maintainer
#2 lore raw
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.

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

#3 lore raw

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

maintainer
#4 lore raw
In reply to Matthias Kaehlcke
Quoted 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
---
 kernel/trace/ring_buffer.c | 6 ------
 1 file changed, 6 deletions(-)
kernel/trace/ring_buffer.c +0 -6
index 4ae268e687fe..a6b87582c4ff 100644
@@ -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;