Skip to content

Commit 36e92d7

Browse files
committed
selftests/bpf: Fix bpf selftest build error
JIRA: https://issues.redhat.com/browse/RHEL-116876 commit 4b65d5a Author: Saket Kumar Bhaskar <skb99@linux.ibm.com> Date: Mon May 12 14:41:07 2025 +0530 selftests/bpf: Fix bpf selftest build error On linux-next, build for bpf selftest displays an error due to mismatch in the expected function signature of bpf_testmod_test_read and bpf_testmod_test_write. Commit 97d0680 ("sysfs: constify bin_attribute argument of bin_attribute::read/write()") changed the required type for struct bin_attribute to const struct bin_attribute. To resolve the error, update corresponding signature for the callback. Fixes: 97d0680 ("sysfs: constify bin_attribute argument of bin_attribute::read/write()") Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Closes: https://lore.kernel.org/all/e915da49-2b9a-4c4c-a34f-877f378129f6@linux.ibm.com/ Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com> Link: https://lore.kernel.org/r/20250512091108.2015615-1-skb99@linux.ibm.com Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
1 parent d87b7bd commit 36e92d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/selftests/bpf/test_kmods/bpf_testmod.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ int bpf_testmod_fentry_ok;
385385

386386
noinline ssize_t
387387
bpf_testmod_test_read(struct file *file, struct kobject *kobj,
388-
struct bin_attribute *bin_attr,
388+
const struct bin_attribute *bin_attr,
389389
char *buf, loff_t off, size_t len)
390390
{
391391
struct bpf_testmod_test_read_ctx ctx = {
@@ -465,7 +465,7 @@ ALLOW_ERROR_INJECTION(bpf_testmod_test_read, ERRNO);
465465

466466
noinline ssize_t
467467
bpf_testmod_test_write(struct file *file, struct kobject *kobj,
468-
struct bin_attribute *bin_attr,
468+
const struct bin_attribute *bin_attr,
469469
char *buf, loff_t off, size_t len)
470470
{
471471
struct bpf_testmod_test_write_ctx ctx = {
@@ -567,7 +567,7 @@ static void testmod_unregister_uprobe(void)
567567

568568
static ssize_t
569569
bpf_testmod_uprobe_write(struct file *file, struct kobject *kobj,
570-
struct bin_attribute *bin_attr,
570+
const struct bin_attribute *bin_attr,
571571
char *buf, loff_t off, size_t len)
572572
{
573573
unsigned long offset = 0;

0 commit comments

Comments
 (0)