All of lore.kernel.org
 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>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Lukas Middendorf <kernel@tuxforce.de>,
	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 06/10] media: dvb-core: dvb_frontend: address some clang warnings
Date: Mon, 22 Nov 2021 09:26:08 +0000	[thread overview]
Message-ID: <fe70cb9f32c41265de21129d26f1122e2849b842.1637573097.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1637573097.git.mchehab+huawei@kernel.org>

The typecasts at the dvb-core generate clang warnings when W=1
is enabled.

The warns are harmless, but they cause the build to break with
CONFIG_WERROR, so do the cast on a way that it won't produce
warnings anymore.

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

To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH 00/10] at: https://lore.kernel.org/all/cover.1637573097.git.mchehab+huawei@kernel.org/

 drivers/media/dvb-core/dvb_frontend.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 8fc59f3cfb6c..48e735cdbe6b 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2554,8 +2554,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
 
 	case FE_DISEQC_SEND_BURST:
 		if (fe->ops.diseqc_send_burst) {
-			err = fe->ops.diseqc_send_burst(fe,
-						(enum fe_sec_mini_cmd)parg);
+			err = fe->ops.diseqc_send_burst(fe, (long)parg);
 			fepriv->state = FESTATE_DISEQC;
 			fepriv->status = 0;
 		}
@@ -2563,9 +2562,8 @@ static int dvb_frontend_handle_ioctl(struct file *file,
 
 	case FE_SET_TONE:
 		if (fe->ops.set_tone) {
-			err = fe->ops.set_tone(fe,
-					       (enum fe_sec_tone_mode)parg);
-			fepriv->tone = (enum fe_sec_tone_mode)parg;
+			fepriv->tone = (long)parg;
+			err = fe->ops.set_tone(fe, fepriv->tone);
 			fepriv->state = FESTATE_DISEQC;
 			fepriv->status = 0;
 		}
@@ -2573,9 +2571,8 @@ static int dvb_frontend_handle_ioctl(struct file *file,
 
 	case FE_SET_VOLTAGE:
 		if (fe->ops.set_voltage) {
-			err = fe->ops.set_voltage(fe,
-						  (enum fe_sec_voltage)parg);
-			fepriv->voltage = (enum fe_sec_voltage)parg;
+			fepriv->voltage = (long)parg;
+			err = fe->ops.set_voltage(fe, fepriv->voltage);
 			fepriv->state = FESTATE_DISEQC;
 			fepriv->status = 0;
 		}
-- 
2.33.1


WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Lukas Middendorf <kernel@tuxforce.de>,
	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 06/10] media: dvb-core: dvb_frontend: address some clang warnings
Date: Mon, 22 Nov 2021 09:26:08 +0000	[thread overview]
Message-ID: <fe70cb9f32c41265de21129d26f1122e2849b842.1637573097.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1637573097.git.mchehab+huawei@kernel.org>

The typecasts at the dvb-core generate clang warnings when W=1
is enabled.

The warns are harmless, but they cause the build to break with
CONFIG_WERROR, so do the cast on a way that it won't produce
warnings anymore.

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

To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH 00/10] at: https://lore.kernel.org/all/cover.1637573097.git.mchehab+huawei@kernel.org/

 drivers/media/dvb-core/dvb_frontend.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 8fc59f3cfb6c..48e735cdbe6b 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2554,8 +2554,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
 
 	case FE_DISEQC_SEND_BURST:
 		if (fe->ops.diseqc_send_burst) {
-			err = fe->ops.diseqc_send_burst(fe,
-						(enum fe_sec_mini_cmd)parg);
+			err = fe->ops.diseqc_send_burst(fe, (long)parg);
 			fepriv->state = FESTATE_DISEQC;
 			fepriv->status = 0;
 		}
@@ -2563,9 +2562,8 @@ static int dvb_frontend_handle_ioctl(struct file *file,
 
 	case FE_SET_TONE:
 		if (fe->ops.set_tone) {
-			err = fe->ops.set_tone(fe,
-					       (enum fe_sec_tone_mode)parg);
-			fepriv->tone = (enum fe_sec_tone_mode)parg;
+			fepriv->tone = (long)parg;
+			err = fe->ops.set_tone(fe, fepriv->tone);
 			fepriv->state = FESTATE_DISEQC;
 			fepriv->status = 0;
 		}
@@ -2573,9 +2571,8 @@ static int dvb_frontend_handle_ioctl(struct file *file,
 
 	case FE_SET_VOLTAGE:
 		if (fe->ops.set_voltage) {
-			err = fe->ops.set_voltage(fe,
-						  (enum fe_sec_voltage)parg);
-			fepriv->voltage = (enum fe_sec_voltage)parg;
+			fepriv->voltage = (long)parg;
+			err = fe->ops.set_voltage(fe, fepriv->voltage);
 			fepriv->state = FESTATE_DISEQC;
 			fepriv->status = 0;
 		}
-- 
2.33.1


  parent reply	other threads:[~2021-11-22  9:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22  9:26 [PATCH 00/10] Address some clang W=1 warnings Mauro Carvalho Chehab
2021-11-22  9:26 ` Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 01/10] media: cx25821: drop duplicated i2c_slave_did_ack() Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 02/10] media: ivtv: drop an unused macro Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 03/10] media: cx18: " Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 04/10] media: stb6100: mark a currently unused function as such Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 05/10] media: mc: mark a debug function with __maybe_unused Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22  9:57   ` Laurent Pinchart
2021-11-22  9:26 ` Mauro Carvalho Chehab [this message]
2021-11-22  9:26   ` [PATCH 06/10] media: dvb-core: dvb_frontend: address some clang warnings Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 07/10] media: cx25840: drop some unused inline functions Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 08/10] media: marvell-ccic: drop to_cam() unused function Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 09/10] media: omap3isp: mark isp_isr_dbg as __maybe_unused Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22  9:58   ` Laurent Pinchart
2021-11-29  7:58     ` [PATCH v2 09/10] media: mc: drop an unused debug function Mauro Carvalho Chehab
2021-11-22  9:26 ` [PATCH 10/10] media: omap3isp: avoid warnings at IS_OUT_OF_BOUNDS() Mauro Carvalho Chehab
2021-11-22  9:26   ` Mauro Carvalho Chehab
2021-11-22 10:04   ` Laurent Pinchart

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=fe70cb9f32c41265de21129d26f1122e2849b842.1637573097.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=gustavoars@kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@tuxforce.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.