login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
December
»
27
Re: [PATCH 1/3] arch/x86: Use offsetof
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
H. Peter Anvin <hpa@...>
To: Pavel Machek <pavel@...>
Cc: Julia Lawall <julia@...>, <tglx@...>, <viro@...>, <linux-kernel@...>, <kernel-janitors@...>
Subject:
Re: [PATCH 1/3] arch/x86: Use offsetof
Date: Wednesday, December 26, 2007 - 9:01 pm
Pavel Machek wrote:
quoted text
>> >> 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.000000000 +0200 >> +++ b/arch/x86/kernel/vm86_32.c 2007-12-26 16:27:15.000000000 +0100 >> @@ -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 kernel_vm86_struct, regs32) - >> + offsetof(struct kernel_vm86_struct, vm86plus)); > > I do not think this makes it more readable... (int) -> (char *) would > make it portable and readable, AFAICT. > Pavel
The right way to do it is: memset(&info.vm86plus, 0, sizeof info.vm86plus); -hpa --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/3] arch/x86: Use offsetof
, Julia Lawall
, (Wed Dec 26, 12:13 pm)
Re: [PATCH 1/3] arch/x86: Use offsetof
, Pavel Machek
, (Wed Dec 26, 3:47 pm)
Re: [PATCH 1/3] arch/x86: Use offsetof
, H. Peter Anvin
, (Wed Dec 26, 9:01 pm)
Re: [PATCH 1/3] arch/x86: Use offsetof
, Jan Engelhardt
, (Wed Dec 26, 9:44 pm)
Re: [PATCH 1/3] arch/x86: Use offsetof
, H. Peter Anvin
, (Wed Dec 26, 9:49 pm)
Re: [PATCH 1/3] arch/x86: Use offsetof
, Al Viro
, (Wed Dec 26, 9:17 pm)
Re: [PATCH 1/3] arch/x86: Use offsetof
, H. Peter Anvin
, (Wed Dec 26, 9:21 pm)
Re: [PATCH 1/3] arch/x86: Use offsetof
, Ingo Molnar
, (Sun Dec 30, 9:54 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
Linus Torvalds
Linux 2.6.21-rc1
Tarkan Erimer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
pageexec
Re: [stable] Linux 2.6.25.10
linux-netdev
:
Linus Torvalds
Re: [GIT]: Networking
Gerrit Renker
[PATCH 15/37] dccp: Set per-connection CCIDs via socket options
Natalie Protasevich
[BUG] New Kernel Bugs
Jarek Poplawski
[PATCH take 2] pkt_sched: Protect gen estimators under est_lock.
git
:
openmoko-community
:
Colocation donated by:
Who's online
There are currently
7 users
and
815 guests
online.
Online users
naturalskincre
tnavigator
cordic
zeekec
lithoniachirop
mortgagerefico
consignmentqms
Syndicate