lkml.org 
[lkml]   [2012]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/4] [RFC] syscalls, x86: Add __NR_kcmp syscall v4
On Tue, 24 Jan 2012 13:46:31 -0800
"H. Peter Anvin" <hpa@zytor.com> wrote:

> On 01/24/2012 01:45 PM, Andrew Morton wrote:
> > On Tue, 24 Jan 2012 13:22:22 -0800
> > Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> >> static int kcmp_task_pointers(void *task1, void *task2, size_t field_offset,
> >> enum you_forgot_to_name_the_enum type)
> >> {
> >> void **field1 = t1 + field_offset; /* points to a pointer in the task_struct */
> >> void **field2 = t1 + field_offset;
> >
> > On reflection, this was being too cute. It would be better to make the
> > function type-safer and just put up with the local typecasts:
> >
> > static int kcmp_task_pointers(struct task_struct *task1,
> > struct task_struct *task2, size_t field_offset,
> > enum you_forgot_to_name_the_enum type)
> > {
> > void **field1 = (void *)t1 + field_offset;
> > void **field2 = (void *)t2 + field_offset;
> >
>
> Arithmetic on void pointers?
>

All the world is gcc!


\
 
 \ /
  Last update: 2012-01-24 23:03    [from the cache]
©2003-2011 Jasper Spaans