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: <20100521124641.GQ30801@buzzloop.caiaq.de>
Date:	Fri, 21 May 2010 14:46:41 +0200
From:	Daniel Mack <daniel@...aq.de>
To:	Hemanth V <hemanthv@...com>
Cc:	linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
	linux-input@...r.kernel.org
Subject: Re: [RFC] [PATCH] misc : ROHM BH1780GLI Ambient light sensor Driver

On Fri, May 21, 2010 at 06:10:00PM +0530, Hemanth V wrote:
> >On Fri, May 21, 2010 at 05:05:50PM +0530, Hemanth V wrote:
> >>+ mutex_lock(&ddata->lock);
> >>+
> >>+ error = bh1780_write(ddata, BH1780_REG_CONTROL, val, "CONTROL");
> >>+ if (error < 0) {
> >>+ mutex_unlock(&ddata->lock);
> >>+ return error;
> >>+ }
> >>+
> >>+ msleep(BH1780_PON_DELAY);
> >
> >Hmm, what do you wait for here?
> 
> Settling time delay required before lux read out

I thought so, but in fact you're just delaying the next two lines by
that:

> >>+ ddata->power_state = val;
> >>+ mutex_unlock(&ddata->lock);

... which doesn't make sense to me.

I can believe there is need to wait for the value to settle, but I think
it's the wrong place where you're doing it currently.

> >>+static int __devinit bh1780_probe(struct i2c_client *client,
> >>+ const struct i2c_device_id *id)
> >>+{
> >>+ int ret;
> >>+ struct bh1780_data *ddata = NULL;
> >
> >The initialization isn't needed.
> 
> This is basically added for the first goto error, to prevent
> any garbage values

Sorry, you're right. Ignore this comment :)

Thanks,
Daniel

--
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