Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1695870 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2017-07-25 17:50 +0200 |
| Last post | 2017-07-26 13:30 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] media: v4l: use WARN_ON(1) instead of __WARN() Arnd Bergmann <arnd@arndb.de> - 2017-07-25 17:50 +0200
Re: [PATCH] media: v4l: use WARN_ON(1) instead of __WARN() Sakari Ailus <sakari.ailus@iki.fi> - 2017-07-26 01:00 +0200
Re: [PATCH] media: v4l: use WARN_ON(1) instead of __WARN() Pavel Machek <pavel@ucw.cz> - 2017-07-26 13:30 +0200
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2017-07-25 17:50 +0200 |
| Subject | [PATCH] media: v4l: use WARN_ON(1) instead of __WARN() |
| Message-ID | <u7afU-4DI-19@gated-at.bofh.it> |
__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>
---
drivers/media/platform/pxa_camera.c | 2 +-
drivers/media/platform/soc_camera/soc_mediabus.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
index 3898a5cd8664..0d4af6d91ffc 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -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;
diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c
index 43192d80beef..0ad4b28266e4 100644
--- a/drivers/media/platform/soc_camera/soc_mediabus.c
+++ b/drivers/media/platform/soc_camera/soc_mediabus.c
@@ -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;
--
2.9.0
[toc] | [next] | [standalone]
| From | Sakari Ailus <sakari.ailus@iki.fi> |
|---|---|
| Date | 2017-07-26 01:00 +0200 |
| Message-ID | <u7gY1-xa-5@gated-at.bofh.it> |
| In reply to | #1695870 |
On Tue, Jul 25, 2017 at 05:39:14PM +0200, Arnd Bergmann wrote:
> __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>
> ---
> drivers/media/platform/pxa_camera.c | 2 +-
> drivers/media/platform/soc_camera/soc_mediabus.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
> index 3898a5cd8664..0d4af6d91ffc 100644
> --- a/drivers/media/platform/pxa_camera.c
> +++ b/drivers/media/platform/pxa_camera.c
> @@ -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;
> diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c
> index 43192d80beef..0ad4b28266e4 100644
> --- a/drivers/media/platform/soc_camera/soc_mediabus.c
> +++ b/drivers/media/platform/soc_camera/soc_mediabus.c
> @@ -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;
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
[toc] | [prev] | [next] | [standalone]
| From | Pavel Machek <pavel@ucw.cz> |
|---|---|
| Date | 2017-07-26 13:30 +0200 |
| Message-ID | <u7sFP-86J-3@gated-at.bofh.it> |
| In reply to | #1695870 |
[Multipart message — attachments visible in raw view] — view raw
On Tue 2017-07-25 17:39:14, Arnd Bergmann wrote:
> __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: Pavel Machek <pavel@ucw.cz>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web