linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: Fix compile error of bin_attribute::read/write()
@ 2025-06-04  5:53 Rong Tao
  2025-06-04  8:53 ` Jiri Olsa
  2025-06-05 16:58 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Rong Tao @ 2025-06-04  5:53 UTC (permalink / raw)
  To: andrii, eddyz87
  Cc: rongtao, rtoax, Mykola Lysenko, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Shuah Khan, Maxime Coquelin, Alexandre Torgue, Peter Zijlstra,
	Amery Hung, Juntong Deng, Oleg Nesterov,
	open list:BPF [SELFTESTS] (Test Runners & Infrastructure),
	open list:KERNEL SELFTEST FRAMEWORK,
	moderated list:ARM/STM32 ARCHITECTURE,
	moderated list:ARM/STM32 ARCHITECTURE, open list

From: Rong Tao <rongtao@cestc.cn>

Since commit 97d06802d10a ("sysfs: constify bin_attribute argument of
bin_attribute::read/write()"), make bin_attribute parameter of
bin_attribute::read/write() const.

Signed-off-by: Rong Tao <rongtao@cestc.cn>
---
 tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
index e6c248e3ae54..e9e918cdf31f 100644
--- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
+++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
@@ -385,7 +385,7 @@ int bpf_testmod_fentry_ok;
 
 noinline ssize_t
 bpf_testmod_test_read(struct file *file, struct kobject *kobj,
-		      struct bin_attribute *bin_attr,
+		      const struct bin_attribute *bin_attr,
 		      char *buf, loff_t off, size_t len)
 {
 	struct bpf_testmod_test_read_ctx ctx = {
@@ -465,7 +465,7 @@ ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO);
 
 noinline ssize_t
 bpf_testmod_test_write(struct file *file, struct kobject *kobj,
-		      struct bin_attribute *bin_attr,
+		      const struct bin_attribute *bin_attr,
 		      char *buf, loff_t off, size_t len)
 {
 	struct bpf_testmod_test_write_ctx ctx = {
@@ -567,7 +567,7 @@ static void testmod_unregister_uprobe(void)
 
 static ssize_t
 bpf_testmod_uprobe_write(struct file *file, struct kobject *kobj,
-			 struct bin_attribute *bin_attr,
+			 const struct bin_attribute *bin_attr,
 			 char *buf, loff_t off, size_t len)
 {
 	unsigned long offset = 0;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Fix compile error of bin_attribute::read/write()
  2025-06-04  5:53 [PATCH bpf-next] selftests/bpf: Fix compile error of bin_attribute::read/write() Rong Tao
@ 2025-06-04  8:53 ` Jiri Olsa
  2025-06-04  9:12   ` Rong Tao
  2025-06-05 16:58 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Jiri Olsa @ 2025-06-04  8:53 UTC (permalink / raw)
  To: Rong Tao
  Cc: andrii, eddyz87, rongtao, Mykola Lysenko, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Shuah Khan,
	Maxime Coquelin, Alexandre Torgue, Peter Zijlstra, Amery Hung,
	Juntong Deng, Oleg Nesterov,
	open list:BPF [SELFTESTS] (Test Runners & Infrastructure),
	open list:KERNEL SELFTEST FRAMEWORK,
	moderated list:ARM/STM32 ARCHITECTURE,
	moderated list:ARM/STM32 ARCHITECTURE, open list

On Wed, Jun 04, 2025 at 01:53:22PM +0800, Rong Tao wrote:
> From: Rong Tao <rongtao@cestc.cn>
> 
> Since commit 97d06802d10a ("sysfs: constify bin_attribute argument of
> bin_attribute::read/write()"), make bin_attribute parameter of
> bin_attribute::read/write() const.

hi,
there's already fix for this in bpf/master

thanks,
jirka

> 
> Signed-off-by: Rong Tao <rongtao@cestc.cn>
> ---
>  tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
> index e6c248e3ae54..e9e918cdf31f 100644
> --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
> +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
> @@ -385,7 +385,7 @@ int bpf_testmod_fentry_ok;
>  
>  noinline ssize_t
>  bpf_testmod_test_read(struct file *file, struct kobject *kobj,
> -		      struct bin_attribute *bin_attr,
> +		      const struct bin_attribute *bin_attr,
>  		      char *buf, loff_t off, size_t len)
>  {
>  	struct bpf_testmod_test_read_ctx ctx = {
> @@ -465,7 +465,7 @@ ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO);
>  
>  noinline ssize_t
>  bpf_testmod_test_write(struct file *file, struct kobject *kobj,
> -		      struct bin_attribute *bin_attr,
> +		      const struct bin_attribute *bin_attr,
>  		      char *buf, loff_t off, size_t len)
>  {
>  	struct bpf_testmod_test_write_ctx ctx = {
> @@ -567,7 +567,7 @@ static void testmod_unregister_uprobe(void)
>  
>  static ssize_t
>  bpf_testmod_uprobe_write(struct file *file, struct kobject *kobj,
> -			 struct bin_attribute *bin_attr,
> +			 const struct bin_attribute *bin_attr,
>  			 char *buf, loff_t off, size_t len)
>  {
>  	unsigned long offset = 0;
> -- 
> 2.49.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Fix compile error of bin_attribute::read/write()
  2025-06-04  8:53 ` Jiri Olsa
@ 2025-06-04  9:12   ` Rong Tao
  0 siblings, 0 replies; 4+ messages in thread
From: Rong Tao @ 2025-06-04  9:12 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: andrii, eddyz87, rongtao, Mykola Lysenko, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Shuah Khan,
	Maxime Coquelin, Alexandre Torgue, Peter Zijlstra, Amery Hung,
	Juntong Deng, Oleg Nesterov,
	open list:BPF [SELFTESTS] (Test Runners & Infrastructure),
	open list:KERNEL SELFTEST FRAMEWORK,
	moderated list:ARM/STM32 ARCHITECTURE,
	moderated list:ARM/STM32 ARCHITECTURE, open list


On 6/4/25 16:53, Jiri Olsa wrote:
> On Wed, Jun 04, 2025 at 01:53:22PM +0800, Rong Tao wrote:
>> From: Rong Tao <rongtao@cestc.cn>
>>
>> Since commit 97d06802d10a ("sysfs: constify bin_attribute argument of
>> bin_attribute::read/write()"), make bin_attribute parameter of
>> bin_attribute::read/write() const.
> hi,
> there's already fix for this in bpf/master
>
> thanks,
> jirka
I am confused, when should I use bpf/master[2] and when should I use
bpf-next/master[1]? thank you :)

[1] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Fix compile error of bin_attribute::read/write()
  2025-06-04  5:53 [PATCH bpf-next] selftests/bpf: Fix compile error of bin_attribute::read/write() Rong Tao
  2025-06-04  8:53 ` Jiri Olsa
@ 2025-06-05 16:58 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-05 16:58 UTC (permalink / raw)
  To: Rong Tao
  Cc: andrii, eddyz87, rongtao, mykolal, ast, daniel, martin.lau, song,
	yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, shuah,
	mcoquelin.stm32, alexandre.torgue, peterz, ameryhung,
	juntong.deng, oleg, bpf, linux-kselftest, linux-stm32,
	linux-arm-kernel, linux-kernel

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Wed,  4 Jun 2025 13:53:22 +0800 you wrote:
> From: Rong Tao <rongtao@cestc.cn>
> 
> Since commit 97d06802d10a ("sysfs: constify bin_attribute argument of
> bin_attribute::read/write()"), make bin_attribute parameter of
> bin_attribute::read/write() const.
> 
> Signed-off-by: Rong Tao <rongtao@cestc.cn>
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests/bpf: Fix compile error of bin_attribute::read/write()
    https://git.kernel.org/bpf/bpf-next/c/4b65d5ae9714

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-05 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-04  5:53 [PATCH bpf-next] selftests/bpf: Fix compile error of bin_attribute::read/write() Rong Tao
2025-06-04  8:53 ` Jiri Olsa
2025-06-04  9:12   ` Rong Tao
2025-06-05 16:58 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).