Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53abb679 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter
Browse files

drm/i915: Use ARRAY_SIZE() instead of hand rolling it



A couple of hand rolled ARRAY_SIZE()s caught my eye. Get rid of them.

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 0a0b457f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -63,7 +63,7 @@ static const char *tv_format_names[] = {
	"SECAM_60"
	"SECAM_60"
};
};


#define TV_FORMAT_NUM  (sizeof(tv_format_names) / sizeof(*tv_format_names))
#define TV_FORMAT_NUM  ARRAY_SIZE(tv_format_names)


struct intel_sdvo {
struct intel_sdvo {
	struct intel_encoder base;
	struct intel_encoder base;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1291,7 +1291,7 @@ static void intel_tv_find_better_format(struct drm_connector *connector)
		return;
		return;




	for (i = 0; i < sizeof(tv_modes) / sizeof(*tv_modes); i++) {
	for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
		tv_mode = tv_modes + i;
		tv_mode = tv_modes + i;


		if ((intel_tv->type == DRM_MODE_CONNECTOR_Component) ==
		if ((intel_tv->type == DRM_MODE_CONNECTOR_Component) ==
+1 −2
Original line number Original line Diff line number Diff line
@@ -52,8 +52,7 @@ static const char * const forcewake_domain_names[] = {
const char *
const char *
intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id)
intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id)
{
{
	BUILD_BUG_ON((sizeof(forcewake_domain_names)/sizeof(const char *)) !=
	BUILD_BUG_ON(ARRAY_SIZE(forcewake_domain_names) != FW_DOMAIN_ID_COUNT);
		     FW_DOMAIN_ID_COUNT);


	if (id >= 0 && id < FW_DOMAIN_ID_COUNT)
	if (id >= 0 && id < FW_DOMAIN_ID_COUNT)
		return forcewake_domain_names[id];
		return forcewake_domain_names[id];