Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

atomisp: avoid warning about unused function

The atomisp_mrfld_power() function isn't actually ever called, because
the two call-sites have commented out the use because it breaks on some
platforms. That results in:

drivers/staging/media/atomisp/pci/atomisp_v4l2.c:764:12: warning: ‘atomisp_mrfld_power’ defined but not used [-Wunused-function]
764 | static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable)
| ^~~~~~~~~~~~~~~~~~~

during the build.

Rather than commenting out the use entirely, just disable it
semantically instead (using a "0 &&" construct), leaving the call in
place from a syntax standpoint, and avoiding the warning.

I really don't want my builds to have any warnings that can then hide
real issues.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+4 -6
+4 -6
drivers/staging/media/atomisp/pci/atomisp_v4l2.c
··· 824 824 /* Workaround for pmu_nc_set_power_state not ready in MRFLD */ 825 825 int atomisp_mrfld_power_down(struct atomisp_device *isp) 826 826 { 827 - return 0; 828 - // FIXME: at least with ISP2401, the code below causes the driver to break 829 - // return atomisp_mrfld_power(isp, false); 827 + // FIXME: at least with ISP2401, enabling this code causes the driver to break 828 + return 0 && atomisp_mrfld_power(isp, false); 830 829 } 831 830 832 831 /* Workaround for pmu_nc_set_power_state not ready in MRFLD */ 833 832 int atomisp_mrfld_power_up(struct atomisp_device *isp) 834 833 { 835 - return 0; 836 - // FIXME: at least with ISP2401, the code below causes the driver to break 837 - // return atomisp_mrfld_power(isp, true); 834 + // FIXME: at least with ISP2401, enabling this code causes the driver to break 835 + return 0 && atomisp_mrfld_power(isp, true); 838 836 } 839 837 840 838 int atomisp_runtime_suspend(struct device *dev)