WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] RE: [PATCH]enable PCI serial card usage

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] RE: [PATCH]enable PCI serial card usage
From: "Wei, Gang" <gang.wei@xxxxxxxxx>
Date: Wed, 31 Mar 2010 17:19:57 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Cc:
Delivery-date: Wed, 31 Mar 2010 02:20:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C7D8CFB0.F51F%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E6467867A6B05E4FA831B7DF29925F5C40E0FE60@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C7D8CFB0.F51F%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcrQe4R+tgvNgRsDTUyRtRb8R9HK+gANkFS7AABFQHA=
Thread-topic: [PATCH]enable PCI serial card usage
On Wednesday, 2010-3-31 5:09 PM, Keir Fraser wrote:
> 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.

Thanks for point it out. xen_bool_t would be safer for such case.

Jimmy
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>