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
Showing the changes to kernel/trace/ring_buffer.c (1 of 1 file). Show all
Unified · Split
| @@ -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 | |
| 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, | |
| 1569 | 1569 | struct buffer_page *bpage) |
| 1570 | 1570 | { |
| 1571 | 1571 | unsigned long val = (unsigned long)bpage; |
| 1572 | 1572 | |
| 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); | |
| 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 | 1580 | * As a safety measure we check to make sure the data pages have not |
| 1584 | 1581 | * been corrupted. |
| 1585 | 1582 | */ |
| 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) | |
| 1587 | 1584 | { |
| 1588 | 1585 | struct list_head *head = rb_list_head(cpu_buffer->pages); |
| 1589 | 1586 | struct list_head *tmp; |
| 1590 | 1587 | |
| 1591 | 1588 | if (RB_WARN_ON(cpu_buffer, |
| 1592 | 1589 | rb_list_head(rb_list_head(head->next)->prev) != head)) |
| 1593 | − return -1; | |
| 1590 | + return; | |
| 1594 | 1591 | |
| 1595 | 1592 | if (RB_WARN_ON(cpu_buffer, |
| 1596 | 1593 | rb_list_head(rb_list_head(head->prev)->next) != head)) |
| 1597 | − return -1; | |
| 1594 | + return; | |
| 1598 | 1595 | |
| 1599 | 1596 | for (tmp = rb_list_head(head->next); tmp != head; tmp = rb_list_head(tmp->next)) { |
| 1600 | 1597 | if (RB_WARN_ON(cpu_buffer, |
| 1601 | 1598 | rb_list_head(rb_list_head(tmp->next)->prev) != tmp)) |
| 1602 | − return -1; | |
| 1599 | + return; | |
| 1603 | 1600 | |
| 1604 | 1601 | if (RB_WARN_ON(cpu_buffer, |
| 1605 | 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 | |
| 1612 | 1607 | 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 | ||
| 4496 | 4491 | default: |
| 4497 | 4492 | RB_WARN_ON(cpu_buffer, 1); |
| 4498 | 4493 | } |
| 4499 | − return; | |
| 4500 | 4494 | } |
| 4501 | 4495 | |
| 4502 | 4496 | static void |
| @@ -4527,7 +4521,6 @@ rb_update_iter_read_stamp(struct ring_buffer_iter *iter, · 24 unmodified lines | ||
| 4527 | 4521 | default: |
| 4528 | 4522 | RB_WARN_ON(iter->cpu_buffer, 1); |
| 4529 | 4523 | } |
| 4530 | − return; | |
| 4531 | 4524 | } |
| 4532 | 4525 | |
| 4533 | 4526 | static 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 | 4936 | if (likely(locked)) |
| 4944 | 4937 | raw_spin_unlock(&cpu_buffer->reader_lock); |
| 4945 | − return; | |
| 4946 | 4938 | } |
| 4947 | 4939 | |
| 4948 | 4940 | /** |