media: v4l: use WARN_ON(1) instead of __WARN()
authorArnd Bergmann <arnd@arndb.de>
Tue, 25 Jul 2017 15:39:14 +0000 (11:39 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 8 Aug 2017 10:34:36 +0000 (06:34 -0400)
__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>
drivers/media/platform/pxa_camera.c
drivers/media/platform/soc_camera/soc_mediabus.c

index 3898a5cd866427c884a931876fc7a6ecb5758d55..0d4af6d91ffc9996af7b64e9255a5c409f6a2772 100644 (file)
@@ -639,7 +639,7 @@ static unsigned int pxa_mbus_config_compatible(const struct v4l2_mbus_config *cf
                                             V4L2_MBUS_CSI2_CONTINUOUS_CLOCK);
                return (!mipi_lanes || !mipi_clock) ? 0 : common_flags;
        default:
-               __WARN();
+               WARN_ON(1);
                return -EINVAL;
        }
        return 0;
index 43192d80beef66653c5af05e4af2f91f8b91184f..0ad4b28266e4379f1a9a5932e809d100c84cede9 100644 (file)
@@ -509,7 +509,7 @@ unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
                                             V4L2_MBUS_CSI2_CONTINUOUS_CLOCK);
                return (!mipi_lanes || !mipi_clock) ? 0 : common_flags;
        default:
-               __WARN();
+               WARN_ON(1);
                return -EINVAL;
        }
        return 0;