lkml.org 
[lkml]   [2006]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] binfmt_elf CodingStyle cleanup and remove some pointless casts
Jesper Juhl <jesper.juhl@gmail.com> wrote:
>
> Here's a patch that does a CodingStyle cleanup of fs/binfmt_elf.c and also
> removes some pointless casts of kmalloc() return values in the same file.
>

Much-needed.

> - NEW_AUX_ENT(AT_PHENT, sizeof (struct elf_phdr));
> + NEW_AUX_ENT(AT_PHENT, sizeof(struct elf_phdr));
> NEW_AUX_ENT(AT_PHNUM, exec->e_phnum);
> NEW_AUX_ENT(AT_BASE, interp_load_addr);
> NEW_AUX_ENT(AT_FLAGS, 0);
> NEW_AUX_ENT(AT_ENTRY, exec->e_entry);
> - NEW_AUX_ENT(AT_UID, (elf_addr_t) tsk->uid);
> - NEW_AUX_ENT(AT_EUID, (elf_addr_t) tsk->euid);
> - NEW_AUX_ENT(AT_GID, (elf_addr_t) tsk->gid);
> - NEW_AUX_ENT(AT_EGID, (elf_addr_t) tsk->egid);
> - NEW_AUX_ENT(AT_SECURE, (elf_addr_t) security_bprm_secureexec(bprm));
> + NEW_AUX_ENT(AT_UID, (elf_addr_t)tsk->uid);
> + NEW_AUX_ENT(AT_EUID, (elf_addr_t)tsk->euid);
> + NEW_AUX_ENT(AT_GID, (elf_addr_t)tsk->gid);
> + NEW_AUX_ENT(AT_EGID, (elf_addr_t)tsk->egid);
> + NEW_AUX_ENT(AT_SECURE, (elf_addr_t)security_bprm_secureexec(bprm));

The typecasting for NEW_AUX_ENT is random, ugly, irrational and
undesirable. It's always u32 or unsigned long. Perhaps as a followup
patch you could look at removing the unneeded casts? (hopefully that'll
be all of them)

-
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: 2006-04-23 23:30    [W:0.063 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site