[PATCH] bpf, docs: iterator: Rectify non-standard line break

WangYuli posted 1 patch 9 months, 3 weeks ago
Documentation/bpf/bpf_iterators.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] bpf, docs: iterator: Rectify non-standard line break
Posted by WangYuli 9 months, 3 weeks ago
Even though the kernel's coding-style document does not explicitly
state this, we generally put a newline after the semicolon of every
C language statement to enhance code readability.

Adjust the placement of newlines to adhere to this convention.

Reported-by: Chen Linxuan <chenlinxuan@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
 Documentation/bpf/bpf_iterators.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/bpf/bpf_iterators.rst b/Documentation/bpf/bpf_iterators.rst
index 7f514cb6b052..385cd05aabf5 100644
--- a/Documentation/bpf/bpf_iterators.rst
+++ b/Documentation/bpf/bpf_iterators.rst
@@ -323,8 +323,8 @@ Now, in the userspace program, pass the pointer of struct to the
 
 ::
 
-  link = bpf_program__attach_iter(prog, &opts); iter_fd =
-  bpf_iter_create(bpf_link__fd(link));
+  link = bpf_program__attach_iter(prog, &opts);
+  iter_fd = bpf_iter_create(bpf_link__fd(link));
 
 If both *tid* and *pid* are zero, an iterator created from this struct
 ``bpf_iter_attach_opts`` will include every opened file of every task in the
-- 
2.49.0
Re: [PATCH] bpf, docs: iterator: Rectify non-standard line break
Posted by Yanteng Si 9 months, 2 weeks ago
在 4/23/25 11:06 AM, WangYuli 写道:
> Even though the kernel's coding-style document does not explicitly
> state this, we generally put a newline after the semicolon of every
> C language statement to enhance code readability.
>
> Adjust the placement of newlines to adhere to this convention.
>
> Reported-by: Chen Linxuan <chenlinxuan@uniontech.com>
> Signed-off-by: WangYuli <wangyuli@uniontech.com>

Reviewed-by: Yanteng Si <si.yanteng@linux.dev>


Thanks,

Yanteng

> ---
>   Documentation/bpf/bpf_iterators.rst | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/bpf/bpf_iterators.rst b/Documentation/bpf/bpf_iterators.rst
> index 7f514cb6b052..385cd05aabf5 100644
> --- a/Documentation/bpf/bpf_iterators.rst
> +++ b/Documentation/bpf/bpf_iterators.rst
> @@ -323,8 +323,8 @@ Now, in the userspace program, pass the pointer of struct to the
>   
>   ::
>   
> -  link = bpf_program__attach_iter(prog, &opts); iter_fd =
> -  bpf_iter_create(bpf_link__fd(link));
> +  link = bpf_program__attach_iter(prog, &opts);
> +  iter_fd = bpf_iter_create(bpf_link__fd(link));
>   
>   If both *tid* and *pid* are zero, an iterator created from this struct
>   ``bpf_iter_attach_opts`` will include every opened file of every task in the