lkml.org 
[lkml]   [2005]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Unify sys_tkill() and sys_tgkill()
On 9/24/05, Vadim Lobanov <vlobanov@speakeasy.net> wrote:
> Hi,
>
> The majority of the sys_tkill() and sys_tgkill() function code is
> duplicated between the two of them. This patch pulls the duplication out
> into a separate function -- do_tkill() -- and lets sys_tkill() and
> sys_tgkill() be simple wrappers around it. This should make it easier to
> maintain in light of future changes.
>

A few nitpicks ... :

[snip]
> +static int do_tkill(int tgid, int pid, int sig)

I would probably have made this

static inline int do_tkill(int tgid, int pid, int sig)


[snip]
> + if (p && ((tgid <= 0) || (p->tgid == tgid))) {

Why all the extra parenthesis?

if (p && (tgid <= 0 || p->tgid == tgid)) {


[snip]
> + return (do_tkill(tgid, pid, sig));

return is not a function

return do_tkill(tgid, pid, sig);

[snip]
> + return (do_tkill(0, pid, sig));

again, get rid of the pointless extra parens

return do_tkill(0, pid, sig);


--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
-
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-09-24 16:56    [W:0.307 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site