linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	llvm@lists.linux.dev
Subject: [PATCH v2 13/20] media: adv7604: mark unused functions as such
Date: Mon, 29 Nov 2021 10:47:45 +0100	[thread overview]
Message-ID: <91b6e8c97de3608785a035eaef6d970aea7926ac.1638179135.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1638179135.git.mchehab+huawei@kernel.org>

There are several unused helper macros there, meant to parse some
fields. As those actually help to document the hardware, the
better is to keep them.

However, it generates clang warnings with W=1, causing build to
break with CONFIG_WERROR.

So, add __always_unused to fix such warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---

See [PATCH v2 00/20] at: https://lore.kernel.org/all/cover.1638179135.git.mchehab+huawei@kernel.org/

 drivers/media/i2c/adv7604.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 44768b59a6ff..a2fa408d2d9f 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -398,14 +398,14 @@ static inline int io_write_clr_set(struct v4l2_subdev *sd, u8 reg, u8 mask,
 	return io_write(sd, reg, (io_read(sd, reg) & ~mask) | val);
 }
 
-static inline int avlink_read(struct v4l2_subdev *sd, u8 reg)
+static inline int __always_unused avlink_read(struct v4l2_subdev *sd, u8 reg)
 {
 	struct adv76xx_state *state = to_state(sd);
 
 	return adv76xx_read_check(state, ADV7604_PAGE_AVLINK, reg);
 }
 
-static inline int avlink_write(struct v4l2_subdev *sd, u8 reg, u8 val)
+static inline int __always_unused avlink_write(struct v4l2_subdev *sd, u8 reg, u8 val)
 {
 	struct adv76xx_state *state = to_state(sd);
 
@@ -439,14 +439,14 @@ static inline int infoframe_read(struct v4l2_subdev *sd, u8 reg)
 	return adv76xx_read_check(state, ADV76XX_PAGE_INFOFRAME, reg);
 }
 
-static inline int infoframe_write(struct v4l2_subdev *sd, u8 reg, u8 val)
+static inline int __always_unused infoframe_write(struct v4l2_subdev *sd, u8 reg, u8 val)
 {
 	struct adv76xx_state *state = to_state(sd);
 
 	return regmap_write(state->regmap[ADV76XX_PAGE_INFOFRAME], reg, val);
 }
 
-static inline int afe_read(struct v4l2_subdev *sd, u8 reg)
+static inline int __always_unused afe_read(struct v4l2_subdev *sd, u8 reg)
 {
 	struct adv76xx_state *state = to_state(sd);
 
@@ -479,14 +479,14 @@ static inline int rep_write_clr_set(struct v4l2_subdev *sd, u8 reg, u8 mask, u8
 	return rep_write(sd, reg, (rep_read(sd, reg) & ~mask) | val);
 }
 
-static inline int edid_read(struct v4l2_subdev *sd, u8 reg)
+static inline int __always_unused edid_read(struct v4l2_subdev *sd, u8 reg)
 {
 	struct adv76xx_state *state = to_state(sd);
 
 	return adv76xx_read_check(state, ADV76XX_PAGE_EDID, reg);
 }
 
-static inline int edid_write(struct v4l2_subdev *sd, u8 reg, u8 val)
+static inline int __always_unused edid_write(struct v4l2_subdev *sd, u8 reg, u8 val)
 {
 	struct adv76xx_state *state = to_state(sd);
 
@@ -570,7 +570,7 @@ static inline int hdmi_write_clr_set(struct v4l2_subdev *sd, u8 reg, u8 mask, u8
 	return hdmi_write(sd, reg, (hdmi_read(sd, reg) & ~mask) | val);
 }
 
-static inline int test_write(struct v4l2_subdev *sd, u8 reg, u8 val)
+static inline int __always_unused test_write(struct v4l2_subdev *sd, u8 reg, u8 val)
 {
 	struct adv76xx_state *state = to_state(sd);
 
@@ -601,14 +601,14 @@ static inline int cp_write_clr_set(struct v4l2_subdev *sd, u8 reg, u8 mask, u8 v
 	return cp_write(sd, reg, (cp_read(sd, reg) & ~mask) | val);
 }
 
-static inline int vdp_read(struct v4l2_subdev *sd, u8 reg)
+static inline int __always_unused vdp_read(struct v4l2_subdev *sd, u8 reg)
 {
 	struct adv76xx_state *state = to_state(sd);
 
 	return adv76xx_read_check(state, ADV7604_PAGE_VDP, reg);
 }
 
-static inline int vdp_write(struct v4l2_subdev *sd, u8 reg, u8 val)
+static inline int __always_unused vdp_write(struct v4l2_subdev *sd, u8 reg, u8 val)
 {
 	struct adv76xx_state *state = to_state(sd);
 
-- 
2.33.1


  parent reply	other threads:[~2021-11-29  9:50 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29  9:47 [PATCH v2 00/20] Solve the remaining issues with clang and W=1 on media Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 01/20] media: adv7842: get rid of two unused functions Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 02/20] media: saa7134-go7007: get rid of to_state() function Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 03/20] media: davinci: get rid of an unused function Mauro Carvalho Chehab
2021-11-29 10:18   ` Lad, Prabhakar
2021-11-29  9:47 ` [PATCH v2 04/20] media: drxd: drop offset var from DownloadMicrocode() Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 05/20] media: drxk: drop operation_mode from set_dvbt() Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 06/20] media: m88ds3103: drop reg11 calculus from m88ds3103b_select_mclk() Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 07/20] media: si21xx: report eventual errors at set_frontend Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 08/20] media: solo6x10: mark unused functions as such Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 09/20] media: si470x: fix printk warnings with clang Mauro Carvalho Chehab
2021-11-29 10:10   ` Joe Perches
2021-11-29 11:40     ` Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 10/20] media: radio-si476x: drop a container_of() abstraction macro Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 11/20] media: lmedm04: don't ignore errors when setting a filter Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 12/20] media: au0828-i2c: drop a duplicated function Mauro Carvalho Chehab
2021-11-29  9:47 ` Mauro Carvalho Chehab [this message]
2021-11-29  9:47 ` [PATCH v2 14/20] media: adv7511: drop unused functions Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 15/20] media: imx290: mark read reg function as __always_unused Mauro Carvalho Chehab
2021-12-02 14:59   ` Manivannan Sadhasivam
2021-11-29  9:47 ` [PATCH v2 16/20] media: davinci: vpbe_osd: " Mauro Carvalho Chehab
2021-11-29 10:19   ` Lad, Prabhakar
2021-11-29  9:47 ` [PATCH v2 17/20] media: camss: Remove unused static function Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 18/20] media: mtk-mdp: address a clang warning Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 19/20] media: cobalt: drop an unused variable Mauro Carvalho Chehab
2021-11-29  9:47 ` [PATCH v2 20/20] media: mxl5005s: drop some dead code Mauro Carvalho Chehab

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=91b6e8c97de3608785a035eaef6d970aea7926ac.1638179135.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=llvm@lists.linux.dev \
    --cc=mauro.chehab@huawei.com \
    --cc=mchehab@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).