Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1511322 > unrolled thread

Re: [RFC 12/14] regmap: SoundWire: Add regmap support for SoundWire bus

Started byMark Brown <broonie@kernel.org>
First post2016-10-28 20:10 +0200
Last post2016-11-02 09:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC 12/14] regmap: SoundWire: Add regmap support for SoundWire  bus Mark Brown <broonie@kernel.org> - 2016-10-28 20:10 +0200
    Re: [RFC 12/14] regmap: SoundWire: Add regmap support for SoundWire  bus Hardik Shah <hardik.t.shah@intel.com> - 2016-11-02 09:10 +0100

#1511322 — Re: [RFC 12/14] regmap: SoundWire: Add regmap support for SoundWire bus

FromMark Brown <broonie@kernel.org>
Date2016-10-28 20:10 +0200
SubjectRe: [RFC 12/14] regmap: SoundWire: Add regmap support for SoundWire bus
Message-ID<sxjLj-3hO-9@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

On Fri, Oct 21, 2016 at 06:11:10PM +0530, Hardik Shah wrote:

> +static inline void get_t_size(size_t *t_val_size, size_t *t_size,
> +						int *reg_addr,
> +						int *offset,
> +						size_t *val_size)
> +{
> +
> +		*t_val_size += *t_size;
> +		*offset += *t_size;

So, I started by taking a look at this patch to get a sense of what the
API would look like and I see that we're not following CodingStyle with
everything indented twice :(

> +static int regmap_sdw_gather_write(void *context,
> +			   const void *reg, size_t reg_size,
> +			   const void *val, size_t val_size)
> +{

> +	if (!sdw)
> +		return 0;

Silently ignoring errors :(

> +	if (val_size > SDW_MAX_REG_ADDR)
> +		t_size = SDW_MAX_REG_ADDR - reg_command;
> +	else
> +		t_size = val_size;

This needs at least some kind of comment?

[toc] | [next] | [standalone]


#1513722

FromHardik Shah <hardik.t.shah@intel.com>
Date2016-11-02 09:10 +0100
Message-ID<syYMp-3HJ-1@gated-at.bofh.it>
In reply to#1511322
On Fri, Oct 28, 2016 at 07:03:55PM +0100, Mark Brown wrote:
> On Fri, Oct 21, 2016 at 06:11:10PM +0530, Hardik Shah wrote:
> 
> > +static inline void get_t_size(size_t *t_val_size, size_t *t_size,
> > +						int *reg_addr,
> > +						int *offset,
> > +						size_t *val_size)
> > +{
> > +
> > +		*t_val_size += *t_size;
> > +		*offset += *t_size;
> 
> So, I started by taking a look at this patch to get a sense of what the
> API would look like and I see that we're not following CodingStyle with
> everything indented twice :(
> 

Sorry Mark for delayed response, there was festival holidays in India, so I
was not able to reply. 

Regarding two tabs, it got missed for this function somehow, I will fix it
in next patchset.

> > +static int regmap_sdw_gather_write(void *context,
> > +			   const void *reg, size_t reg_size,
> > +			   const void *val, size_t val_size)
> > +{
> 
> > +	if (!sdw)
> > +		return 0;
> 
> Silently ignoring errors :(
> 

This should never happen ideally. This was extra check to make sure there is
not kernel crash. I can remove it as well.

> > +	if (val_size > SDW_MAX_REG_ADDR)
> > +		t_size = SDW_MAX_REG_ADDR - reg_command;
> > +	else
> > +		t_size = val_size;
> 
> This needs at least some kind of comment?


I will add few comments here.


-- 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web