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

Bob Pearson
2011-09-06T16:05:10Z

> -----Original Message-----
> From: Andrew Morton [mailto:akpm@linux-foundation.org]
> Sent: Friday, September 02, 2011 6:51 PM
> To: Bob Pearson
> Cc: linux-kernel@vger.kernel.org; fzago@systemfabricworks.com; Joakim
> Tjernlund; George Spelvin
> Subject: Re: [PATCH v6 05/10] crc32-misc-cleanup.diff
>
> On Wed, 31 Aug 2011 17:30:12 -0500
> Bob Pearson <rpearson@systemfabricworks.com> 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.

I tried to copy the usage in other drivers. Happy to oblige.

>