All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
To: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V1] regmap: Support for caching in reg_raw_write()
Date: Fri, 10 Feb 2012 11:45:42 +0000	[thread overview]
Message-ID: <20120210114541.GB6472@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1328873572-12603-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 811 bytes --]

On Fri, Feb 10, 2012 at 05:02:52PM +0530, Laxman Dewangan wrote:

This looks good, but could you make the few small improvements below
please?

> +	if (!map->cache_bypass && map->format.parse_val) {
> +		int val_bytes = map->format.val_bytes;
> +		unsigned int ival;
> +		for (i = 0; i < val_len / map->format.val_bytes; i++) {

A bit nit picky but since you've got a local val_bytes you may as well
use it.

> +			memcpy(map->work_buf, val + (i * val_bytes), val_bytes);
> +			ival = map->format.parse_val(map->work_buf);
> +			ret = regcache_write(map, reg + i, ival);
> +			if (ret) {
> +				dev_warn(map->dev,
> +					"Error in caching of register\n");

Say which register and the return value here - knowing the register
might be very helpful for debug.  This should probably also be at least
a dev_err().

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH V1] regmap: Support for caching in reg_raw_write()
Date: Fri, 10 Feb 2012 11:45:42 +0000	[thread overview]
Message-ID: <20120210114541.GB6472@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1328873572-12603-1-git-send-email-ldewangan@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 811 bytes --]

On Fri, Feb 10, 2012 at 05:02:52PM +0530, Laxman Dewangan wrote:

This looks good, but could you make the few small improvements below
please?

> +	if (!map->cache_bypass && map->format.parse_val) {
> +		int val_bytes = map->format.val_bytes;
> +		unsigned int ival;
> +		for (i = 0; i < val_len / map->format.val_bytes; i++) {

A bit nit picky but since you've got a local val_bytes you may as well
use it.

> +			memcpy(map->work_buf, val + (i * val_bytes), val_bytes);
> +			ival = map->format.parse_val(map->work_buf);
> +			ret = regcache_write(map, reg + i, ival);
> +			if (ret) {
> +				dev_warn(map->dev,
> +					"Error in caching of register\n");

Say which register and the return value here - knowing the register
might be very helpful for debug.  This should probably also be at least
a dev_err().

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2012-02-10 11:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 11:32 [PATCH V1] regmap: Support for caching in reg_raw_write() Laxman Dewangan
2012-02-10 11:32 ` Laxman Dewangan
     [not found] ` <1328873572-12603-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-10 11:45   ` Mark Brown [this message]
2012-02-10 11:45     ` Mark Brown
2012-02-10 12:01 ` Lars-Peter Clausen
     [not found]   ` <4F350716.9050407-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2012-02-10 12:07     ` Laxman Dewangan
2012-02-10 12:07       ` Laxman Dewangan
2012-02-10 12:14     ` Mark Brown
2012-02-10 12:14       ` Mark Brown
     [not found]       ` <20120210121405.GD6472-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-02-10 12:33         ` Lars-Peter Clausen
2012-02-10 12:33           ` Lars-Peter Clausen
     [not found]           ` <4F350E8C.6030907-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2012-02-10 15:58             ` Mark Brown
2012-02-10 15:58               ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120210114541.GB6472@opensource.wolfsonmicro.com \
    --to=broonie-yzvpicuk2aatku/dhu1wvuem+bqzidxxqq4iyu8u01e@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.