unneeded #include <version.h> in many places ?

From: Krzysztof Halasa (khc_at_pm.waw.pl)
Date: 09/07/04

  • Next message: Ryan Anderson: "cpqarray drive array management"
    To: <linux-kernel@vger.kernel.org>
    Date:	Tue, 07 Sep 2004 18:17:53 +0200
    
    

    Hi,

    I noticed some kernel .c files #include <version.h> which typically
    contains something like:

    #define UTS_RELEASE "2.6.9-rc1"
    #define LINUX_VERSION_CODE 132617
    #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

    However, those files don't reference the macros.

    The question is: are these includes completely unneeded, so I can
    remove them, or do they serve some special purpose?

    Another one: there are drivers using constructs like:

    #if LINUX_VERSION_CODE > 0x20115
    ...
    #endif

    I understand they can be somehow useful for authors supporting many
    kernel versions with a single set of files, however the gain isn't
    clear to me. Should such conditional code be a) removed, b) left
    in place, c) dealt with each case individually?

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

  • Next message: Ryan Anderson: "cpqarray drive array management"

    Relevant Pages

    • Re: How to make custom linked cross-references?
      ... two macros \extractrefnum and \extractpagerefnum. ... If somebody wants the package on CTAN, ... A reference to section~of this book ... You might wish to take reference to yet another label within ...
      (comp.text.tex)
    • Re: VBA to remove modules in .DOT
      ... The macros remain in the .DOT with a reference back to the template. ... >>> Sub DeleteProcedure() ...
      (microsoft.public.word.vba.beginners)
    • PATCH, RFC: Version 5 of 2.6 Codingstyle
      ... have a reference count on it, you almost certainly have a bug. ... inline functions are preferable to macros resembling functions. ... -must enclose the expression in parentheses. ... +gcc internals and indent, all available from www.gnu.org. ...
      (Linux-Kernel)
    • Re: uppercase + ef = undefined reference
      ... this can cause errors in the headers/section titles/ToC. ... temporary macros in the right places in order to ... This reference to is OK. ... The second possibility is saving stuff like label-names away ...
      (comp.text.tex)
    • Re: [PATCH] mask ADT: new mask.h file [2/22]
      ... > or so macros are less commonly used. ... burden of using existing infrastructure. ... I don't even want to learn 28 bitops primitives. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)