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: <CACxGe6sjTTnB2_e2omp51bnc+4kshkhNRfqDPdB3fYQG=oiWmQ@mail.gmail.com>
Date:	Thu, 14 Jul 2011 23:04:27 -0600
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Greg KH <greg@...ah.com>,
	Dimitris Papastamos <dp@...nsource.wolfsonmicro.com>,
	Liam Girdwood <lrg@...com>,
	Samuel Oritz <sameo@...ux.intel.com>,
	Graeme Gregory <gg@...mlogic.co.uk>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] regmap: Add SPI bus support

On Thu, Jul 14, 2011 at 10:39 PM, Mark Brown
<broonie@...nsource.wolfsonmicro.com> wrote:
> On Thu, Jul 14, 2011 at 08:53:27PM -0600, Grant Likely wrote:
>> On Sat, Jul 09, 2011 at 01:50:43PM +0900, Mark Brown wrote:
>
>> >  obj-$(CONFIG_I2C) += regmap-i2c.o
>> > +obj-$(CONFIG_SPI) += regmap-spi.o
>
>> I would think this code should live with drivers/spi.c  And similar
>> for the i2c implementation.
>
> There was a bit about this in the cover mail - it's the interace
> stability issue again, the plan is to move them once we're more
> confident that the interface used will stay stable.

I've got no problem with churn in drivers/spi, and I'm fine to have
changes in drivers/spi merged via other trees if it means the code is
in the logical place.

>
>> > +{
>> > +   struct spi_device *spi = to_spi_device(dev);
>> > +   struct spi_message m;
>> > +   struct spi_transfer t[2];
>
>> > +   spi_message_init(&m);
>> > +
>> > +   memset(&t, 0, sizeof(t));
>
>> If you do:
>
>>       struct spi_transfer t[2] = { {.tx_buf = reg, .len = reg_len},
>>                                    {.tx_buf = val, .len = val_len}};
>
>> Then the memset() and t[0]/t[1] lines can all be culled.
>
> That does the init to zero?

You might want to double check, but I believe it gets implemented as a
memcpy of a static initializer.

>
>> > +   t[1].tx_buf = val;
>> > +   t[1].len = val_len;
>> > +   spi_message_add_tail(&t[0], &m);
>
>> t[0]?
>
> Yes, that's been fixed in git for a little while now.
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
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