drm/panel/s6e3ha2: remove redundant definition of VINT_STATUS_MAX 56/87156/4
authorAndrzej Hajda <a.hajda@samsung.com>
Tue, 6 Sep 2016 09:20:32 +0000 (11:20 +0200)
committerInki Dae <inki.dae@samsung.com>
Sun, 18 Sep 2016 23:50:37 +0000 (16:50 -0700)
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 <a.hajda@samsung.com>
drivers/gpu/drm/panel/panel-s6e3ha2.c

index 62bd3f4..f3b622a 100644 (file)
@@ -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]);