Re: strings and command line args

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

 



On Fri, Jul 12, 2002 at 10:43:26AM -0700, Peter Jay Salzman wrote:

>    /* Indirect stringification.  */
> #define __MODULE_STRING_1(x)  #x
> #define __MODULE_STRING(x) __MODULE_STRING_1(x)

stringification is a neat cpp hack for creating string literals at
compile time. Googling on "stringification" or reading your nearest C
book on # operator in cpp should provide a better explanation than I
could do

> also, i'm not understanding the 2nd argument of MODULE_PARM.  i'd be
> happier with:
> 
>    MODULE_PARM(mac, "s");
> 
> there are two other items: "1-" and __MODULE_STRING(NS_MAX_CARDS).  they
> belong to the 2nd argument, which identifies the type of the command
> line argument.  i would've thought that would simply be "s" for a
> string.  what do the two other items do?

It means that there's an array of parameters, not just one. See the
MODULE_PARM docs.

I guess a kernel janitory sort of thing is to use stringify present in
/usr/src/linux/include/linux/stringify.h and remove the duplicate
__MODULE_STRING code

regards
john

-- 
"Be sure of this, O young ambition, all mortal greatness is but disease." 
	- Hermann Melville
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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