All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: lm3533: fix return type of attribute is_visible
@ 2012-05-11  8:40 Johan Hovold
  2012-05-18 11:18 ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Hovold @ 2012-05-11  8:40 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, Andrew Morton, Johan Hovold

Since commit 587a1f1659 ("switch ->is_visible() to returning umode_t")
the return type of is_visible is umode_t rather than mode_t.

This silences a compiler warning on some architectures where these types
are not compatible.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
 drivers/mfd/lm3533-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c
index d11c891..5770bea 100644
--- a/drivers/mfd/lm3533-core.c
+++ b/drivers/mfd/lm3533-core.c
@@ -359,7 +359,7 @@ static struct attribute *lm3533_attributes[] = {
 #define to_dev_attr(_attr) \
 	container_of(_attr, struct device_attribute, attr)
 
-static mode_t lm3533_attr_is_visible(struct kobject *kobj,
+static umode_t lm3533_attr_is_visible(struct kobject *kobj,
 					     struct attribute *attr, int n)
 {
 	struct device *dev = container_of(kobj, struct device, kobj);
@@ -367,7 +367,7 @@ static mode_t lm3533_attr_is_visible(struct kobject *kobj,
 	struct device_attribute *dattr = to_dev_attr(attr);
 	struct lm3533_device_attribute *lattr = to_lm3533_dev_attr(dattr);
 	enum lm3533_attribute_type type = lattr->type;
-	mode_t mode = attr->mode;
+	umode_t mode = attr->mode;
 
 	if (!lm3533->have_backlights && type == LM3533_ATTR_TYPE_BACKLIGHT)
 		mode = 0;
-- 
1.7.8.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: lm3533: fix return type of attribute is_visible
  2012-05-11  8:40 [PATCH] mfd: lm3533: fix return type of attribute is_visible Johan Hovold
@ 2012-05-18 11:18 ` Johan Hovold
  2012-05-20 13:19   ` Samuel Ortiz
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Hovold @ 2012-05-18 11:18 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, Andrew Morton, Johan Hovold

Hi Samuel,

On Fri, May 11, 2012 at 10:40:41AM +0200, Johan Hovold wrote:
> Since commit 587a1f1659 ("switch ->is_visible() to returning umode_t")
> the return type of is_visible is umode_t rather than mode_t.
> 
> This silences a compiler warning on some architectures where these types
> are not compatible.
> 
> Reported-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Johan Hovold <jhovold@gmail.com>
> ---

Apparently Dan Carpenter sent a fix for this compiler warning the day
after I submitted mine. Dan's patch, however, only fixed the return type
and not the type of the mode variable.

Could you consider applying this patch one on top of Dan's (which you
applied to mfd-next on Monday)?

Thanks,
Johan

>  drivers/mfd/lm3533-core.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c
> index d11c891..5770bea 100644
> --- a/drivers/mfd/lm3533-core.c
> +++ b/drivers/mfd/lm3533-core.c
> @@ -359,7 +359,7 @@ static struct attribute *lm3533_attributes[] = {
>  #define to_dev_attr(_attr) \
>  	container_of(_attr, struct device_attribute, attr)
>  
> -static mode_t lm3533_attr_is_visible(struct kobject *kobj,
> +static umode_t lm3533_attr_is_visible(struct kobject *kobj,
>  					     struct attribute *attr, int n)
>  {
>  	struct device *dev = container_of(kobj, struct device, kobj);
> @@ -367,7 +367,7 @@ static mode_t lm3533_attr_is_visible(struct kobject *kobj,
>  	struct device_attribute *dattr = to_dev_attr(attr);
>  	struct lm3533_device_attribute *lattr = to_lm3533_dev_attr(dattr);
>  	enum lm3533_attribute_type type = lattr->type;
> -	mode_t mode = attr->mode;
> +	umode_t mode = attr->mode;
>  
>  	if (!lm3533->have_backlights && type == LM3533_ATTR_TYPE_BACKLIGHT)
>  		mode = 0;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: lm3533: fix return type of attribute is_visible
  2012-05-18 11:18 ` Johan Hovold
@ 2012-05-20 13:19   ` Samuel Ortiz
  2012-05-21  8:46     ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Ortiz @ 2012-05-20 13:19 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-kernel, Andrew Morton

Hi Johan,

On Fri, May 18, 2012 at 01:18:04PM +0200, Johan Hovold wrote:
> Hi Samuel,
> 
> On Fri, May 11, 2012 at 10:40:41AM +0200, Johan Hovold wrote:
> > Since commit 587a1f1659 ("switch ->is_visible() to returning umode_t")
> > the return type of is_visible is umode_t rather than mode_t.
> > 
> > This silences a compiler warning on some architectures where these types
> > are not compatible.
> > 
> > Reported-by: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Johan Hovold <jhovold@gmail.com>
> > ---
> 
> Apparently Dan Carpenter sent a fix for this compiler warning the day
> after I submitted mine. Dan's patch, however, only fixed the return type
> and not the type of the mode variable.
> 
> Could you consider applying this patch one on top of Dan's (which you
> applied to mfd-next on Monday)?
I applied the following chunk:

@@ -367,7 +367,7 @@ static umode_t lm3533_attr_is_visible(struct kobject *kobj,
        struct device_attribute *dattr = to_dev_attr(attr);
        struct lm3533_device_attribute *lattr = to_lm3533_dev_attr(dattr);
        enum lm3533_attribute_type type = lattr->type;
-       mode_t mode = attr->mode;
+       umode_t mode = attr->mode;

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: lm3533: fix return type of attribute is_visible
  2012-05-20 13:19   ` Samuel Ortiz
@ 2012-05-21  8:46     ` Johan Hovold
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2012-05-21  8:46 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Johan Hovold, linux-kernel, Andrew Morton

On Sun, May 20, 2012 at 03:19:08PM +0200, Samuel Ortiz wrote:
> Hi Johan,
> 
> On Fri, May 18, 2012 at 01:18:04PM +0200, Johan Hovold wrote:
> > Hi Samuel,
> > 
> > On Fri, May 11, 2012 at 10:40:41AM +0200, Johan Hovold wrote:
> > > Since commit 587a1f1659 ("switch ->is_visible() to returning umode_t")
> > > the return type of is_visible is umode_t rather than mode_t.
> > > 
> > > This silences a compiler warning on some architectures where these types
> > > are not compatible.
> > > 
> > > Reported-by: Andrew Morton <akpm@linux-foundation.org>
> > > Signed-off-by: Johan Hovold <jhovold@gmail.com>
> > > ---
> > 
> > Apparently Dan Carpenter sent a fix for this compiler warning the day
> > after I submitted mine. Dan's patch, however, only fixed the return type
> > and not the type of the mode variable.
> > 
> > Could you consider applying this patch one on top of Dan's (which you
> > applied to mfd-next on Monday)?
> I applied the following chunk:
> 
> @@ -367,7 +367,7 @@ static umode_t lm3533_attr_is_visible(struct kobject *kobj,
>         struct device_attribute *dattr = to_dev_attr(attr);
>         struct lm3533_device_attribute *lattr = to_lm3533_dev_attr(dattr);
>         enum lm3533_attribute_type type = lattr->type;
> -       mode_t mode = attr->mode;
> +       umode_t mode = attr->mode;

Great. Thanks!

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-21  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11  8:40 [PATCH] mfd: lm3533: fix return type of attribute is_visible Johan Hovold
2012-05-18 11:18 ` Johan Hovold
2012-05-20 13:19   ` Samuel Ortiz
2012-05-21  8:46     ` Johan Hovold

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.