提交 04ad327f 编写于 作者: K Kulikov Vasiliy 提交者: Jiri Kosina

drm: i915: use ARRAY_SIZE

Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 3c581411
...@@ -392,13 +392,13 @@ static void intel_sdvo_debug_write(struct intel_encoder *intel_encoder, u8 cmd, ...@@ -392,13 +392,13 @@ static void intel_sdvo_debug_write(struct intel_encoder *intel_encoder, u8 cmd,
DRM_LOG_KMS("%02X ", ((u8 *)args)[i]); DRM_LOG_KMS("%02X ", ((u8 *)args)[i]);
for (; i < 8; i++) for (; i < 8; i++)
DRM_LOG_KMS(" "); DRM_LOG_KMS(" ");
for (i = 0; i < sizeof(sdvo_cmd_names) / sizeof(sdvo_cmd_names[0]); i++) { for (i = 0; i < ARRAY_SIZE(sdvo_cmd_names); i++) {
if (cmd == sdvo_cmd_names[i].cmd) { if (cmd == sdvo_cmd_names[i].cmd) {
DRM_LOG_KMS("(%s)", sdvo_cmd_names[i].name); DRM_LOG_KMS("(%s)", sdvo_cmd_names[i].name);
break; break;
} }
} }
if (i == sizeof(sdvo_cmd_names)/ sizeof(sdvo_cmd_names[0])) if (i == ARRAY_SIZE(sdvo_cmd_names))
DRM_LOG_KMS("(%02X)", cmd); DRM_LOG_KMS("(%02X)", cmd);
DRM_LOG_KMS("\n"); DRM_LOG_KMS("\n");
} }
......
...@@ -1424,7 +1424,7 @@ intel_tv_get_modes(struct drm_connector *connector) ...@@ -1424,7 +1424,7 @@ intel_tv_get_modes(struct drm_connector *connector)
int j, count = 0; int j, count = 0;
u64 tmp; u64 tmp;
for (j = 0; j < sizeof(input_res_table) / sizeof(input_res_table[0]); for (j = 0; j < ARRAY_SIZE(input_res_table);
j++) { j++) {
struct input_res *input = &input_res_table[j]; struct input_res *input = &input_res_table[j];
unsigned int hactive_s = input->w; unsigned int hactive_s = input->w;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册