Re: [PATCH] libbpf: add bpf object kern_version attribute setter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+int bpf_object__set_kversion(struct bpf_object *obj, char *kern_version)
+{
+       __u32 major, minor, patch;
+
+       if (!kern_version) {
+               obj->kern_version = 0;
+               return 0;
+       }
+ if (sscanf(kern_version, "%u.%u.%u", &major, &minor, &patch) != 3)

given SEC("version") expects `int` and bpf_object__kversion() returns
int, I think it's appropriate for bpf_object__set_kversion() to accept
just opaque int as well. Please also check that obj is not loaded and
return error if it is. Thanks!

Oh, and please use [PATCH bpf-next] subject prefix to specify that
this is destined to the bpf-next tree. You'll also add v2 in between
PATCH and bpf-next for the next version, of course.

will do, and sorry for the initial burden, getting used to libbpf devel.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux