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

media: v4l: use WARN_ON(1) instead of __WARN()

__WARN() cannot be used in portable code, since it is only
available on some architectures and configurations:

drivers/media/platform/pxa_camera.c: In function 'pxa_mbus_config_compatible':
drivers/media/platform/pxa_camera.c:642:3: error: implicit declaration of function '__WARN'; did you mean '__WALL'? [-Werror=implicit-function-declaration]

The common way to express an unconditional warning is WARN_ON(1),
so let's use that here.

Fixes: 97bbdf02d905 ("media: v4l: Add support for CSI-1 and CCP2 busses")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Arnd Bergmann and committed by
Mauro Carvalho Chehab
f57cdbd3 fa31c117

+2 -2
+1 -1
drivers/media/platform/pxa_camera.c
··· 639 639 V4L2_MBUS_CSI2_CONTINUOUS_CLOCK); 640 640 return (!mipi_lanes || !mipi_clock) ? 0 : common_flags; 641 641 default: 642 - __WARN(); 642 + WARN_ON(1); 643 643 return -EINVAL; 644 644 } 645 645 return 0;
+1 -1
drivers/media/platform/soc_camera/soc_mediabus.c
··· 509 509 V4L2_MBUS_CSI2_CONTINUOUS_CLOCK); 510 510 return (!mipi_lanes || !mipi_clock) ? 0 : common_flags; 511 511 default: 512 - __WARN(); 512 + WARN_ON(1); 513 513 return -EINVAL; 514 514 } 515 515 return 0;