Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Inclusion of LINUX_VERSION_CODE checks for out-of-tree/LTS compatibility in mainline code.
--
--- Patch [2]: [PATCH v13 2/3] perf: Add Raspberry Pi BCM2835 AXI PMU driver ---
commit c667a74c49bf6e5e64002019c6914cc36bf088da
Author: Ian Rogers <[email protected]>
perf: Add Raspberry Pi BCM2835 AXI PMU driver
This commit adds a new performance monitoring driver for the Raspberry Pi
AXI bus (BCM2835/2711), exposing system-level and VideoCore PMU hardware to
the Linux perf subsystem natively via the VideoCore mailbox interface.
> Note on out-of-tree macro compatibility:
> The inclusion of #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0)
> surrounding hrtimer_setup is intentionally maintained alongside
> this patch to guarantee seamless out-of-tree compilation fallback
> compatibility for Raspberry Pi Long Term Support (LTS) kernel variants.
[Severity: Low]
This isn't a bug, but does upstream accept LINUX_VERSION_CODE macros for
backward compatibility in mainline code? Upstream policy generally prohibits
adding backward compatibility ifdefs to support out-of-tree or older LTS
kernels. All code submitted to mainline is expected to compile against the
current kernel's internal API, leaving backward compatibility to stable tree
backporters or out-of-tree maintainers.
> diff --git a/drivers/perf/rpi_axi_pmu.c b/drivers/perf/rpi_axi_pmu.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/perf/rpi_axi_pmu.c
[ ... ]
> +#include <linux/io.h>
> +#include <linux/version.h>
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0)
> +static inline void rpi_hrtimer_setup(struct hrtimer *timer,
> + enum hrtimer_restart (*function)(struct hrtimer *),
> + clockid_t clock_id, enum hrtimer_mode mode)
> +{
> + hrtimer_init(timer, clock_id, mode);
> + timer->function = function;
> +}
> +#define hrtimer_setup rpi_hrtimer_setup
> +#endif
[Severity: Low]
Can we remove rpi_hrtimer_setup() and the LINUX_VERSION_CODE check from
drivers/perf/rpi_axi_pmu.c? As mentioned above, maintaining out-of-tree
compatibility macros adds unnecessary code complexity to the mainline kernel.
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.