Re: [PATCH] binfmt_elf CodingStyle cleanup and remove some pointless casts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jesper Juhl <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux