public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "Randy.Dunlap" <rddunlap-3NddpPZAyC0@public.gmane.org>
Cc: ACPI Developers
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [PATCH] debug.c: don't invent NUM_OF
Date: 07 Jan 2005 13:39:12 -0500	[thread overview]
Message-ID: <1105123150.18166.2646.camel@d845pe> (raw)
In-Reply-To: <41DEC35C.9020604-3NddpPZAyC0@public.gmane.org>

applied.

thanks,
-len

On Fri, 2005-01-07 at 12:14, Randy.Dunlap wrote:
> Use kernel.h for ARRAY_SIZE() instead of using local NUM_OF().
> I.e., use kernel-supplied functions or macros when available.
> 
> Signed-off-by: Randy Dunlap <rddunlap-3NddpPZAyC0@public.gmane.org>
> 
> diffstat:=
>   drivers/acpi/debug.c |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
> 
> ---
> 
> 
> 
> 
> ______________________________________________________________________
> 
> diff -Naurp ./drivers/acpi/debug.c~acpi_array_size ./drivers/acpi/debug.c
> --- ./drivers/acpi/debug.c~acpi_array_size	2004-12-24 13:35:23.000000000 -0800
> +++ ./drivers/acpi/debug.c	2005-01-07 07:56:19.279389952 -0800
> @@ -4,6 +4,7 @@
>  
>  #include <linux/proc_fs.h>
>  #include <linux/init.h>
> +#include <linux/kernel.h>
>  #include <linux/moduleparam.h>
>  #include <asm/uaccess.h>
>  #include <acpi/acpi_drivers.h>
> @@ -87,7 +88,6 @@ const struct acpi_dlevel acpi_debug_leve
>  	ACPI_DEBUG_INIT(ACPI_LV_FULL_TABLES),
>  	ACPI_DEBUG_INIT(ACPI_LV_EVENTS),             
>  };
> -#define NUM_OF(v)	( sizeof(v)/sizeof(v[0]) )
>  
>  static int
>  acpi_system_read_debug (
> @@ -109,7 +109,7 @@ acpi_system_read_debug (
>  
>  	switch ((unsigned long) data) {
>  	case 0:
> -		for (i = 0; i < NUM_OF(acpi_debug_layers); i++) {
> +		for (i = 0; i < ARRAY_SIZE(acpi_debug_layers); i++) {
>  			p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
>  				acpi_debug_layers[i].name,
>  				acpi_debug_layers[i].value,
> @@ -126,7 +126,7 @@ acpi_system_read_debug (
>  			acpi_dbg_layer);
>  		break;
>  	case 1:
> -		for (i = 0; i < NUM_OF(acpi_debug_levels); i++) {
> +		for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) {
>  			p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
>  				acpi_debug_levels[i].name,
>  				acpi_debug_levels[i].value,



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

      parent reply	other threads:[~2005-01-07 18:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-07 17:14 [PATCH] debug.c: don't invent NUM_OF Randy.Dunlap
     [not found] ` <41DEC35C.9020604-3NddpPZAyC0@public.gmane.org>
2005-01-07 18:39   ` Len Brown [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=1105123150.18166.2646.camel@d845pe \
    --to=len.brown-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=rddunlap-3NddpPZAyC0@public.gmane.org \
    /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