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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 25, 2016 at 9:16 PM, Axel Lin <axel.lin@xxxxxxxxxx> wrote:
> to_devfreq_event(dev) never returns NULL.


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

>
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
MyungJoo Ham, Ph.D.
Frontier CS Lab, S/W Center, Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux