All of lore.kernel.org
 help / color / mirror / Atom feed
* xen-4.3.1:hvm.c: 2 * possible bad if tests ?
@ 2013-11-21 11:45 David Binderman
  2013-11-21 11:54 ` Andrew Cooper
  0 siblings, 1 reply; 14+ messages in thread
From: David Binderman @ 2013-11-21 11:45 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org

Hello there,

I just ran the source code of xen-4.3.1 through the static analyser "cppcheck".

It said

1.

[hvm.c:2190]: (style) Expression '(X & 0xc00) != 0x6' is always true.

Source code is

            if ( ((desc.b & (6u<<9)) != 6) && (dpl != rpl) )
                goto unmap_and_fail;

You might be better off with

            if ( ((desc.b & (6u<<9))) && (dpl != rpl) )
                goto unmap_and_fail;

2.

[hvm.c:2210]: (style) Expression '(X & 0xc00) != 0x6' is always true.

Source code is

            if ( ((desc.b & (6u<<9)) != 6) && ((dpl < cpl) || (dpl < rpl)) )
                goto unmap_and_fail;

Duplicate.

Regards

David Binderman 		 	   		  

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

end of thread, other threads:[~2013-11-22 14:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21 11:45 xen-4.3.1:hvm.c: 2 * possible bad if tests ? David Binderman
2013-11-21 11:54 ` Andrew Cooper
2013-11-21 15:03   ` [PATCH] " Tim Deegan
2013-11-21 15:07     ` Andrew Cooper
2013-11-21 15:13       ` Tim Deegan
2013-11-21 15:19         ` Keir Fraser
2013-11-21 15:32         ` Tim Deegan
2013-11-21 18:56           ` Andrew Cooper
2013-11-22 11:50             ` Jan Beulich
2013-11-22 11:54               ` Tim Deegan
2013-11-22 14:20                 ` [PATCH v4 1/2] x86/hvm: fix segment validation Jan Beulich
2013-11-22 14:25                   ` Andrew Cooper
2013-11-22 14:21                 ` [PATCH v4 2/2] x86/hvm: clean up " Jan Beulich
2013-11-22 14:27                   ` Andrew Cooper

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.