From: Ingo Molnar <mingo@elte.hu>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Pavel Machek <pavel@ucw.cz>,
Julia Lawall <julia@diku.dk>,
tglx@linutronix.de, viro@ftp.linux.org.uk,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/3] arch/x86: Use offsetof
Date: Sun, 30 Dec 2007 14:54:58 +0100 [thread overview]
Message-ID: <20071230135458.GB21106@elte.hu> (raw)
In-Reply-To: <4772FE1E.3040401@zytor.com>
* H. Peter Anvin <hpa@zytor.com> 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 {
> struct kernel_vm86_regs regs;
> #define VM86_TSS_ESP0 flags
> unsigned long flags;
> unsigned long screen_bitmap;
> unsigned long cpu_type;
> struct revectored_struct int_revectored;
> struct revectored_struct int21_revectored;
> struct vm86plus_info_struct vm86plus;
> struct pt_regs *regs32;
> };
hm, i'm wondering why it was done in such a complex way. Clearing a
struct field is always done via sizeof. Maybe we lost some alignment
assumption somewhere along the line?
Ingo
next prev parent reply other threads:[~2007-12-30 13:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-26 16:13 Julia Lawall
2007-12-26 19:47 ` Pavel Machek
2007-12-27 1:01 ` H. Peter Anvin
2007-12-27 1:17 ` Al Viro
2007-12-27 1:21 ` H. Peter Anvin
2007-12-30 13:54 ` Ingo Molnar [this message]
2007-12-27 1:44 ` Jan Engelhardt
2007-12-27 1:49 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071230135458.GB21106@elte.hu \
--to=mingo@elte.hu \
--cc=hpa@zytor.com \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=tglx@linutronix.de \
--cc=viro@ZenIV.linux.org.uk \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®