All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drxk: Use BUG() for invalid numberOfParameters in QAMDemodulatorCommand()
@ 2012-11-05 13:20 Ben Hutchings
  0 siblings, 0 replies; only message in thread
From: Ben Hutchings @ 2012-11-05 13:20 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media

If numberOfParameters is not 2 or 4, we log a warning and then
continue.  Depending on compiler version and options, this may be
recognised as an impossible case or may otherwise provoke the warning
that 'status' is uninitialised.  Using the more forceful BUG() avoids
this warning, and makes it harder to ignore incorrect usage.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/media/dvb-frontends/drxk_hard.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c
index 8b4c6d5..6da00ac 100644
--- a/drivers/media/dvb-frontends/drxk_hard.c
+++ b/drivers/media/dvb-frontends/drxk_hard.c
@@ -5459,8 +5459,7 @@ static int QAMDemodulatorCommand(struct drxk_state *state,
 				     numberOfParameters, setParamParameters,
 				     1, &cmdResult);
 	} else {
-		printk(KERN_WARNING "drxk: Unknown QAM demodulator parameter "
-			"count %d\n", numberOfParameters);
+		BUG();
 	}
 
 error:



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-05 13:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05 13:20 [PATCH] drxk: Use BUG() for invalid numberOfParameters in QAMDemodulatorCommand() Ben Hutchings

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.