conditionally disable unused functions (clang)
This commit is contained in:
parent
5f39f5717b
commit
8e1dc4e676
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: intel_panel.c,v 1.11 2018/09/13 08:25:55 mrg Exp $ */
|
/* $NetBSD: intel_panel.c,v 1.12 2018/10/06 15:33:35 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright © 2006-2010 Intel Corporation
|
* Copyright © 2006-2010 Intel Corporation
|
||||||
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: intel_panel.c,v 1.11 2018/09/13 08:25:55 mrg Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: intel_panel.c,v 1.12 2018/10/06 15:33:35 christos Exp $");
|
||||||
|
|
||||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
@ -432,6 +432,7 @@ static uint32_t scale(uint32_t source_val,
|
|||||||
return target_val;
|
return target_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
|
||||||
/* Scale user_level in range [0..user_max] to [hw_min..hw_max]. */
|
/* Scale user_level in range [0..user_max] to [hw_min..hw_max]. */
|
||||||
static inline u32 scale_user_to_hw(struct intel_connector *connector,
|
static inline u32 scale_user_to_hw(struct intel_connector *connector,
|
||||||
u32 user_level, u32 user_max)
|
u32 user_level, u32 user_max)
|
||||||
@ -441,6 +442,7 @@ static inline u32 scale_user_to_hw(struct intel_connector *connector,
|
|||||||
return scale(user_level, 0, user_max,
|
return scale(user_level, 0, user_max,
|
||||||
panel->backlight.min, panel->backlight.max);
|
panel->backlight.min, panel->backlight.max);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Scale user_level in range [0..user_max] to [0..hw_max], clamping the result
|
/* Scale user_level in range [0..user_max] to [0..hw_max], clamping the result
|
||||||
* to [hw_min..hw_max]. */
|
* to [hw_min..hw_max]. */
|
||||||
@ -456,6 +458,7 @@ static inline u32 clamp_user_to_hw(struct intel_connector *connector,
|
|||||||
return hw_level;
|
return hw_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
|
||||||
/* Scale hw_level in range [hw_min..hw_max] to [0..user_max]. */
|
/* Scale hw_level in range [hw_min..hw_max] to [0..user_max]. */
|
||||||
static inline u32 scale_hw_to_user(struct intel_connector *connector,
|
static inline u32 scale_hw_to_user(struct intel_connector *connector,
|
||||||
u32 hw_level, u32 user_max)
|
u32 hw_level, u32 user_max)
|
||||||
@ -465,6 +468,7 @@ static inline u32 scale_hw_to_user(struct intel_connector *connector,
|
|||||||
return scale(hw_level, panel->backlight.min, panel->backlight.max,
|
return scale(hw_level, panel->backlight.min, panel->backlight.max,
|
||||||
0, user_max);
|
0, user_max);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static u32 intel_panel_compute_brightness(struct intel_connector *connector,
|
static u32 intel_panel_compute_brightness(struct intel_connector *connector,
|
||||||
u32 val)
|
u32 val)
|
||||||
|
Loading…
Reference in New Issue
Block a user