lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMeQTsakXL5DgdnozTzTXeu0W8yFa4EY4q-Q57Q20wHiVUMjoA@mail.gmail.com>
Date:	Mon, 1 Feb 2016 09:11:51 +0100
From:	Patrik Jakobsson <patrik.r.jakobsson@...il.com>
To:	Alan <gnomes@...rguk.ukuu.org.uk>
Cc:	David Airlie <airlied@...ux.ie>, wuninsu@...il.com,
	dri-devel <dri-devel@...ts.freedesktop.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gma500: clean up an excessive and confusing helper

On Fri, Jan 29, 2016 at 8:37 PM, Alan <gnomes@...rguk.ukuu.org.uk> wrote:
> From: Alan Cox <alan@...ux.intel.com>
>
> This is a left over from the great clean ups in the past. It's confusing as
> it returns an int, yet has one caller that never uses it. The caller already
> has all the right private variables local so the entire function can be
> replaced by a simple if call.
>
> Signed-off-by: Alan Cox <alan@...ux.intel.com>

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@...il.com>

> ---
>  drivers/gpu/drm/gma500/framebuffer.c |   20 ++++----------------
>  1 file changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
> index cb95765..033d894 100644
> --- a/drivers/gpu/drm/gma500/framebuffer.c
> +++ b/drivers/gpu/drm/gma500/framebuffer.c
> @@ -674,29 +674,17 @@ static const struct drm_mode_config_funcs psb_mode_funcs = {
>         .output_poll_changed = psbfb_output_poll_changed,
>  };
>
> -static int psb_create_backlight_property(struct drm_device *dev)
> -{
> -       struct drm_psb_private *dev_priv = dev->dev_private;
> -       struct drm_property *backlight;
> -
> -       if (dev_priv->backlight_property)
> -               return 0;
> -
> -       backlight = drm_property_create_range(dev, 0, "backlight", 0, 100);
> -
> -       dev_priv->backlight_property = backlight;
> -
> -       return 0;
> -}
> -
>  static void psb_setup_outputs(struct drm_device *dev)
>  {
>         struct drm_psb_private *dev_priv = dev->dev_private;
>         struct drm_connector *connector;
>
>         drm_mode_create_scaling_mode_property(dev);
> -       psb_create_backlight_property(dev);
>
> +       /* It is ok for this to fail - we just don't get backlight control */
> +       if (!dev_priv->backlight_property)
> +               dev_priv->backlight_property = drm_property_create_range(dev, 0,
> +                                                       "backlight", 0, 100);
>         dev_priv->ops->output_init(dev);
>
>         list_for_each_entry(connector, &dev->mode_config.connector_list,
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ