Skip to contentSkip to conversation

mfd: lm3533: fix return type of attribute is_visible

PATCH In review Johan Hovold 2 participants 4 messages May 11, 2012 – May 21, 2012 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: lm3533: fix return type of attribute is_visible

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.

---
 drivers/mfd/lm3533-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/lm3533-core.c +2 -2
index d11c891..5770bea 100644
@@ -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;
Signature · 1 line
1.7.8.5
#1 lore raw

Hi Samuel,

Quoted 9 lines · 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.

---

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

Quoted 25 lines
 drivers/mfd/lm3533-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/lm3533-core.c +2 -2
index d11c891..5770bea 100644
@@ -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;
#2 lore raw

Hi Johan,

Quoted 13 lines · Johan Hovold

Hi Samuel,

Quoted 9 lines · 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.

---

Quoted 6 lines

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.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
#3 lore raw
Quoted 25 lines · Samuel Ortiz

Hi Johan,

Quoted 13 lines · Johan Hovold

Hi Samuel,

Quoted 9 lines · 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.

---

Quoted 6 lines

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:

drivers/mfd/lm3533-core.c static umode_t lm3533_attr_is_visible(struct kobject *kobj, · line 370

Quoted 5 lines
drivers/mfd/lm3533-core.c +1 -1
@@ -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