History

ring_buffer: Change some static functions to void

The results of some static functions are not used. Change the type of these function to void and remove unnecessary returns. No functional change intended. Link: https://lkml.kernel.org/r/20230305155532.5549-2-ubizjak@gmail.com

Uros Bizjak committed 3 years ago

Commit b4b55df1 parent fee86a41 file · +7 −15Browse files

Showing the changes to kernel/trace/ring_buffer.c (1 of 1 file). Show all

Unified · Split

kernel/trace/ring_buffer.c+7−15
@@ -1565,15 +1565,12 @@ static void rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer, · 1564 unmodified lines
15651565 }
15661566 }
15671567
1568−static int rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer,
1568+static void rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer,
15691569 struct buffer_page *bpage)
15701570 {
15711571 unsigned long val = (unsigned long)bpage;
15721572
1573− if (RB_WARN_ON(cpu_buffer, val & RB_FLAG_MASK))
1574− return 1;
1575−
1576− return 0;
1573+ RB_WARN_ON(cpu_buffer, val & RB_FLAG_MASK);
15771574 }
15781575
15791576 /**
@@ -1583,30 +1580,28 @@ static int rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer, · 3 unmodified lines
15831580 * As a safety measure we check to make sure the data pages have not
15841581 * been corrupted.
15851582 */
1586−static int rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer)
1583+static void rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer)
15871584 {
15881585 struct list_head *head = rb_list_head(cpu_buffer->pages);
15891586 struct list_head *tmp;
15901587
15911588 if (RB_WARN_ON(cpu_buffer,
15921589 rb_list_head(rb_list_head(head->next)->prev) != head))
1593− return -1;
1590+ return;
15941591
15951592 if (RB_WARN_ON(cpu_buffer,
15961593 rb_list_head(rb_list_head(head->prev)->next) != head))
1597− return -1;
1594+ return;
15981595
15991596 for (tmp = rb_list_head(head->next); tmp != head; tmp = rb_list_head(tmp->next)) {
16001597 if (RB_WARN_ON(cpu_buffer,
16011598 rb_list_head(rb_list_head(tmp->next)->prev) != tmp))
1602− return -1;
1599+ return;
16031600
16041601 if (RB_WARN_ON(cpu_buffer,
16051602 rb_list_head(rb_list_head(tmp->prev)->next) != tmp))
1606− return -1;
1603+ return;
16071604 }
1608−
1609− return 0;
16101605 }
16111606
16121607 static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,
@@ -4496,7 +4491,6 @@ rb_update_read_stamp(struct ring_buffer_per_cpu *cpu_buffer, · 2883 unmodified lines
44964491 default:
44974492 RB_WARN_ON(cpu_buffer, 1);
44984493 }
4499− return;
45004494 }
45014495
45024496 static void
@@ -4527,7 +4521,6 @@ rb_update_iter_read_stamp(struct ring_buffer_iter *iter, · 24 unmodified lines
45274521 default:
45284522 RB_WARN_ON(iter->cpu_buffer, 1);
45294523 }
4530− return;
45314524 }
45324525
45334526 static struct buffer_page *
@@ -4942,7 +4935,6 @@ rb_reader_unlock(struct ring_buffer_per_cpu *cpu_buffer, bool locked) · 408 unmodified lines
49424935 {
49434936 if (likely(locked))
49444937 raw_spin_unlock(&cpu_buffer->reader_lock);
4945− return;
49464938 }
49474939
49484940 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t