diff mbox series

[bpf-next] bpf: fix inconsistent return types of bpf_xdp_copy_buf().

Message ID 20230804005101.1534505-1-thinker.li@gmail.com (mailing list archive)
State Accepted
Commit 8a60a041eada0fbfdc7b6b7a10fdf68ae6a840ce
Delegated to: BPF
Headers show
Series [bpf-next] bpf: fix inconsistent return types of bpf_xdp_copy_buf(). | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2676 this patch: 2676
netdev/cc_maintainers warning 11 maintainers not CCed: kuba@kernel.org hawk@kernel.org daniel@iogearbox.net netdev@vger.kernel.org kpsingh@kernel.org john.fastabend@gmail.com sdf@google.com yonghong.song@linux.dev davem@davemloft.net jolsa@kernel.org haoluo@google.com
netdev/build_clang success Errors and warnings before: 1498 this patch: 1498
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2722 this patch: 2722
netdev/checkpatch warning WARNING: line length of 87 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-11 success Logs for test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-13 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-14 success Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-15 success Logs for test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-17 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-18 success Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-20 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-21 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-23 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-24 success Logs for test_progs_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-28 success Logs for test_verifier on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-16 fail Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-26 fail Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for test_maps on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-5 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-6 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-4 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-7 success Logs for test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-19 success Logs for test_progs_no_alu32_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-22 success Logs for test_progs_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-25 success Logs for test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-27 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-29 success Logs for veristat

Commit Message

Kui-Feng Lee Aug. 4, 2023, 12:51 a.m. UTC
From: Kui-Feng Lee <thinker.li@gmail.com>

Fix inconsistent return types in two implementations of bpf_xdp_copy_buf().

There are two implementations: one is an empty implementation whose return
type does not match the actual implementation.

Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
---
 include/linux/filter.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Yonghong Song Aug. 4, 2023, 1:41 a.m. UTC | #1
On 8/3/23 5:51 PM, thinker.li@gmail.com wrote:
> From: Kui-Feng Lee <thinker.li@gmail.com>
> 
> Fix inconsistent return types in two implementations of bpf_xdp_copy_buf().
> 
> There are two implementations: one is an empty implementation whose return
> type does not match the actual implementation.
> 
> Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
> Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>

Looks like a fix tag is not needed as the old code won't cause
compilation warnings or runtime errors despite the signature mismatch.

Acked-by: Yonghong Song <yonghong.song@linux.dev>

> ---
>   include/linux/filter.h | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/filter.h b/include/linux/filter.h
> index 2d6fe30bad5f..761af6b3cf2b 100644
> --- a/include/linux/filter.h
> +++ b/include/linux/filter.h
> @@ -1572,10 +1572,9 @@ static inline void *bpf_xdp_pointer(struct xdp_buff *xdp, u32 offset, u32 len)
>   	return NULL;
>   }
>   
> -static inline void *bpf_xdp_copy_buf(struct xdp_buff *xdp, unsigned long off, void *buf,
> -				     unsigned long len, bool flush)
> +static inline void bpf_xdp_copy_buf(struct xdp_buff *xdp, unsigned long off, void *buf,
> +				    unsigned long len, bool flush)
>   {
> -	return NULL;
>   }
>   #endif /* CONFIG_NET */
>
Kui-Feng Lee Aug. 4, 2023, 5:25 p.m. UTC | #2
On 8/3/23 18:41, Yonghong Song wrote:
> 
> 
> On 8/3/23 5:51 PM, thinker.li@gmail.com wrote:
>> From: Kui-Feng Lee <thinker.li@gmail.com>
>>
>> Fix inconsistent return types in two implementations of 
>> bpf_xdp_copy_buf().
>>
>> There are two implementations: one is an empty implementation whose 
>> return
>> type does not match the actual implementation.
>>
>> Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
>> Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
> 
> Looks like a fix tag is not needed as the old code won't cause
> compilation warnings or runtime errors despite the signature mismatch.
> 
> Acked-by: Yonghong Song <yonghong.song@linux.dev>

Thank you for the review!

> 
>> ---
>>   include/linux/filter.h | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/linux/filter.h b/include/linux/filter.h
>> index 2d6fe30bad5f..761af6b3cf2b 100644
>> --- a/include/linux/filter.h
>> +++ b/include/linux/filter.h
>> @@ -1572,10 +1572,9 @@ static inline void *bpf_xdp_pointer(struct 
>> xdp_buff *xdp, u32 offset, u32 len)
>>       return NULL;
>>   }
>> -static inline void *bpf_xdp_copy_buf(struct xdp_buff *xdp, unsigned 
>> long off, void *buf,
>> -                     unsigned long len, bool flush)
>> +static inline void bpf_xdp_copy_buf(struct xdp_buff *xdp, unsigned 
>> long off, void *buf,
>> +                    unsigned long len, bool flush)
>>   {
>> -    return NULL;
>>   }
>>   #endif /* CONFIG_NET */
patchwork-bot+netdevbpf@kernel.org Aug. 4, 2023, 9:50 p.m. UTC | #3
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:

On Thu,  3 Aug 2023 17:51:01 -0700 you wrote:
> From: Kui-Feng Lee <thinker.li@gmail.com>
> 
> Fix inconsistent return types in two implementations of bpf_xdp_copy_buf().
> 
> There are two implementations: one is an empty implementation whose return
> type does not match the actual implementation.
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpf: fix inconsistent return types of bpf_xdp_copy_buf().
    https://git.kernel.org/bpf/bpf-next/c/8a60a041eada

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/linux/filter.h b/include/linux/filter.h
index 2d6fe30bad5f..761af6b3cf2b 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -1572,10 +1572,9 @@  static inline void *bpf_xdp_pointer(struct xdp_buff *xdp, u32 offset, u32 len)
 	return NULL;
 }
 
-static inline void *bpf_xdp_copy_buf(struct xdp_buff *xdp, unsigned long off, void *buf,
-				     unsigned long len, bool flush)
+static inline void bpf_xdp_copy_buf(struct xdp_buff *xdp, unsigned long off, void *buf,
+				    unsigned long len, bool flush)
 {
-	return NULL;
 }
 #endif /* CONFIG_NET */