Linux kernel: Build failures when using `-Werror=unused-variable` and `-Werror=missing-prototypes`
When building 6.10 with either of these options, -Werror=unused-variable and -Werror=missing-prototypes, the build does not succeed.
I noticed that when working on the ebuild (Gentoo) for 6.10. To be honest, I have no idea why this doesn't show up for the older kernels.
The fixes are really simple. I have tried to manually update the patch files, but that went about as well as you'd think. Now the patches can't apply. Never the less, I still think you'll get the idea when looking at them:
Basically, -Werror=unused-variable complained about the variables ret and dsi not being used. So I removed their declarations. -Werror=missing-prototypes complained about the prototype for the function void imx8mq_pcie_qos_for_lcdif(void) missing, so I added it to the header file.
With these changes applied, I can now build the kernel just fine.
Unfortunately, I was unable to figure out how to re-create the patches from scratch which is why I haven't made a proper merge request. Maybe you can do it quite easy? Or let me know how I can do it myself.
For now, I am using additional patches, on top of yours, in my ebuild:
- https://source.mnt.re/vimja/mnt-reform-overlay/-/blob/master/sys-kernel/mnt-reform2-kernel/files/0001-panel-jdi-lt070me05000-pocket-reform.patch?ref_type=heads
- https://source.mnt.re/vimja/mnt-reform-overlay/-/blob/master/sys-kernel/mnt-reform2-kernel/files/0003-lcdif-fix-pcie-interference.patch?ref_type=heads