From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7317C433EF for ; Mon, 6 Sep 2021 06:54:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7993C60F43 for ; Mon, 6 Sep 2021 06:54:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7993C60F43 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hbTic/Sz3Ntz+hQGDT+dc5AjambVWvvwgtg3miGdANc=; b=H/hCzflvLgCNnZ s0NMoGCTVgKXmbRerR9Kf92yY+bMFiEd1aMxakNEDNxCFpeILFDG5/uJEaRH8O7GrCnWlZudD6/zd bX4RHJlpEHwWkoIir0Pbl1E9Y0X9xXYL/G4Yls1PpAFSigZW35ZuBy2vNlkf/2CUT2T8wHhcK7nI9 u8oU+utiit0P4uELQ1HeEaxZD0ezxvMCGAkFe8xF7QLKgvkfSAFm39mTkxaRvZ66wFgbVsW56DuIF HK/7dThtbe+e3R3lzMo4wvdx3n0t2E1HQx+r91/O7YfFRVdAlorUMjDZaejPzDcUO55MDiCVwaWDP /hA5IdjDNkNWyXUbsu8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mN8U9-00HSlU-My; Mon, 06 Sep 2021 06:52:05 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mN8U5-00HSkc-4p for linux-arm-kernel@lists.infradead.org; Mon, 06 Sep 2021 06:52:02 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF49860F21; Mon, 6 Sep 2021 06:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630911120; bh=h0WT/Jjj8wKQYQF+5gwJkPL2TfNqu98BCj64BgayA7M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FulvDIvLkR5PGRPFP547Bt52CBBwmIth2844DXgVb6XXg68tZk8keaPt6YHDBf2uA 5zxS0C6YIL4AHINEw4PgNj30YY6cCH0PGM0slvrYtVxA7p1/hDdFwdcWSHl7R6AlmN t2NuD/XgYqZxt0/rLYaOz7EASBGRJLc3g3MPWDinA7qqn5phbB4HwwWoQTicUbyk4X aL1u4mXeT864zX6iAL5uRbCsZKtBWZrHL98MsHH0n6qom2SvF3NhzJ3srZB6W5tftW 9An3xv6TfdIuRzklCZErXZIgjFBMkgSNqvS809r+bYOh46D34M76TzNx+CT9FfIW6q ONhzS+UWH2qIQ== Date: Mon, 6 Sep 2021 08:51:53 +0200 From: Mauro Carvalho Chehab To: Randy Dunlap Cc: linux-kernel@vger.kernel.org, kernel test robot , linux-media@vger.kernel.org, Andrzej Pietrasiewicz , Jacek Anaszewski , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] media: s5p-jpeg: change "RST" to "RSET" to fix build warnings Message-ID: <20210906085153.58edc116@coco.lan> In-Reply-To: <20210905235715.12154-1-rdunlap@infradead.org> References: <20210905235715.12154-1-rdunlap@infradead.org> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210905_235201_262107_DBC26E06 X-CRM114-Status: GOOD ( 21.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Sun, 5 Sep 2021 16:57:15 -0700 Randy Dunlap 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 use of RST to the name RSET. > > 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) > > Fixes: bb677f3ac434 ("[media] Exynos4 JPEG codec v4l2 driver") > Reported-by: kernel test robot > Signed-off-by: Randy Dunlap > Cc: Mauro Carvalho Chehab > Cc: linux-media@vger.kernel.org > Cc: Andrzej Pietrasiewicz > Cc: Jacek Anaszewski > Cc: Sylwester Nawrocki > Cc: linux-arm-kernel@lists.infradead.org > --- > drivers/media/platform/s5p-jpeg/jpeg-core.c | 2 +- > drivers/media/platform/s5p-jpeg/jpeg-core.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > --- linux-next-20210903.orig/drivers/media/platform/s5p-jpeg/jpeg-core.c > +++ linux-next-20210903/drivers/media/platform/s5p-jpeg/jpeg-core.c > @@ -1203,7 +1203,7 @@ static bool s5p_jpeg_parse_hdr(struct s5 > break; > > /* skip payload-less markers */ > - case RST ... RST + 7: > + case RSET ... RSET + 7: > case SOI: > case EOI: > case TEM: > --- linux-next-20210903.orig/drivers/media/platform/s5p-jpeg/jpeg-core.h > +++ linux-next-20210903/drivers/media/platform/s5p-jpeg/jpeg-core.h > @@ -40,7 +40,7 @@ > #define TEM 0x01 > #define SOF0 0xc0 > #define DHT 0xc4 > -#define RST 0xd0 > +#define RSET 0xd0 > #define SOI 0xd8 > #define EOI 0xd9 > #define SOS 0xda I don't like this change, for a couple reasons: 1. the JPEG marker is "RST" (actually, "RST0") instead of "RSET" (see pag. 36 https://www.w3.org/Graphics/JPEG/itu-t81.pdf). The close it sticks with the JPEG standard, the better; 2. better to add a namespace here, as other JPEG markers like SOS, SOI and EOI seems to have a high chance of happening somewhere else on other kernel headers in the future. So, IMO, the best would be to rename all those markers as a hole, with something similar to: $ for i in TEM SOF0 DHT RST SOI EOI SOS DQT DHP; do sed "s,\b$i\b,JPEG_MARKER_$i,g" -i drivers/media/platform/s5p-jpeg/*.[ch]; done and manually adjust the patch, as at least this hunk could be improved: @@ -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 marker's position relative to the buffer beginning + * @dht: JPEG_MARKER_DHT markers' positions relative to the buffer beginning + * @dqt: JPEG_MARKER_DQT markers' positions relative to the buffer beginning + * @sof: JPEG_MARKER_SOF0 marker's position relative to the buffer beginning + * @sof_len: JPEG_MARKER_SOF0 marker's payload length (without length field itself) * @size: image buffer size in bytes */ to avoid repeating the word marker. Thanks, Mauro _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel