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
1565 }1565 }
1566}1566}
1567 1567
1568static int rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer,1568static void rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer,
1569 struct buffer_page *bpage)1569 struct buffer_page *bpage)
1570{1570{
1571 unsigned long val = (unsigned long)bpage;1571 unsigned long val = (unsigned long)bpage;
1572 1572
1573 if (RB_WARN_ON(cpu_buffer, val & RB_FLAG_MASK))1573 RB_WARN_ON(cpu_buffer, val & RB_FLAG_MASK);
1574 return 1;
1575
1576 return 0;
1577}1574}
1578 1575
1579/**1576/**
@@ -1583,30 +1580,28 @@ static int rb_check_bpage(struct ring_buffer_per_cpu *cpu_buffer, · 3 unmodified lines
1583 * As a safety measure we check to make sure the data pages have not1580 * As a safety measure we check to make sure the data pages have not
1584 * been corrupted.1581 * been corrupted.
1585 */1582 */
1586static int rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer)1583static void rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer)
1587{1584{
1588 struct list_head *head = rb_list_head(cpu_buffer->pages);1585 struct list_head *head = rb_list_head(cpu_buffer->pages);
1589 struct list_head *tmp;1586 struct list_head *tmp;
1590 1587
1591 if (RB_WARN_ON(cpu_buffer,1588 if (RB_WARN_ON(cpu_buffer,
1592 rb_list_head(rb_list_head(head->next)->prev) != head))1589 rb_list_head(rb_list_head(head->next)->prev) != head))
1593 return -1;1590 return;
1594 1591
1595 if (RB_WARN_ON(cpu_buffer,1592 if (RB_WARN_ON(cpu_buffer,
1596 rb_list_head(rb_list_head(head->prev)->next) != head))1593 rb_list_head(rb_list_head(head->prev)->next) != head))
1597 return -1;1594 return;
1598 1595
1599 for (tmp = rb_list_head(head->next); tmp != head; tmp = rb_list_head(tmp->next)) {1596 for (tmp = rb_list_head(head->next); tmp != head; tmp = rb_list_head(tmp->next)) {
1600 if (RB_WARN_ON(cpu_buffer,1597 if (RB_WARN_ON(cpu_buffer,
1601 rb_list_head(rb_list_head(tmp->next)->prev) != tmp))1598 rb_list_head(rb_list_head(tmp->next)->prev) != tmp))
1602 return -1;1599 return;
1603 1600
1604 if (RB_WARN_ON(cpu_buffer,1601 if (RB_WARN_ON(cpu_buffer,
1605 rb_list_head(rb_list_head(tmp->prev)->next) != tmp))1602 rb_list_head(rb_list_head(tmp->prev)->next) != tmp))
1606 return -1;1603 return;
1607 }1604 }
1608
1609 return 0;
1610}1605}
1611 1606
1612static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,1607static 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
4496 default:4491 default:
4497 RB_WARN_ON(cpu_buffer, 1);4492 RB_WARN_ON(cpu_buffer, 1);
4498 }4493 }
4499 return;
4500}4494}
4501 4495
4502static void4496static void
@@ -4527,7 +4521,6 @@ rb_update_iter_read_stamp(struct ring_buffer_iter *iter, · 24 unmodified lines
4527 default:4521 default:
4528 RB_WARN_ON(iter->cpu_buffer, 1);4522 RB_WARN_ON(iter->cpu_buffer, 1);
4529 }4523 }
4530 return;
4531}4524}
4532 4525
4533static struct buffer_page *4526static struct buffer_page *
@@ -4942,7 +4935,6 @@ rb_reader_unlock(struct ring_buffer_per_cpu *cpu_buffer, bool locked) · 408 unmodified lines
4942{4935{
4943 if (likely(locked))4936 if (likely(locked))
4944 raw_spin_unlock(&cpu_buffer->reader_lock);4937 raw_spin_unlock(&cpu_buffer->reader_lock);
4945 return;
4946}4938}
4947 4939
4948/**4940/**

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