All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Kaiser <nikai@nikai.net>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jarod Wilson <jarod@redhat.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/media: nuvoton: always true expression
Date: Tue, 16 Nov 2010 21:19:53 +0100	[thread overview]
Message-ID: <20101116211953.238012db@absol.kitzblitz> (raw)

I noticed that the second part of this conditional is always true.
Would the intention be to strictly check on both chip_major and
chip_minor?

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
 drivers/media/IR/nuvoton-cir.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c
index 301be53..896463b 100644
--- a/drivers/media/IR/nuvoton-cir.c
+++ b/drivers/media/IR/nuvoton-cir.c
@@ -249,8 +249,8 @@ static int nvt_hw_detect(struct nvt_dev *nvt)
 	chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO);
 	nvt_dbg("%s: chip id: 0x%02x 0x%02x", chip_id, chip_major, chip_minor);
 
-	if (chip_major != CHIP_ID_HIGH &&
-	    (chip_minor != CHIP_ID_LOW || chip_minor != CHIP_ID_LOW2))
+	if (chip_major != CHIP_ID_HIGH ||
+	    (chip_minor != CHIP_ID_LOW && chip_minor != CHIP_ID_LOW2))
 		ret = -ENODEV;
 
 	nvt_efm_disable(nvt);
-- 
1.7.2.2

             reply	other threads:[~2010-11-16 20:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 20:19 Nicolas Kaiser [this message]
2010-11-16 21:54 ` [PATCH] drivers/media: nuvoton: always true expression Jarod Wilson
2010-11-17  1:51   ` Mauro Carvalho Chehab
2010-11-17 10:35     ` [PATCH] drivers/media: nuvoton: fix chip id probe Nicolas Kaiser
2010-11-19 19:16       ` Jarod Wilson
2010-11-19 20:42         ` [PATCH] drivers/media: nuvoton: fix chip id probe v2 Nicolas Kaiser
2010-11-19 21:39           ` Jarod Wilson

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=20101116211953.238012db@absol.kitzblitz \
    --to=nikai@nikai.net \
    --cc=jarod@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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 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.