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] [day] [month] [year] [list]
Message-ID: <9ed69bb8-ff2c-76bb-faef-71c06e96877b@lucaceresoli.net>
Date:   Tue, 28 Aug 2018 11:14:47 +0200
From:   Luca Ceresoli <luca@...aceresoli.net>
To:     Philippe De Muyter <phdm@...q.eu>
Cc:     linux-media@...r.kernel.org,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Leon Luo <leonl@...pardimaging.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 1/2] media: imx274: use regmap_bulk_write to write
 multybyte registers

Hi Philippe,

thanks for you review.

On 28/08/2018 11:03, Philippe De Muyter wrote:
> On Wed, Jul 25, 2018 at 06:24:54PM +0200, Luca Ceresoli wrote:
>> Currently 2-bytes and 3-bytes registers are set by very similar
>> functions doing the needed shift & mask manipulation, followed by very
>> similar for loops setting one byte at a time over I2C.
>>
>> Replace all of this code by a unique helper function that calls
>> regmap_bulk_write(), which has two advantages:
>>  - sets all the bytes in a unique I2C transaction
>>  - removes lots of now unused code.
>>
>> Signed-off-by: Luca Ceresoli <luca@...aceresoli.net>
>> Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>
>>
> ...
>> +/**
>> + * Write a multibyte register.
>> + *
>> + * Uses a bulk write where possible.
>> + *
>> + * @priv: Pointer to device structure
>> + * @addr: Address of the LSB register.  Other registers must be
>> + *        consecutive, least-to-most significant.
>> + * @val: Value to be written to the register (cpu endianness)
>> + * @nbytes: Number of bits to write (range: [1..3])
>> + */
>> +static int imx274_write_mbreg(struct stimx274 *priv, u16 addr, u32 val,
>> +			      size_t nbytes)
> 
> Should nbytes be called nbits, or is nbytes a 'Number of bytes' ?

This patch has already been applied, but I sent a fix:
https://patchwork.linuxtv.org/patch/51719/

-- 
Luca

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ