Re: [Xen-devel] [PATCH 3/4] x86emul: drop pointless and add useful default cases

2016-06-23 Thread Jan Beulich
>>> On 23.06.16 at 12:44, wrote: > On 20/06/16 12:58, Jan Beulich wrote: >> @@ -3845,10 +3834,11 @@ x86_emulate( >> goto push; >> case 7: >> generate_exception_if(1, EXC_UD, -1); >> -default: >> -goto cannot_emulate; >> } >>

Re: [Xen-devel] [PATCH 3/4] x86emul: drop pointless and add useful default cases

2016-06-23 Thread Andrew Cooper
On 20/06/16 12:58, Jan Beulich wrote: > @@ -3845,10 +3834,11 @@ x86_emulate( > goto push; > case 7: > generate_exception_if(1, EXC_UD, -1); > -default: > -goto cannot_emulate; > } > break; > + > +default: > +BUG();

[Xen-devel] [PATCH 3/4] x86emul: drop pointless and add useful default cases

2016-06-20 Thread Jan Beulich
There's no point in having default cases when all possible values have respective case statements, or when there's just a "break" statement. Otoh the two main switch() statements better get default cases added, just to cover the case of someone altering one of the two lookup arrays without suitabl