lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101119191644.GF5022@redhat.com>
Date:	Fri, 19 Nov 2010 14:16:44 -0500
From:	Jarod Wilson <jarod@...hat.com>
To:	Nicolas Kaiser <nikai@...ai.net>
Cc:	Mauro Carvalho Chehab <mchehab@...radead.org>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/media: nuvoton: fix chip id probe

On Wed, Nov 17, 2010 at 11:35:25AM +0100, Nicolas Kaiser wrote:
> Make sure we have a matching chip id high and one or the other
> of the chip id low values.
> Print the values if the probe fails.
> 
> Signed-off-by: Nicolas Kaiser <nikai@...ai.net>
> ---
> Like this?
> Supersedes patch "drivers/media: nuvoton: always true expression".
> 
>  drivers/media/IR/nuvoton-cir.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c
> index 301be53..92d32c8 100644
> --- a/drivers/media/IR/nuvoton-cir.c
> +++ b/drivers/media/IR/nuvoton-cir.c
> @@ -249,9 +249,12 @@ 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)) {
> +		nvt_pr(KERN_ERR, "%s: chip id mismatch: 0x%02x 0x%02x",

I'd probably go with "unsupported chip, id: " instead, since it makes the
message a bit clearer, but generally speaking, yeah, something along
those lines should be fine.

-- 
Jarod Wilson
jarod@...hat.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ