|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: [PATCH]enable PCI serial card usage
On 31/03/2010 03:40, "Wei, Gang" <gang.wei@xxxxxxxxx> wrote:
> + int pb_bdf_enable:1; /* if =1, pb-bdf effective, port behind bridge */
> + int ps_bdf_enable:1; /* if =1, ps_bdf effective, port on pci card */
Point of information for you: a signed integer N-bit bit field can take
values in the range -2^(N-1) to 2^(N-1)-1. In this case N=1 and the allowed
values are -1 and 0. Hence assigning value 1 to the above bit fields has
undefined behaviour and some versions of gcc will not 'set the flag' as you
expect! We've been bitten by it before. Generally your bit fields should be
*unsigned* unless you specifically want signed-integer semantics. Even
better here, we'll burn the extra bits and use xen_bool_t.
I will fix your patch in this case before applying.
-- Keir
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|