Skip to content

Commit 4b65d5a

Browse files
Saket Kumar BhaskarAlexei Starovoitov
authored andcommitted
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 <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Tested-by: Venkat Rao Bagalkote <[email protected]> Signed-off-by: Saket Kumar Bhaskar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent bb1556e commit 4b65d5a

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)