From d6ab6f6c701a133226cb4a8a227979d421f65d36 Mon Sep 17 00:00:00 2001 From: Andrzej Hajda Date: Tue, 6 Sep 2016 11:20:32 +0200 Subject: [PATCH] drm/panel/s6e3ha2: remove redundant definition of VINT_STATUS_MAX VINT_STATUS_MAX is equal to size of VINT_TABLE, so it can be replaced be ARRAY_SIZE macro. Change-Id: I5c6ee3ec4a9827e844f89d0d85ccb18f785378aa Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/panel/panel-s6e3ha2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-s6e3ha2.c b/drivers/gpu/drm/panel/panel-s6e3ha2.c index 62bd3f4..f3b622a 100644 --- a/drivers/gpu/drm/panel/panel-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-s6e3ha2.c @@ -28,7 +28,6 @@ #define MAX_GAMMA 350 #define NUM_GAMMA_STEPS 46 #define GAMMA_CMD_CNT 35 -#define VINT_STATUS_MAX 10 static const u8 MDNIE_6500K[] = { 0xec, 0x98, 0x24, 0x10, 0x14, 0xb3, 0x01, 0x0e, 0x01, 0x00, @@ -255,7 +254,7 @@ static const u8 gamma_tbl[NUM_GAMMA_STEPS][GAMMA_CMD_CNT] = { 0x00, 0x00 } }; -unsigned char VINT_TABLE[VINT_STATUS_MAX] = { +unsigned char VINT_TABLE[] = { 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21 }; @@ -533,7 +532,7 @@ static int s6e3ha2_get_brightness(struct backlight_device *bl_dev) static void s6e3ha2_set_vint(struct s6e3ha2 *ctx) { - int vind = (VINT_STATUS_MAX - 1) + int vind = (ARRAY_SIZE(VINT_TABLE) - 1) * ctx->bl_dev->props.brightness / MAX_BRIGHTNESS; s6e3ha2_dcs_write_seq(ctx, 0xf4, 0x8b, VINT_TABLE[vind]); -- 2.7.4