"__setup(arg, fn)" versus "__setup(arg=, fn)"

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

 



  i can see (trivially) the difference between the two calls to
register boot-time parameters

  __setup(arg, fn);
  __setup(arg=, fn)

but it doesn't appear that there's any (official) sanity checking for
those parameters after that.  for instance, just grabbing an example
at random:

...
static int __init adb_probe_sync_enable (char *str) {
        extern int __adb_probe_sync;
        __adb_probe_sync = 1;
        return 1;
}

__setup("adb_sync", adb_probe_sync_enable);
...

  obviously, that boot-time parm is not meant to be assigned a value,
and yet the function itself still accepts a "char*" as a parameter
type (it just won't try to do anything with it of course).

  so, while i haven't noticed it yet, is there any validity checking
to distinguish between these two cases?  just curious.

rday

p.s.  suddenly, i'm curious if there are any examples of these
functions that erroneously reference the char* parameter when they're
not supposed to.  again, just my innate curiosity.

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

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