public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Rhyland Klein <rklein@nvidia.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: Fix MACRO for commonly declared MFD cell attributes
Date: Wed, 2 Mar 2016 13:08:28 +0000	[thread overview]
Message-ID: <20160302130828.GB3444@x1> (raw)
In-Reply-To: <56D43BE1.1080501@nvidia.com>

On Mon, 29 Feb 2016, Laxman Dewangan wrote:

> 
> On Friday 26 February 2016 10:05 PM, Rhyland Klein wrote:
> >On 2/19/2016 11:28 AM, Rhyland Klein wrote:
> >>On 2/19/2016 3:50 AM, Lee Jones wrote:
> >>>On Thu, 18 Feb 2016, Rhyland Klein wrote:
> >>>
> >>>>  #define MFD_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
> >>>>-#define MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, _match)		\
> >>>>+#define MFD_CELL_ALL(_name, _nres, _res, _pdata, _id, _compat, _match)	\
> >>>>  	{								\
> >>>>  		.name = (_name),					\
> >>>>  		.resources = (_res),					\
> >>>>-		.num_resources = MFD_ARRAY_SIZE((_res)),		\
> >>>>+		.num_resources = (_nres),				\
> >>>>  		.platform_data = (_pdata),				\
> >>>>  		.pdata_size = MFD_ARRAY_SIZE((_pdata)), 		\
> The pdata_size initialization is also not correct. This is not the
> array count but the size
> of the platform data which is passed. Should be sizeof((_pdata))
> 
> 
> 
> >>  #define MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, _match)                \
> >>         {                                                               \
> >>
> >>That was my first thought too. However, I see this when I try to compile
> >>that:
> >>
> >>In file included from drivers/mfd/max77620.c:18:0:
> >>include/linux/mfd/core.h:19:34: warning: the address of ‘gpio_resources’
> >>will always evaluate as ‘true’ [-Waddress]
> >>  #define MFD_ARRAY_SIZE(arr) (arr ? (sizeof(arr) / sizeof((arr)[0])) : 0)
> >>
> >>7 different times. This patch was the only way I seemed to be able to
> >>WAR around compile time warnings.
> >>
> >>-rhyland
> >>
> >Did you not see warnings like this when you compiled the kernel? Did you
> >find a different approach than what I proposed above to deal with it?
> >I'd like to get this in soon so that when the max77620 drivers are all
> >in and using it, it should be functional.
> >
> I think the following change also crash in runtime:
> 
> /***
> commit e60a946f05db2cac857025da6ffb72df48d3be54
> Author: Lee Jones <lee.jones@linaro.org>
> 
>     mfd: ab8500: Provide a small example using new MFD cell MACROs
> 
> ***/
> 
> Should we have something MFD_CELL_RES, MFD_CELL_RES_PDATA,
> MFD_CELL_PDATA, for more common user and not to pass the NULL here.

I'll have a re-think about this.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2016-03-02 13:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 18:52 [PATCH] mfd: Fix MACRO for commonly declared MFD cell attributes Rhyland Klein
2016-02-19  8:50 ` Lee Jones
2016-02-19 16:28   ` Rhyland Klein
2016-02-26 16:35     ` Rhyland Klein
2016-02-29 12:38       ` Laxman Dewangan
2016-03-02 13:08         ` Lee Jones [this message]
2016-03-09 13:22           ` Laxman Dewangan
2016-03-11  8:39             ` Lee Jones
2016-03-11  8:57               ` Laxman Dewangan
2016-03-16  8:42                 ` Lee Jones
2016-03-16  9:22                   ` Laxman Dewangan

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=20160302130828.GB3444@x1 \
    --to=lee.jones@linaro.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rklein@nvidia.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