lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <36ca99e90801200843p7f45ef6ay281b5e77848f6d32@mail.gmail.com>
Date:	Sun, 20 Jan 2008 17:43:40 +0100
From:	"Bert Wesarg" <bert.wesarg@...glemail.com>
To:	"Johannes Weiner" <hannes@...urebad.de>
Cc:	"Jan Engelhardt" <jengelh@...putergmbh.de>,
	"Rusty Russell" <rusty@...tcorp.com.au>,
	"Linus Torvalds" <torvalds@...ux-foundation.org>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, "Jeff Garzik" <jeff@...zik.org>,
	"Tejun Heo" <htejun@...il.com>
Subject: Re: [PATCH 2/6] typesafe: kthread_create and kthread_run

On Jan 20, 2008 5:24 PM, Johannes Weiner <hannes@...urebad.de> wrote:
> Hi,
>
> "Bert Wesarg" <bert.wesarg@...glemail.com> writes:
>
> > On Jan 20, 2008 12:25 PM, Jan Engelhardt <jengelh@...putergmbh.de> wrote:
> >>
> >> On Jan 20 2008 20:48, Rusty Russell wrote:
> >> >+ */
> >> >+#define kthread_create(threadfn, data, namefmt...) ({         \
> >> >+      int (*_threadfn)(typeof(data)) = (threadfn);            \
> >> >+      __kthread_create((void *)_threadfn, (data), namefmt);   \
> >> >+})
> >>
> >> If you have namefmt... you need that varagrs cpp trick. IIRC:
> >>
> >>         __kthread_create((void *)_threadfn, (data), namefmt, __VA_ARGS__);
> > almost
> >
> > either:
> >
> > #define kthread_create(threadfn, data, ...) ({         \
> >         __kthread_create((void *)_threadfn, (data), __VA_ARGS__);
> >
>
> No.  This is bad because it gives the impression that it takes only two
> essential arguments which is not the case.
Right, I just forget to mention this in a comment.
>
> > or:
> >
> > #define kthread_create(threadfn, data, namefmt, ...) ({         \
> >         __kthread_create((void *)_threadfn, (data), namefmt, ##__VA_ARGS__);
> >
>
> This is better.  I prefer naming the rest args instead of using __VA_ARGS__:
>
> #define kthread_create(threadfn, data, namefmt, fmtargs...) ({ \
>         ... \
>         __kthread_create((void *)_threadfn, (data), namefmt, ## fmtargs) \
> })
>
> but I think that is just a matter of taste.
No, it is a matter of conforming to C99 or to GNU extensions.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ