Re: [PATCH v6 05/10] crc32-misc-cleanup.diff

From: Andrew Morton
Date: Fri Sep 02 2011 - 19:50:58 EST


On Wed, 31 Aug 2011 17:30:12 -0500
Bob Pearson <rpearson@xxxxxxxxxxxxxxxxxxxxx> wrote:

> Misc cleanup of lib/crc32.c and related files
> - removed unnecessary header files.
> - straightened out some convoluted ifdef's
> - rewrote some references to 2 dimensional arrays as 1 dimensional
> arrays to make them correct. I.e. replaced tab[i] with tab[0][i].
> - a few trivial whitespace changes
> - fixed a warning in gen_crc32tables.c caused by a mismatch in the
> type of the pointer passed to output table. Since the table is
> only used at kernel compile time, it is simpler to make the table
> big enough to hold the largest column size used. One cannot make the
> column size smaller in output_table because it has to be used by
> both the le and be tables and they can have different column sizes.
>
> ...
>
> --- for-next.orig/lib/crc32.c
> +++ for-next/lib/crc32.c
> @@ -23,13 +23,10 @@
> /* see: Documentation/crc32.txt for a description of algorithms */
>
> #include <linux/crc32.h>
> -#include <linux/kernel.h>
> #include <linux/module.h>
> -#include <linux/compiler.h>
> #include <linux/types.h>
> -#include <linux/init.h>
> -#include <asm/atomic.h>
> #include "crc32defs.h"

I don't like this bit much. Surely there's _something_ in here which
needs kernel.h, and crc32_init() is marked __init so init.h is
certainly needed.

Sure, these these things may be accidentally dragged in via nested
includes but it's bad to depend upon that - such things regularly cause
breakage when configs are changed.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/