lkml.org 
[lkml]   [2001]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.5.1-pre10 #ifdef CONFIG_KMOD Cleanup Part II.
On Thu, 13 Dec 2001, Rusty Russell wrote:

> 2) Adds request_module_start()/request_module_end() macros, eg.
>
> struct protocol protoptr;
>
> request_module_start("proto-%u", protonum) {
> /* search for protocol, set protoptr. */
>
> } request_module_end(protoptr != NULL);
>
> This loops once if !CONFIG_KMOD or protoptr != NULL after first
> iteration, otherwise calls request_module and loops a second time.

Clever, but very un-C-like. Perhaps something like this:

do {
/* search for protocol, set protoptr. */
} while (protoptr != NULL || request_module("proto-%u",protonum)==0);

..with request_module returning -EBUSY if the module is already loaded.

> 3) Adds a request_module_unless() macro, eg:
>
> protoptr = request_module_unless(protoptrs[proto],
> "proto-%u", protonum);

Also weird.

--
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."


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

\
 
 \ /
  Last update: 2005-03-22 13:14    [W:0.058 / U:1.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site