Thread (2 messages) 2 messages, 2 authors, 2016-09-30

Re: [PATCH] PM / devfreq: event: Remove unnecessary NULL test for to_devfreq_event(dev)

From: MyungJoo Ham <myungjoo.ham@samsung.com>
Date: 2016-09-30 13:51:05
Also in: linux-samsung-soc

On Sun, Sep 25, 2016 at 9:16 PM, Axel Lin [off-list ref] wrote:
to_devfreq_event(dev) never returns NULL.

If dev == 8 in 32bit system, it is NULL. :)
quoted hunk ↗ jump to hunk
Signed-off-by: Axel Lin <redacted>
---
 drivers/devfreq/devfreq-event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 9aea2c7..d0ae087 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -442,7 +442,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *attr,
 {
        struct devfreq_event_dev *edev = to_devfreq_event(dev);

-       if (!edev || !edev->desc)
+       if (!edev->desc)
                return -EINVAL;

        return sprintf(buf, "%s\n", edev->desc->name);
@@ -454,7 +454,7 @@ static ssize_t enable_count_show(struct device *dev,
 {
        struct devfreq_event_dev *edev = to_devfreq_event(dev);

-       if (!edev || !edev->desc)
+       if (!edev->desc)
                return -EINVAL;

        return sprintf(buf, "%d\n", edev->enable_count);
--
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
MyungJoo Ham, Ph.D.
Frontier CS Lab, S/W Center, Samsung Electronics
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help