All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARRAY_SIZE in linux-2.6.25-rc2/scripts/mod/modpost.c
@ 2008-02-16 18:21 Mark Pearson
  2008-02-16 19:04 ` Nish Aravamudan
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Pearson @ 2008-02-16 18:21 UTC (permalink / raw)
  To: kernel-janitors

Hi

I was looking through the TODO list at kernel janitors and thought I
would see if there was any clean-up work I could do. I found a message
about replacing sizeof code for array structures with the ARRAY_SIZE
macro. If this is useful, I can go through the list of modules I found
to require this patch.

As this is the first time I'm delivering a patch, could someone comment
if the format, etc. is ok? If so I will continue with the other modules.
BTW: I'm check on the mailing archives to ensure I'm not repeating work
already completed by someone else.

--- linux-2.6.25-rc2-mpe/scripts/mod/modpost.c  2008-02-16
19:06:58.000000000 +0100
+++ linux-2.6.25-rc2/scripts/mod/modpost.c      2008-02-15
21:57:20.000000000 +0100
@@ -882,7 +882,7 @@
 static int section_mismatch(const char *fromsec, const char *tosec)
 {
        int i;
-       int elems = ARRAY_SIZE(sectioncheck);
+       int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck);
        const struct sectioncheck *check = &sectioncheck[0];
 
        for (i = 0; i < elems; i++) {

--

Cheers, Mark.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARRAY_SIZE in linux-2.6.25-rc2/scripts/mod/modpost.c
  2008-02-16 18:21 [PATCH] ARRAY_SIZE in linux-2.6.25-rc2/scripts/mod/modpost.c Mark Pearson
@ 2008-02-16 19:04 ` Nish Aravamudan
  0 siblings, 0 replies; 2+ messages in thread
From: Nish Aravamudan @ 2008-02-16 19:04 UTC (permalink / raw)
  To: kernel-janitors

On 2/16/08, Mark Pearson <devnull.port@googlemail.com> wrote:
> Hi
>
> I was looking through the TODO list at kernel janitors and thought I
> would see if there was any clean-up work I could do. I found a message
> about replacing sizeof code for array structures with the ARRAY_SIZE
> macro. If this is useful, I can go through the list of modules I found
> to require this patch.
>
> As this is the first time I'm delivering a patch, could someone comment
> if the format, etc. is ok? If so I will continue with the other modules.
> BTW: I'm check on the mailing archives to ensure I'm not repeating work
> already completed by someone else.

Missing Signed-off-by and a real commit message.

> --- linux-2.6.25-rc2-mpe/scripts/mod/modpost.c  2008-02-16
> 19:06:58.000000000 +0100
> +++ linux-2.6.25-rc2/scripts/mod/modpost.c      2008-02-15
> 21:57:20.000000000 +0100

Patch is word-wrapped.

> @@ -882,7 +882,7 @@
>  static int section_mismatch(const char *fromsec, const char *tosec)
>  {
>         int i;
> -       int elems = ARRAY_SIZE(sectioncheck);
> +       int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck);

And looks to be reversed (want to be adding ARRAY_SIZE(), not removing it).

Thanks,
Nish

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-16 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-16 18:21 [PATCH] ARRAY_SIZE in linux-2.6.25-rc2/scripts/mod/modpost.c Mark Pearson
2008-02-16 19:04 ` Nish Aravamudan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.