From: Andrew Morton <akpm@osdl.org>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-kernel@vger.kernel.org, ericy@cais.com, jesper.juhl@gmail.com
Subject: Re: [PATCH] binfmt_elf CodingStyle cleanup and remove some pointless casts
Date: Sun, 23 Apr 2006 14:26:48 -0700 [thread overview]
Message-ID: <20060423142648.6ef34b9f.akpm@osdl.org> (raw)
In-Reply-To: <200604231858.15646.jesper.juhl@gmail.com>
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)
next prev parent reply other threads:[~2006-04-23 21:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-23 16:58 [PATCH] binfmt_elf CodingStyle cleanup and remove some pointless casts Jesper Juhl
2006-04-23 21:26 ` Andrew Morton [this message]
2006-04-24 7:15 ` Jesper Juhl
2006-04-24 17:32 ` Jesper Juhl
2006-04-24 20:32 ` Andrew Morton
2006-04-24 21:51 ` Jesper Juhl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060423142648.6ef34b9f.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ericy@cais.com \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox