[Cbe-oss-dev] PATCH 19/21] powerpc: Merge creation of signal frame (#2)
Benjamin Herrenschmidt
benh at kernel.crashing.org
Mon Jun 4 20:04:53 EST 2007
On Mon, 2007-06-04 at 10:01 +0200, Christoph Hellwig wrote:
> On Mon, Jun 04, 2007 at 05:22:48PM +1000, Benjamin Herrenschmidt wrote:
> > +/*
> > + * Allocate space for the signal frame
> > + */
> > +void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
> > + size_t frame_size)
>
> little style nitpick: no whitespace after the *, please.
Heh... just copy pasted what was there :-) I'll rip it out for the next
round :-)
> > +{
> > + unsigned long oldsp, newsp;
> > +
> > + /* Default to using normal stack */
> > + oldsp = regs->gpr[1];
> > +
> > + /* Check for alt stack */
> > + if ((ka->sa.sa_flags & SA_ONSTACK) &&
> > + current->sas_ss_size && !on_sig_stack(oldsp))
> > + oldsp = (current->sas_ss_sp + current->sas_ss_size);
> > +
> > + /* Get aligned frame */
> > + newsp = (oldsp - frame_size) & ~0xFUL;
> > +
> > + /* Check access */
> > + if (!access_ok(VERIFY_WRITE, (void __user *)newsp, oldsp - newsp))
> > + return NULL;
> > +
> > + return (void __user *)newsp;
> > +}
>
> The body also has some odd whitespace problems. I'd also make
> newsp a void __user variable to only do the cast once. In the end the
> function should looks something like:
Makes sense.
Thanks,
Ben.
More information about the cbe-oss-dev
mailing list