diff mbox

PM / devfreq: event: Remove unnecessary NULL test for to_devfreq_event(dev)

Message ID 1474805788-30702-1-git-send-email-axel.lin@ingics.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Axel Lin Sept. 25, 2016, 12:16 p.m. UTC
to_devfreq_event(dev) never returns NULL.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/devfreq/devfreq-event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

MyungJoo Ham Sept. 30, 2016, 1:50 p.m. UTC | #1
On Sun, Sep 25, 2016 at 9:16 PM, Axel Lin <axel.lin@ingics.com> wrote:
> to_devfreq_event(dev) never returns NULL.


If dev == 8 in 32bit system, it is NULL. :)

>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  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
diff mbox

Patch

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);