Re: [GIT PATCH] HID and USB HID update for 2.6.21-rc2





On Wed, 28 Feb 2007, Jiri Kosina wrote:

You're right that usbhid.h is not a best place for it.

"Not the best place for it" is the understatement of the year.

It's totally idiotic.

This IMHO just needs cleanup. Will you accept creating a separate header
file solely for purposes of this blacklist and related defines?

*NO*.

Dammit, we don't put static initializers in header files. We don't
duplicate the data in every single thing that includes a header file. If
you want to duplicate the data, you export it as a real data structure,
and you *still* put the data structure in a .c file.

Otherwise I will just drop this cleanup, but I still think that the
current situation is horrible.

WHAT CLEANUP? The thing is the anti-thesis of a "cleanup". There is no
excuse for putting a large array in a header file and including it
millions of times. Or even just twice. The point of a header file is to
*declare* things, not to have big data structures in.

Linus
-
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/



Relevant Pages

  • Two structures, bunch of programs.
    ... Let's say two programs use the same data structure. ... all the function prototypes and other structures in header files. ... Put the structure used by both programs it in a seperate header file, ... if it changes i wouldnt have to change it in 2 or more sources? ...
    (comp.unix.programmer)
  • coding style and re-inventing the wheel way too many times
    ... "cleanup" has turned out to be way more daunting than i originally ... generically useful macros into a separate header file, ... pointer to that header file from the CodingStyle file and strongly ... in any event, even *i* am not going to go near this kind of cleanup, ...
    (Linux-Kernel)
  • Re: [2.6 patch] kill include/linux/platform.h
    ... > The default_idleprototype should stay inside some header file. ... > Any suggestion where it should move to? ... so cleanup creates more ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [PATCH -tip] x86: headers - include linux/types.h instead of asm/types.h
    ... | only' kind of header file, so including it is not wrong per se. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH -tip] x86: headers - include linux/types.h instead of asm/types.h
    ... | only' kind of header file, so including it is not wrong per se. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)