Skip to content

Commit

Permalink
media: v4l: use WARN_ON(1) instead of __WARN()
Browse files Browse the repository at this point in the history
__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: 97bbdf0 ("media: v4l: Add support for CSI-1 and CCP2 busses")

Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
arndb authored and mchehab committed Aug 8, 2017
1 parent fa31c11 commit f57cdbd
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/media/platform/pxa_camera.c
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion drivers/media/platform/soc_camera/soc_mediabus.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit f57cdbd

Please sign in to comment.