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: <87msrd2g5s.fsf@intel.com>
Date: Tue, 05 Mar 2024 11:15:27 +0200
From: Jani Nikula <jani.nikula@...el.com>
To: Thomas Zimmermann <tzimmermann@...e.de>, mpe@...erman.id.au,
 naresh.kamboju@...aro.org, deller@....de, npiggin@...il.com,
 christophe.leroy@...roup.eu, aneesh.kumar@...nel.org,
 naveen.n.rao@...ux.ibm.com
Cc: dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
 lkft-triage@...ts.linaro.org, linux-kernel@...r.kernel.org,
 linuxppc-dev@...ts.ozlabs.org, Thomas Zimmermann <tzimmermann@...e.de>
Subject: Re: [PATCH v2 3/3] arch/powerpc: Remove <linux/fb.h> from backlight
 code

On Tue, 05 Mar 2024, Thomas Zimmermann <tzimmermann@...e.de> wrote:
> Replace <linux/fb.h> with a forward declaration in <asm/backlight.h> to
> resolves an unnecessary dependency. Remove pmac_backlight_curve_lookup()

*resolve

> and struct fb_info from source and header files. The function and the
> framebuffer struct is unused. No functional changes.

*are

Reviewed-by: Jani Nikula <jani.nikula@...el.com>

>
> Signed-off-by: Thomas Zimmermann <tzimmermann@...e.de>
> ---
>  arch/powerpc/include/asm/backlight.h        |  5 ++--
>  arch/powerpc/platforms/powermac/backlight.c | 26 ---------------------
>  2 files changed, 2 insertions(+), 29 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/backlight.h b/arch/powerpc/include/asm/backlight.h
> index 1b5eab62ed047..061a910d74929 100644
> --- a/arch/powerpc/include/asm/backlight.h
> +++ b/arch/powerpc/include/asm/backlight.h
> @@ -10,15 +10,14 @@
>  #define __ASM_POWERPC_BACKLIGHT_H
>  #ifdef __KERNEL__
>  
> -#include <linux/fb.h>
>  #include <linux/mutex.h>
>  
> +struct backlight_device;
> +
>  /* For locking instructions, see the implementation file */
>  extern struct backlight_device *pmac_backlight;
>  extern struct mutex pmac_backlight_mutex;
>  
> -extern int pmac_backlight_curve_lookup(struct fb_info *info, int value);
> -
>  extern int pmac_has_backlight_type(const char *type);
>  
>  extern void pmac_backlight_key(int direction);
> diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c
> index aeb79a8b3e109..12bc01353bd3c 100644
> --- a/arch/powerpc/platforms/powermac/backlight.c
> +++ b/arch/powerpc/platforms/powermac/backlight.c
> @@ -9,7 +9,6 @@
>   */
>  
>  #include <linux/kernel.h>
> -#include <linux/fb.h>
>  #include <linux/backlight.h>
>  #include <linux/adb.h>
>  #include <linux/pmu.h>
> @@ -72,31 +71,6 @@ int pmac_has_backlight_type(const char *type)
>  	return 0;
>  }
>  
> -int pmac_backlight_curve_lookup(struct fb_info *info, int value)
> -{
> -	int level = (FB_BACKLIGHT_LEVELS - 1);
> -
> -	if (info && info->bl_dev) {
> -		int i, max = 0;
> -
> -		/* Look for biggest value */
> -		for (i = 0; i < FB_BACKLIGHT_LEVELS; i++)
> -			max = max((int)info->bl_curve[i], max);
> -
> -		/* Look for nearest value */
> -		for (i = 0; i < FB_BACKLIGHT_LEVELS; i++) {
> -			int diff = abs(info->bl_curve[i] - value);
> -			if (diff < max) {
> -				max = diff;
> -				level = i;
> -			}
> -		}
> -
> -	}
> -
> -	return level;
> -}
> -
>  static void pmac_backlight_key_worker(struct work_struct *work)
>  {
>  	if (atomic_read(&kernel_backlight_disabled))

-- 
Jani Nikula, Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ