Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-30 Thread Ingo Molnar
* H. Peter Anvin <[EMAIL PROTECTED]> wrote: >>> The right way to do it is: >>> >>> memset(, 0, sizeof info.vm86plus); >> >> If it's just one field _and_ we don't have padding we want to zero out - >> certainly... > > It is - [comments removed for clarity]: > > struct kernel_vm86_struct { >

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-30 Thread Ingo Molnar
* H. Peter Anvin [EMAIL PROTECTED] wrote: The right way to do it is: memset(info.vm86plus, 0, sizeof info.vm86plus); If it's just one field _and_ we don't have padding we want to zero out - certainly... It is - [comments removed for clarity]: struct kernel_vm86_struct {

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread H. Peter Anvin
Jan Engelhardt wrote: On Dec 26 2007 17:01, H. Peter Anvin wrote: @@ -215,7 +215,9 @@ asmlinkage int sys_vm86old(struct pt_reg ret = -EFAULT; if (tmp) goto out; - memset(, 0, (int) - (int)); + memset(, 0, + offsetof(struct kernel_vm86_struct, regs32)

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread Jan Engelhardt
On Dec 26 2007 17:01, H. Peter Anvin wrote: >> > @@ -215,7 +215,9 @@ asmlinkage int sys_vm86old(struct pt_reg >> > ret = -EFAULT; >> > if (tmp) >> >goto out; >> > - memset(, 0, (int) - (int)); >> > + memset(, 0, >> > + offsetof(struct kernel_vm86_struct, regs32) - >> > +

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread H. Peter Anvin
Al Viro wrote: On Wed, Dec 26, 2007 at 05:01:38PM -0800, H. Peter Anvin wrote: The right way to do it is: memset(, 0, sizeof info.vm86plus); If it's just one field _and_ we don't have padding we want to zero out - certainly... It is - [comments removed for clarity]: struct

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread Al Viro
On Wed, Dec 26, 2007 at 05:01:38PM -0800, H. Peter Anvin wrote: > The right way to do it is: > > memset(, 0, sizeof info.vm86plus); If it's just one field _and_ we don't have padding we want to zero out - certainly... -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread H. Peter Anvin
Pavel Machek wrote: diff -u -p a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c --- a/arch/x86/kernel/vm86_32.c 2007-10-22 11:25:00.0 +0200 +++ b/arch/x86/kernel/vm86_32.c 2007-12-26 16:27:15.0 +0100 @@ -215,7 +215,9 @@ asmlinkage int sys_vm86old(struct pt_reg ret

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread Pavel Machek
Hi! > From: Julia Lawall <[EMAIL PROTECTED]> > > In the patch cc154ac64aa8d3396b187f64cef01ce67f433324, Al Viro observed > that the proper way to compute the distance between two structure fields is > to use offsetof() or a cast to a pointer to character. The same change can > be applied to a

[PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> In the patch cc154ac64aa8d3396b187f64cef01ce67f433324, Al Viro observed that the proper way to compute the distance between two structure fields is to use offsetof() or a cast to a pointer to character. The same change can be applied to a few more files.

[PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread Julia Lawall
From: Julia Lawall [EMAIL PROTECTED] In the patch cc154ac64aa8d3396b187f64cef01ce67f433324, Al Viro observed that the proper way to compute the distance between two structure fields is to use offsetof() or a cast to a pointer to character. The same change can be applied to a few more files. The

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread Pavel Machek
Hi! From: Julia Lawall [EMAIL PROTECTED] In the patch cc154ac64aa8d3396b187f64cef01ce67f433324, Al Viro observed that the proper way to compute the distance between two structure fields is to use offsetof() or a cast to a pointer to character. The same change can be applied to a few more

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread H. Peter Anvin
Pavel Machek wrote: diff -u -p a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c --- a/arch/x86/kernel/vm86_32.c 2007-10-22 11:25:00.0 +0200 +++ b/arch/x86/kernel/vm86_32.c 2007-12-26 16:27:15.0 +0100 @@ -215,7 +215,9 @@ asmlinkage int sys_vm86old(struct pt_reg ret

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread Al Viro
On Wed, Dec 26, 2007 at 05:01:38PM -0800, H. Peter Anvin wrote: The right way to do it is: memset(info.vm86plus, 0, sizeof info.vm86plus); If it's just one field _and_ we don't have padding we want to zero out - certainly... -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread H. Peter Anvin
Al Viro wrote: On Wed, Dec 26, 2007 at 05:01:38PM -0800, H. Peter Anvin wrote: The right way to do it is: memset(info.vm86plus, 0, sizeof info.vm86plus); If it's just one field _and_ we don't have padding we want to zero out - certainly... It is - [comments removed for clarity]:

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread Jan Engelhardt
On Dec 26 2007 17:01, H. Peter Anvin wrote: @@ -215,7 +215,9 @@ asmlinkage int sys_vm86old(struct pt_reg ret = -EFAULT; if (tmp) goto out; - memset(info.vm86plus, 0, (int)info.regs32 - (int)info.vm86plus); + memset(info.vm86plus, 0, + offsetof(struct

Re: [PATCH 1/3] arch/x86: Use offsetof

2007-12-26 Thread H. Peter Anvin
Jan Engelhardt wrote: On Dec 26 2007 17:01, H. Peter Anvin wrote: @@ -215,7 +215,9 @@ asmlinkage int sys_vm86old(struct pt_reg ret = -EFAULT; if (tmp) goto out; - memset(info.vm86plus, 0, (int)info.regs32 - (int)info.vm86plus); + memset(info.vm86plus, 0, +