mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Kosina <jkosina@suse.cz>
To: Kulikov Vasiliy <segooon@gmail.com>
Cc: Kernel Janitors <kernel-janitors@vger.kernel.org>,
	David Airlie <airlied@linux.ie>, Dave Airlie <airlied@redhat.com>,
	Adam Jackson <ajax@redhat.com>, Zhao Yakui <yakui.zhao@intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 03/16] trivial: use ARRAY_SIZE
Date: Tue, 20 Jul 2010 17:06:19 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1007201706060.4741@pobox.suse.cz> (raw)
In-Reply-To: <1277726093-24500-1-git-send-email-segooon@gmail.com>

On Mon, 28 Jun 2010, Kulikov Vasiliy wrote:

> Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).
> 
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
>  drivers/gpu/drm/drm_edid.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index c198186..da06476 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -929,13 +929,11 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
>  		{ 1440,  576 },
>  		{ 2880,  576 },
>  	};
> -	static const int n_sizes =
> -		sizeof(cea_interlaced)/sizeof(cea_interlaced[0]);
>  
>  	if (!(pt->misc & DRM_EDID_PT_INTERLACED))
>  		return;
>  
> -	for (i = 0; i < n_sizes; i++) {
> +	for (i = 0; i < ARRAY_SIZE(cea_interlaced); i++) {
>  		if ((mode->hdisplay == cea_interlaced[i].w) &&
>  		    (mode->vdisplay == cea_interlaced[i].h / 2)) {
>  			mode->vdisplay *= 2;
> @@ -1375,7 +1373,6 @@ static const struct {
>  	{ 1920, 1440, 60, 0 },
>  	{ 1920, 1440, 75, 0 },
>  };
> -static const int num_est3_modes = sizeof(est3_modes) / sizeof(est3_modes[0]);
>  
>  static int
>  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 (j = 7; j > 0; j--) {
>  			m = (i * 8) + (7 - j);
> -			if (m >= num_est3_modes)
> +			if (m >= ARRAY_SIZE(est3_modes))
>  				break;
>  			if (est[i] & (1 << j)) {
>  				mode = drm_mode_find_dmt(connector->dev,

Not found in linux-next as of today. Applied, thanks.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

      reply	other threads:[~2010-07-20 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28 11:54 Kulikov Vasiliy
2010-07-20 15:06 ` Jiri Kosina [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1007201706060.4741@pobox.suse.cz \
    --to=jkosina@suse.cz \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=ajax@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=segooon@gmail.com \
    --cc=yakui.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®