Commit 3c581411 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Jiri Kosina

drm: drm_edid: use ARRAY_SIZE

Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 7ea7c6d5
...@@ -929,13 +929,11 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode, ...@@ -929,13 +929,11 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
{ 1440, 576 }, { 1440, 576 },
{ 2880, 576 }, { 2880, 576 },
}; };
static const int n_sizes =
sizeof(cea_interlaced)/sizeof(cea_interlaced[0]);
if (!(pt->misc & DRM_EDID_PT_INTERLACED)) if (!(pt->misc & DRM_EDID_PT_INTERLACED))
return; return;
for (i = 0; i < n_sizes; i++) { for (i = 0; i < ARRAY_SIZE(cea_interlaced); i++) {
if ((mode->hdisplay == cea_interlaced[i].w) && if ((mode->hdisplay == cea_interlaced[i].w) &&
(mode->vdisplay == cea_interlaced[i].h / 2)) { (mode->vdisplay == cea_interlaced[i].h / 2)) {
mode->vdisplay *= 2; mode->vdisplay *= 2;
...@@ -1375,7 +1373,6 @@ static const struct { ...@@ -1375,7 +1373,6 @@ static const struct {
{ 1920, 1440, 60, 0 }, { 1920, 1440, 60, 0 },
{ 1920, 1440, 75, 0 }, { 1920, 1440, 75, 0 },
}; };
static const int num_est3_modes = sizeof(est3_modes) / sizeof(est3_modes[0]);
static int static int
drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing) drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing)
...@@ -1387,7 +1384,7 @@ drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing) ...@@ -1387,7 +1384,7 @@ drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing)
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
for (j = 7; j > 0; j--) { for (j = 7; j > 0; j--) {
m = (i * 8) + (7 - j); m = (i * 8) + (7 - j);
if (m >= num_est3_modes) if (m >= ARRAY_SIZE(est3_modes))
break; break;
if (est[i] & (1 << j)) { if (est[i] & (1 << j)) {
mode = drm_mode_find_dmt(connector->dev, mode = drm_mode_find_dmt(connector->dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment