2015-07-12 15:01:02

by Larry Finger

[permalink] [raw]
Subject: [PATCH] bug: Fix build error in V4.2-RC1

If CONFIG_BUG is not defined, then macro __WARN is not defined. This shows
as the following build error:

CC [M] drivers/media/v4l2-core/videobuf2-core.o
drivers/media/v4l2-core/videobuf2-core.c: In function ‘vb2_warn_zero_bytesused’:
drivers/media/v4l2-core/videobuf2-core.c:1253:2: error: implicit declaration of function ‘__WARN’ [-Werror=implicit-function-declaration]
__WARN();
^
This problem has been bisected to commit 77a3c6fd90c94f635edb00d4a65f485687538791.

Signed-off-by: Larry Finger <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
include/asm-generic/bug.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 630dd23..c1cb4b3 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -137,6 +137,7 @@ extern void warn_slowpath_null(const char *file, const int line);
})

#else /* !CONFIG_BUG */
+#define __WARN() do {} while (1)
#ifndef HAVE_ARCH_BUG
#define BUG() do {} while (1)
#endif
--
2.1.4


2015-07-12 15:52:12

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] bug: Fix build error in V4.2-RC1

On Sun, 2015-07-12 at 10:00 -0500, Larry Finger wrote:
> If CONFIG_BUG is not defined, then macro __WARN is not defined.
[]
> diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
[]
> @@ -137,6 +137,7 @@ extern void warn_slowpath_null(const char *file, const int line);

> +#define __WARN() do {} while (1)

Do you really think WARN should loop forever?

2015-07-12 15:56:57

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] bug: Fix build error in V4.2-RC1

On 07/12/2015 10:52 AM, Joe Perches wrote:
> On Sun, 2015-07-12 at 10:00 -0500, Larry Finger wrote:
>> If CONFIG_BUG is not defined, then macro __WARN is not defined.
> []
>> diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
> []
>> @@ -137,6 +137,7 @@ extern void warn_slowpath_null(const char *file, const int line);
>
>> +#define __WARN() do {} while (1)
>
> Do you really think WARN should loop forever?

Obviously not. I copied the code in that section for BUG() without thinking.

On to V2 after I get some more feedback.

Thanks,

Larry