linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] media: s5p-jpeg: rename JPEG marker constants to prevent build warnings
@ 2021-09-07  4:40 Randy Dunlap
  2021-09-07  6:11 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2021-09-07  4:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, Mauro Carvalho Chehab,
	linux-media, Andrzej Pietrasiewicz, Jacek Anaszewski,
	Sylwester Nawrocki, linux-arm-kernel

The use of a macro named 'RST' conflicts with one of the same name
in arch/mips/include/asm/mach-rc32434/rb.h. This causes build
warnings on some MIPS builds.

Change the names of the JPEG marker constants to be in their own
namespace to fix these build warnings and to prevent other similar
problems in the future.

Fixes these build warnings:

In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c:14:
../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
   43 | #define RST                             0xd0
      | 
../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
   13 | #define RST             (1 << 15)

In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c:13:
../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
   43 | #define RST                             0xd0
../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
   13 | #define RST             (1 << 15)

In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c:12:
../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
   43 | #define RST                             0xd0
../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
   13 | #define RST             (1 << 15)

In file included from ../drivers/media/platform/s5p-jpeg/jpeg-core.c:31:
../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
   43 | #define RST                             0xd0
../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
   13 | #define RST             (1 << 15)

Also update the kernel-doc so that the word "marker" is not
repeated.

Fixes: bb677f3ac434 ("[media] Exynos4 JPEG codec v4l2 driver")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org
Cc: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
---
v2: change all JPEG marker macros to be in their own namespace (as
    suggested by Mauro)

 drivers/media/platform/s5p-jpeg/jpeg-core.c |   18 +++++------
 drivers/media/platform/s5p-jpeg/jpeg-core.h |   28 +++++++++---------
 2 files changed, 23 insertions(+), 23 deletions(-)

--- linux-next-20210906.orig/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ linux-next-20210906/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1140,8 +1140,8 @@ static bool s5p_jpeg_parse_hdr(struct s5
 			continue;
 		length = 0;
 		switch (c) {
-		/* SOF0: baseline JPEG */
-		case SOF0:
+		/* JPEG_MARKER_SOF0: baseline JPEG */
+		case JPEG_MARKER_SOF0:
 			if (get_word_be(&jpeg_buffer, &word))
 				break;
 			length = (long)word - 2;
@@ -1172,7 +1172,7 @@ static bool s5p_jpeg_parse_hdr(struct s5
 			notfound = 0;
 			break;
 
-		case DQT:
+		case JPEG_MARKER_DQT:
 			if (get_word_be(&jpeg_buffer, &word))
 				break;
 			length = (long)word - 2;
@@ -1185,7 +1185,7 @@ static bool s5p_jpeg_parse_hdr(struct s5
 			skip(&jpeg_buffer, length);
 			break;
 
-		case DHT:
+		case JPEG_MARKER_DHT:
 			if (get_word_be(&jpeg_buffer, &word))
 				break;
 			length = (long)word - 2;
@@ -1198,15 +1198,15 @@ static bool s5p_jpeg_parse_hdr(struct s5
 			skip(&jpeg_buffer, length);
 			break;
 
-		case SOS:
+		case JPEG_MARKER_SOS:
 			sos = jpeg_buffer.curr - 2; /* 0xffda */
 			break;
 
 		/* skip payload-less markers */
-		case RST ... RST + 7:
-		case SOI:
-		case EOI:
-		case TEM:
+		case JPEG_MARKER_RST ... JPEG_MARKER_RST + 7:
+		case JPEG_MARKER_SOI:
+		case JPEG_MARKER_EOI:
+		case JPEG_MARKER_TEM:
 			break;
 
 		/* skip uninteresting payload markers */
--- linux-next-20210906.orig/drivers/media/platform/s5p-jpeg/jpeg-core.h
+++ linux-next-20210906/drivers/media/platform/s5p-jpeg/jpeg-core.h
@@ -37,15 +37,15 @@
 #define EXYNOS3250_IRQ_TIMEOUT		0x10000000
 
 /* a selection of JPEG markers */
-#define TEM				0x01
-#define SOF0				0xc0
-#define DHT				0xc4
-#define RST				0xd0
-#define SOI				0xd8
-#define EOI				0xd9
-#define	SOS				0xda
-#define DQT				0xdb
-#define DHP				0xde
+#define JPEG_MARKER_TEM				0x01
+#define JPEG_MARKER_SOF0				0xc0
+#define JPEG_MARKER_DHT				0xc4
+#define JPEG_MARKER_RST				0xd0
+#define JPEG_MARKER_SOI				0xd8
+#define JPEG_MARKER_EOI				0xd9
+#define	JPEG_MARKER_SOS				0xda
+#define JPEG_MARKER_DQT				0xdb
+#define JPEG_MARKER_DHP				0xde
 
 /* Flags that indicate a format can be used for capture/output */
 #define SJPEG_FMT_FLAG_ENC_CAPTURE	(1 << 0)
@@ -187,11 +187,11 @@ struct s5p_jpeg_marker {
  * @fmt:	driver-specific format of this queue
  * @w:		image width
  * @h:		image height
- * @sos:	SOS marker's position relative to the buffer beginning
- * @dht:	DHT markers' positions relative to the buffer beginning
- * @dqt:	DQT markers' positions relative to the buffer beginning
- * @sof:	SOF0 marker's position relative to the buffer beginning
- * @sof_len:	SOF0 marker's payload length (without length field itself)
+ * @sos:	JPEG_MARKER_SOS's position relative to the buffer beginning
+ * @dht:	JPEG_MARKER_DHT' positions relative to the buffer beginning
+ * @dqt:	JPEG_MARKER_DQT' positions relative to the buffer beginning
+ * @sof:	JPEG_MARKER_SOF0's position relative to the buffer beginning
+ * @sof_len:	JPEG_MARKER_SOF0's payload length (without length field itself)
  * @size:	image buffer size in bytes
  */
 struct s5p_jpeg_q_data {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: s5p-jpeg: rename JPEG marker constants to prevent build warnings
  2021-09-07  4:40 [PATCH v2] media: s5p-jpeg: rename JPEG marker constants to prevent build warnings Randy Dunlap
@ 2021-09-07  6:11 ` Mauro Carvalho Chehab
  2021-09-07  7:27   ` Andrzej Pietrasiewicz
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-09-07  6:11 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, kernel test robot, linux-media,
	Andrzej Pietrasiewicz, Jacek Anaszewski, Sylwester Nawrocki,
	linux-arm-kernel

Em Mon,  6 Sep 2021 21:40:22 -0700
Randy Dunlap <rdunlap@infradead.org> escreveu:

> The use of a macro named 'RST' conflicts with one of the same name
> in arch/mips/include/asm/mach-rc32434/rb.h. This causes build
> warnings on some MIPS builds.
> 
> Change the names of the JPEG marker constants to be in their own
> namespace to fix these build warnings and to prevent other similar
> problems in the future.
> 
> Fixes these build warnings:
> 
> In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c:14:
> ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
>    43 | #define RST                             0xd0
>       | 
> ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
>    13 | #define RST             (1 << 15)
> 
> In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c:13:
> ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
>    43 | #define RST                             0xd0
> ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
>    13 | #define RST             (1 << 15)
> 
> In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c:12:
> ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
>    43 | #define RST                             0xd0
> ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
>    13 | #define RST             (1 << 15)
> 
> In file included from ../drivers/media/platform/s5p-jpeg/jpeg-core.c:31:
> ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
>    43 | #define RST                             0xd0
> ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
>    13 | #define RST             (1 << 15)
> 
> Also update the kernel-doc so that the word "marker" is not
> repeated.
> 
> Fixes: bb677f3ac434 ("[media] Exynos4 JPEG codec v4l2 driver")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: linux-media@vger.kernel.org
> Cc: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> v2: change all JPEG marker macros to be in their own namespace (as
>     suggested by Mauro)

Applied, thanks!

Regards,
Mauro

Thanks,
Mauro

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: s5p-jpeg: rename JPEG marker constants to prevent build warnings
  2021-09-07  6:11 ` Mauro Carvalho Chehab
@ 2021-09-07  7:27   ` Andrzej Pietrasiewicz
  0 siblings, 0 replies; 3+ messages in thread
From: Andrzej Pietrasiewicz @ 2021-09-07  7:27 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Randy Dunlap
  Cc: linux-kernel, kernel test robot, linux-media, Jacek Anaszewski,
	Sylwester Nawrocki, linux-arm-kernel

Hi Mauro,

W dniu 07.09.2021 o 08:11, Mauro Carvalho Chehab pisze:
> Em Mon,  6 Sep 2021 21:40:22 -0700
> Randy Dunlap <rdunlap@infradead.org> escreveu:
> 
>> The use of a macro named 'RST' conflicts with one of the same name
>> in arch/mips/include/asm/mach-rc32434/rb.h. This causes build
>> warnings on some MIPS builds.
>>
>> Change the names of the JPEG marker constants to be in their own
>> namespace to fix these build warnings and to prevent other similar
>> problems in the future.
>>
>> Fixes these build warnings:
>>
>> In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c:14:
>> ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
>>     43 | #define RST                             0xd0
>>        |
>> ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
>>     13 | #define RST             (1 << 15)
>>
>> In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c:13:
>> ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
>>     43 | #define RST                             0xd0
>> ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
>>     13 | #define RST             (1 << 15)
>>
>> In file included from ../drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c:12:
>> ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
>>     43 | #define RST                             0xd0
>> ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
>>     13 | #define RST             (1 << 15)
>>
>> In file included from ../drivers/media/platform/s5p-jpeg/jpeg-core.c:31:
>> ../drivers/media/platform/s5p-jpeg/jpeg-core.h:43: warning: "RST" redefined
>>     43 | #define RST                             0xd0
>> ../arch/mips/include/asm/mach-rc32434/rb.h:13: note: this is the location of the previous definition
>>     13 | #define RST             (1 << 15)
>>
>> Also update the kernel-doc so that the word "marker" is not
>> repeated.
>>
>> Fixes: bb677f3ac434 ("[media] Exynos4 JPEG codec v4l2 driver")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
>> Cc: linux-media@vger.kernel.org
>> Cc: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
>> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
>> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> Cc: linux-arm-kernel@lists.infradead.org
>> ---
>> v2: change all JPEG marker macros to be in their own namespace (as
>>      suggested by Mauro)
> 
> Applied, thanks!

You can add

Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>

> 
> Regards,
> Mauro
> 
> Thanks,
> Mauro
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-07  7:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  4:40 [PATCH v2] media: s5p-jpeg: rename JPEG marker constants to prevent build warnings Randy Dunlap
2021-09-07  6:11 ` Mauro Carvalho Chehab
2021-09-07  7:27   ` Andrzej Pietrasiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).