lkml.org 
[lkml]   [2015]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/9] rtc-pcf2123: clean up writes to the rtc chip
On Tue, 24 Nov 2015 23:16:26 +0100
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:

> On 04/11/2015 at 07:36:34 -0800, Joshua Clayton wrote :
> > +static int pcf2123_write(struct device *dev, u8 *txbuf, size_t
> > size) +{
> > + struct spi_device *spi = to_spi_device(dev);
> > + int ret;
> > +
> > + if (txbuf[0] > PCF2123_REG_MAX)
> > + return -EFAULT;
> > +
>
> Is that test really necessary? From what I understand the driver
> always controls which register is written.
>

In the larger context of the driver, you are correct, there is
no way for an out of range request unless someone were to add new code.
I can remove it.


\
 
 \ /
  Last update: 2015-12-01 19:41    [W:0.047 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site