From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH -tip v8 5/7] x86: add pt_regs register and stack access APIs Date: Tue, 2 Jun 2009 01:40:06 +0200 Message-ID: <20090601234006.GA12629@elte.hu> References: <20090529000326.17532.70868.stgit@localhost.localdomain> <20090529000347.17532.34038.stgit@localhost.localdomain> <20090530081303.GB15755@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20090530081303.GB15755@infradead.org> Sender: kvm-owner@vger.kernel.org To: Christoph Hellwig Cc: Masami Hiramatsu , Steven Rostedt , lkml , systemtap , kvm , DLE , Ananth N Mavinakayanahalli , Frederic Weisbecker , Roland McGrath , linux-arch@vger.kernel.org List-Id: linux-arch.vger.kernel.org * Christoph Hellwig wrote: > > + if (n < NR_REGPARMS) { > > + switch (n) { > > + case 0: return regs->ax; > > + case 1: return regs->dx; > > + case 2: return regs->cx; > > + } > > Normal kernel style would be > > switch (n) { > case 0: > return regs->ax; > case 1: > return regs->dx; > case 2: > return regs->cx; > } the original single-line shortcut is acceptable too. Ingo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3.mail.elte.hu ([157.181.1.138]:35347 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbZFAXkj (ORCPT ); Mon, 1 Jun 2009 19:40:39 -0400 Date: Tue, 2 Jun 2009 01:40:06 +0200 From: Ingo Molnar Subject: Re: [PATCH -tip v8 5/7] x86: add pt_regs register and stack access APIs Message-ID: <20090601234006.GA12629@elte.hu> References: <20090529000326.17532.70868.stgit@localhost.localdomain> <20090529000347.17532.34038.stgit@localhost.localdomain> <20090530081303.GB15755@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090530081303.GB15755@infradead.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Christoph Hellwig Cc: Masami Hiramatsu , Steven Rostedt , lkml , systemtap , kvm , DLE , Ananth N Mavinakayanahalli , Frederic Weisbecker , Roland McGrath , linux-arch@vger.kernel.org Message-ID: <20090601234006.-VRR0jAt0iYj1jfap9CEhVQVMfNWGeIP_DnMV2jalT0@z> * Christoph Hellwig wrote: > > + if (n < NR_REGPARMS) { > > + switch (n) { > > + case 0: return regs->ax; > > + case 1: return regs->dx; > > + case 2: return regs->cx; > > + } > > Normal kernel style would be > > switch (n) { > case 0: > return regs->ax; > case 1: > return regs->dx; > case 2: > return regs->cx; > } the original single-line shortcut is acceptable too. Ingo