mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tong Zhang <ztong0001@gmail.com>
To: Benoit Parrot <bparrot@ti.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: ztong0001@gmail.com
Subject: [PATCH v1] media: ti-vpe: cal: fix ce
Date: Tue,  9 Feb 2021 23:08:02 -0500	[thread overview]
Message-ID: <20210210040802.1069235-1-ztong0001@gmail.com> (raw)

FIELD_GET require mask field to be constant, however it is wrapped by a
function which will cause error

././include/linux/compiler_types.h:320:38: error: call to ‘__compiletime_assert_270’ declared with attribute error: FIELD_GET: mask is
not constant
  320 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)

redefine cal_read_field as a macro

Signed-off-by: Tong Zhang <ztong0001@gmail.com>
---
 drivers/media/platform/ti-vpe/cal.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/media/platform/ti-vpe/cal.h b/drivers/media/platform/ti-vpe/cal.h
index 4123405ee0cf..d73a4a3b99cb 100644
--- a/drivers/media/platform/ti-vpe/cal.h
+++ b/drivers/media/platform/ti-vpe/cal.h
@@ -215,10 +215,7 @@ static inline void cal_write(struct cal_dev *cal, u32 offset, u32 val)
 	iowrite32(val, cal->base + offset);
 }
 
-static inline u32 cal_read_field(struct cal_dev *cal, u32 offset, u32 mask)
-{
-	return FIELD_GET(mask, cal_read(cal, offset));
-}
+#define cal_read_field(cal, offset, mask) FIELD_GET(mask, cal_read(cal, offset))
 
 static inline void cal_write_field(struct cal_dev *cal, u32 offset, u32 value,
 				   u32 mask)
-- 
2.25.1


                 reply	other threads:[~2021-02-10  4:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210210040802.1069235-1-ztong0001@gmail.com \
    --to=ztong0001@gmail.com \
    --cc=bparrot@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®