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>, Eric Anholt <eric@anholt.net>,
	Zhao Yakui <yakui.zhao@intel.com>,
	Zhenyu Wang <zhenyuw@linux.intel.com>,
	Ma Ling <ling.ma@intel.com>,
	Ian Romanick <ian.d.romanick@intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/16] trivial: use ARRAY_SIZE
Date: Tue, 20 Jul 2010 17:08:47 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1007201708300.4741@pobox.suse.cz> (raw)
In-Reply-To: <1277726097-24534-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/i915/intel_sdvo.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index 76993ac..03c231b 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -392,13 +392,13 @@ static void intel_sdvo_debug_write(struct intel_encoder *intel_encoder, u8 cmd,
>  		DRM_LOG_KMS("%02X ", ((u8 *)args)[i]);
>  	for (; i < 8; i++)
>  		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) {
>  			DRM_LOG_KMS("(%s)", sdvo_cmd_names[i].name);
>  			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("\n");
>  }

Applied to trivial queue, as linux-next as of today doesn't carry this 
patch.

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

      reply	other threads:[~2010-07-20 15:08 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:08 ` 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.1007201708300.4741@pobox.suse.cz \
    --to=jkosina@suse.cz \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=ian.d.romanick@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=ling.ma@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=segooon@gmail.com \
    --cc=yakui.zhao@intel.com \
    --cc=zhenyuw@linux.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®