Re: Question regarding header-files for general definitions.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(side note, mark:  if i respond to the newbies list, please don't drop
that as one of the recipients so that you end up replying to only me.)

On Sun, 17 Feb 2008, Mark Pearson wrote:

>
> >> As this change will affect a number of sub-modules (e.g.
> >> ./scripts/mod ./drivers/serial ./arch/mips ./include, etc.), I
> >> wanted to ask where general macro definition are made in the Linux
> >> environment.
> >
> > again, that's in kernel.h, and that macro already exists, there is
> > no need to invent it again.
> >
> I've seen the definition in kernel.h, but to include that
> definition, the modules have to define __KERNEL__

you seem to have an unusual definition of the word "module".  there's
no need for you to be messing around under scripts/ -- that's not
kernel code, so leave it alone.  you should be concerned only about
actual kernel code.

> Correct me if I'm wrong here, but as these modules aren't kernel
> modules, then they won't have defined the __KERNEL__ switch.

again, you don't seem to understand the difference between kernel code
and utility code.  leave the utility code alone.

> Files such as ./scripts/mod/modpost.c don't define the switch
> __KERNEL__ and I'm sure its a bad idea to add that to those files.
> Therefore, if I attempt to include kernel.h into modpost.c (for
> example), then I it won't have any affect, as the kernel.h file's
> definitions (incl. ARRAY_SIZE) are protected by the #if __KERNEL__
> switch.

correct.  stay out of the scripts directory, and stay away from
non-kernel boot code.  the rest is fair game.  but given your
confusion about what is and isn't kernel code, you might be better off
just doing some more studying before trying to submit any patches.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux