From: Mark Brown <broonie@kernel.org>
To: Henry Chen <henryc.chen@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
Sascha Hauer <kernel@pengutronix.de>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
eddie.huang@mediatek.com
Subject: Re: [PATCH] regmap: Add function check before called format_val
Date: Mon, 20 Jul 2015 16:02:54 +0100 [thread overview]
Message-ID: <20150720150254.GC11162@sirena.org.uk> (raw)
In-Reply-To: <1437396110-5192-1-git-send-email-henryc.chen@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 770 bytes --]
On Mon, Jul 20, 2015 at 08:41:50PM +0800, Henry Chen wrote:
> The regmap_format will not be initialize since regmap_bus is not assgined
> on regmap_init(). It should has a function check before using
> format_val() to avoid null function called on regmap_bulk_read().
> - map->format.format_val(val + (i * val_bytes), ival, 0);
> + if (map->format.format_val)
> + map->format.format_val(val + (i * val_bytes), ival, 0);
> + else
> + memcpy(val + (i * val_bytes), &ival, val_bytes);
Your changelog doesn't explan why we are in this code path in the first
place without a format_val() and why a memcpy() is an appropriate
replacement. It should, it's not clear to me that this is a good fix
but I don't feel I fully understand the problem.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-07-20 15:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 12:41 [PATCH] regmap: Add function check before called format_val Henry Chen
2015-07-20 15:02 ` Mark Brown [this message]
2015-07-21 6:07 ` Henry Chen
2015-07-21 17:25 ` Mark Brown
2015-07-22 14:31 ` Henry Chen
2015-07-22 17:00 ` Mark Brown
2015-08-12 14:20 ` Daniel Kurtz
2015-08-13 15:25 ` Henry Chen
2015-08-14 17:56 ` 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=20150720150254.GC11162@sirena.org.uk \
--to=broonie@kernel.org \
--cc=eddie.huang@mediatek.com \
--cc=henryc.chen@mediatek.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).