All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86: kvm: emulate.c: Fixed up all code-style ERRORs
@ 2010-07-26  5:55 Michael Jensen
  2010-07-26  5:59 ` Michael Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Jensen @ 2010-07-26  5:55 UTC (permalink / raw)
  To: avi; +Cc: mtosatti, tglx, x86, linux-kernel, Michael Jensen

Wrapped lines and fixed indentation throughout emulate.c, now
passes checkpatch.pl with no ERRORs.

Signed-off-by: Michael Jensen <emjay1988@gmail.com>
---
 arch/x86/kvm/emulate.c |   66 +++++++++++++++++++++++++++++-------------------
 1 files changed, 40 insertions(+), 26 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 5ac0bb4..2562ed8 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -457,29 +457,35 @@ static u32 group2_table[] = {
 
 
 /* Raw emulation: instruction has two explicit operands. */
-#define __emulate_2op_nobyte(_op,_src,_dst,_eflags,_wx,_wy,_lx,_ly,_qx,_qy) \
+#define __emulate_2op_nobyte(_op, _src, _dst, _eflags,			\
+			     _wx, _wy, _lx, _ly, _qx, _qy)		\
 	do {								\
 		unsigned long _tmp;					\
 									\
 		switch ((_dst).bytes) {					\
 		case 2:							\
-			____emulate_2op(_op,_src,_dst,_eflags,_wx,_wy,"w"); \
+			____emulate_2op(_op, _src, _dst,		\
+					_eflags, _wx, _wy, "w");	\
 			break;						\
 		case 4:							\
-			____emulate_2op(_op,_src,_dst,_eflags,_lx,_ly,"l"); \
+			____emulate_2op(_op, _src, _dst,		\
+					_eflags, _lx, _ly, "l");	\
 			break;						\
 		case 8:							\
-			ON64(____emulate_2op(_op,_src,_dst,_eflags,_qx,_qy,"q")); \
+			ON64(____emulate_2op(_op, _src, _dst,		\
+					     _eflags, _qx, _qy, "q"));	\
 			break;						\
 		}							\
 	} while (0)
 
-#define __emulate_2op(_op,_src,_dst,_eflags,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \
+#define __emulate_2op(_op, _src, _dst, _eflags,				     \
+		      _bx, _by, _wx, _wy, _lx, _ly, _qx, _qy)		     \
 	do {								     \
 		unsigned long _tmp;					     \
 		switch ((_dst).bytes) {				             \
 		case 1:							     \
-			____emulate_2op(_op,_src,_dst,_eflags,_bx,_by,"b");  \
+			____emulate_2op(_op, _src, _dst,		     \
+					_eflags, _bx, _by, "b");	     \
 			break;						     \
 		default:						     \
 			__emulate_2op_nobyte(_op, _src, _dst, _eflags,	     \
@@ -556,13 +562,21 @@ static u32 group2_table[] = {
 	} while (0)
 
 /* Instruction has only one explicit operand (no source operand). */
-#define emulate_1op(_op, _dst, _eflags)                                    \
+#define emulate_1op(_op, _dst, _eflags)                                 \
 	do {								\
 		switch ((_dst).bytes) {				        \
-		case 1:	__emulate_1op(_op, _dst, _eflags, "b"); break;	\
-		case 2:	__emulate_1op(_op, _dst, _eflags, "w"); break;	\
-		case 4:	__emulate_1op(_op, _dst, _eflags, "l"); break;	\
-		case 8:	ON64(__emulate_1op(_op, _dst, _eflags, "q")); break; \
+		case 1:							\
+			__emulate_1op(_op, _dst, _eflags, "b");		\
+			break;						\
+		case 2:							\
+			__emulate_1op(_op, _dst, _eflags, "w");		\
+			break;						\
+		case 4:							\
+			__emulate_1op(_op, _dst, _eflags, "l");		\
+			break;						\
+		case 8:							\
+			ON64(__emulate_1op(_op, _dst, _eflags, "q"));	\
+			break;						\
 		}							\
 	} while (0)
 
@@ -749,7 +763,7 @@ static int test_cc(unsigned int condition, unsigned int flags)
 	}
 
 	/* Odd condition identifiers (lsb == 1) have inverted sense. */
-	return (!!rc ^ (condition & 1));
+	return !!rc ^ (condition & 1);
 }
 
 static void decode_register_operand(struct operand *op,
@@ -1234,18 +1248,18 @@ done_prefixes:
 		c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes;
 		c->dst.ptr = &c->regs[VCPU_REGS_RAX];
 		switch (c->dst.bytes) {
-			case 1:
-				c->dst.val = *(u8 *)c->dst.ptr;
-				break;
-			case 2:
-				c->dst.val = *(u16 *)c->dst.ptr;
-				break;
-			case 4:
-				c->dst.val = *(u32 *)c->dst.ptr;
-				break;
-			case 8:
-				c->dst.val = *(u64 *)c->dst.ptr;
-				break;
+		case 1:
+			c->dst.val = *(u8 *)c->dst.ptr;
+			break;
+		case 2:
+			c->dst.val = *(u16 *)c->dst.ptr;
+			break;
+		case 4:
+			c->dst.val = *(u32 *)c->dst.ptr;
+			break;
+		case 8:
+			c->dst.val = *(u64 *)c->dst.ptr;
+			break;
 		}
 		c->dst.orig_val = c->dst.val;
 		break;
@@ -1306,7 +1320,7 @@ static void get_descriptor_table_ptr(struct x86_emulate_ctxt *ctxt,
 {
 	if (selector & 1 << 2) {
 		struct desc_struct desc;
-		memset (dt, 0, sizeof *dt);
+		memset(dt, 0, sizeof *dt);
 		if (!ops->get_cached_descriptor(&desc, VCPU_SREG_LDTR, ctxt->vcpu))
 			return;
 
@@ -1530,7 +1544,7 @@ static int emulate_popf(struct x86_emulate_ctxt *ctxt,
 	change_mask = EFLG_CF | EFLG_PF | EFLG_AF | EFLG_ZF | EFLG_SF | EFLG_OF
 		| EFLG_TF | EFLG_DF | EFLG_NT | EFLG_RF | EFLG_AC | EFLG_ID;
 
-	switch(ctxt->mode) {
+	switch (ctxt->mode) {
 	case X86EMUL_MODE_PROT64:
 	case X86EMUL_MODE_PROT32:
 	case X86EMUL_MODE_PROT16:
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] x86: kvm: emulate.c: Fixed up all code-style ERRORs
  2010-07-26  5:55 [PATCH 1/2] x86: kvm: emulate.c: Fixed up all code-style ERRORs Michael Jensen
@ 2010-07-26  5:59 ` Michael Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Jensen @ 2010-07-26  5:59 UTC (permalink / raw)
  To: avi; +Cc: mtosatti, tglx, x86, linux-kernel, Michael Jensen

There is no PATCH 2/2, it was merged in to this patch, but I missed
the subject line
when merging.

Patch 2 removed spaces before a tab.

On Mon, Jul 26, 2010 at 3:55 PM, Michael Jensen <emjay1988@gmail.com> wrote:
> Wrapped lines and fixed indentation throughout emulate.c, now
> passes checkpatch.pl with no ERRORs.
>
> Signed-off-by: Michael Jensen <emjay1988@gmail.com>
> ---
>  arch/x86/kvm/emulate.c |   66 +++++++++++++++++++++++++++++-------------------
>  1 files changed, 40 insertions(+), 26 deletions(-)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 5ac0bb4..2562ed8 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -457,29 +457,35 @@ static u32 group2_table[] = {
>
>
>  /* Raw emulation: instruction has two explicit operands. */
> -#define __emulate_2op_nobyte(_op,_src,_dst,_eflags,_wx,_wy,_lx,_ly,_qx,_qy) \
> +#define __emulate_2op_nobyte(_op, _src, _dst, _eflags,                 \
> +                            _wx, _wy, _lx, _ly, _qx, _qy)              \
>        do {                                                            \
>                unsigned long _tmp;                                     \
>                                                                        \
>                switch ((_dst).bytes) {                                 \
>                case 2:                                                 \
> -                       ____emulate_2op(_op,_src,_dst,_eflags,_wx,_wy,"w"); \
> +                       ____emulate_2op(_op, _src, _dst,                \
> +                                       _eflags, _wx, _wy, "w");        \
>                        break;                                          \
>                case 4:                                                 \
> -                       ____emulate_2op(_op,_src,_dst,_eflags,_lx,_ly,"l"); \
> +                       ____emulate_2op(_op, _src, _dst,                \
> +                                       _eflags, _lx, _ly, "l");        \
>                        break;                                          \
>                case 8:                                                 \
> -                       ON64(____emulate_2op(_op,_src,_dst,_eflags,_qx,_qy,"q")); \
> +                       ON64(____emulate_2op(_op, _src, _dst,           \
> +                                            _eflags, _qx, _qy, "q"));  \
>                        break;                                          \
>                }                                                       \
>        } while (0)
>
> -#define __emulate_2op(_op,_src,_dst,_eflags,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \
> +#define __emulate_2op(_op, _src, _dst, _eflags,                                     \
> +                     _bx, _by, _wx, _wy, _lx, _ly, _qx, _qy)                \
>        do {                                                                 \
>                unsigned long _tmp;                                          \
>                switch ((_dst).bytes) {                                      \
>                case 1:                                                      \
> -                       ____emulate_2op(_op,_src,_dst,_eflags,_bx,_by,"b");  \
> +                       ____emulate_2op(_op, _src, _dst,                     \
> +                                       _eflags, _bx, _by, "b");             \
>                        break;                                               \
>                default:                                                     \
>                        __emulate_2op_nobyte(_op, _src, _dst, _eflags,       \
> @@ -556,13 +562,21 @@ static u32 group2_table[] = {
>        } while (0)
>
>  /* Instruction has only one explicit operand (no source operand). */
> -#define emulate_1op(_op, _dst, _eflags)                                    \
> +#define emulate_1op(_op, _dst, _eflags)                                 \
>        do {                                                            \
>                switch ((_dst).bytes) {                                 \
> -               case 1: __emulate_1op(_op, _dst, _eflags, "b"); break;  \
> -               case 2: __emulate_1op(_op, _dst, _eflags, "w"); break;  \
> -               case 4: __emulate_1op(_op, _dst, _eflags, "l"); break;  \
> -               case 8: ON64(__emulate_1op(_op, _dst, _eflags, "q")); break; \
> +               case 1:                                                 \
> +                       __emulate_1op(_op, _dst, _eflags, "b");         \
> +                       break;                                          \
> +               case 2:                                                 \
> +                       __emulate_1op(_op, _dst, _eflags, "w");         \
> +                       break;                                          \
> +               case 4:                                                 \
> +                       __emulate_1op(_op, _dst, _eflags, "l");         \
> +                       break;                                          \
> +               case 8:                                                 \
> +                       ON64(__emulate_1op(_op, _dst, _eflags, "q"));   \
> +                       break;                                          \
>                }                                                       \
>        } while (0)
>
> @@ -749,7 +763,7 @@ static int test_cc(unsigned int condition, unsigned int flags)
>        }
>
>        /* Odd condition identifiers (lsb == 1) have inverted sense. */
> -       return (!!rc ^ (condition & 1));
> +       return !!rc ^ (condition & 1);
>  }
>
>  static void decode_register_operand(struct operand *op,
> @@ -1234,18 +1248,18 @@ done_prefixes:
>                c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes;
>                c->dst.ptr = &c->regs[VCPU_REGS_RAX];
>                switch (c->dst.bytes) {
> -                       case 1:
> -                               c->dst.val = *(u8 *)c->dst.ptr;
> -                               break;
> -                       case 2:
> -                               c->dst.val = *(u16 *)c->dst.ptr;
> -                               break;
> -                       case 4:
> -                               c->dst.val = *(u32 *)c->dst.ptr;
> -                               break;
> -                       case 8:
> -                               c->dst.val = *(u64 *)c->dst.ptr;
> -                               break;
> +               case 1:
> +                       c->dst.val = *(u8 *)c->dst.ptr;
> +                       break;
> +               case 2:
> +                       c->dst.val = *(u16 *)c->dst.ptr;
> +                       break;
> +               case 4:
> +                       c->dst.val = *(u32 *)c->dst.ptr;
> +                       break;
> +               case 8:
> +                       c->dst.val = *(u64 *)c->dst.ptr;
> +                       break;
>                }
>                c->dst.orig_val = c->dst.val;
>                break;
> @@ -1306,7 +1320,7 @@ static void get_descriptor_table_ptr(struct x86_emulate_ctxt *ctxt,
>  {
>        if (selector & 1 << 2) {
>                struct desc_struct desc;
> -               memset (dt, 0, sizeof *dt);
> +               memset(dt, 0, sizeof *dt);
>                if (!ops->get_cached_descriptor(&desc, VCPU_SREG_LDTR, ctxt->vcpu))
>                        return;
>
> @@ -1530,7 +1544,7 @@ static int emulate_popf(struct x86_emulate_ctxt *ctxt,
>        change_mask = EFLG_CF | EFLG_PF | EFLG_AF | EFLG_ZF | EFLG_SF | EFLG_OF
>                | EFLG_TF | EFLG_DF | EFLG_NT | EFLG_RF | EFLG_AC | EFLG_ID;
>
> -       switch(ctxt->mode) {
> +       switch (ctxt->mode) {
>        case X86EMUL_MODE_PROT64:
>        case X86EMUL_MODE_PROT32:
>        case X86EMUL_MODE_PROT16:
> --
> 1.7.0.4
>
>



-- 
Regards,

Michael Jensen
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-26  5:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26  5:55 [PATCH 1/2] x86: kvm: emulate.c: Fixed up all code-style ERRORs Michael Jensen
2010-07-26  5:59 ` Michael Jensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.