diff mbox

[v4,2/4] hw/intc: add sunxi interrupt controller device

Message ID 529586AD.3050309@cn.fujitsu.com
State New
Headers show

Commit Message

liguang Nov. 27, 2013, 5:44 a.m. UTC
Peter Crosthwaite wrote:
> On Wed, Nov 27, 2013 at 1:36 PM, Li Guang<lig.fnst@cn.fujitsu.com>  wrote:
>    
>> Li Guang wrote:
>>      
>>> Peter Crosthwaite wrote:
>>>        
>>>> On Tue, Nov 26, 2013 at 5:22 PM, liguang<lig.fnst@cn.fujitsu.com>   wrote:
>>>>          
>>>>> Signed-off-by: liguang<lig.fnst@cn.fujitsu.com>
>>>>> ---
>>>>>    default-configs/arm-softmmu.mak |    1 +
>>>>>    hw/intc/Makefile.objs           |    1 +
>>>>>    hw/intc/sunxi-pic.c             |  238
>>>>> +++++++++++++++++++++++++++++++++++++++
>>>>>    include/hw/intc/sunxi-pic.h     |   20 ++++
>>>>>            
>    
>>>>> +
>>>>> +static void sunxi_pic_set_irq(void *opaque, int irq, int level)
>>>>> +{
>>>>> +    SunxiPICState *s = opaque;
>>>>> +
>>>>> +    if (level) {
>>>>> +        set_bit(irq, (void *)&s->irq_pending[irq/32]);
>>>>>            
>>>> set_bit(irq % 32, ...)
>>>>
>>>>          
>>> OK
>>>        
>>
>> No, it is wrong,
>> irq/32 is right.
>>
>>      
> The irq/32 is right I agree. This issue is the first arugment.
> Shouln't the whole thing be:
>
> set_bit(irq%32, (void *)&s->irq_pending[irq/32]);
>
>
>    

OK, fix like this


thanks!
Li Guang
diff mbox

Patch

diff --git a/hw/intc/sunxi-pic.c b/hw/intc/sunxi-pic.c
index 5fd86f9..ea75f84 100644
--- a/hw/intc/sunxi-pic.c
+++ b/hw/intc/sunxi-pic.c
@@ -77,7 +77,7 @@  static void sunxi_pic_set_irq(void *opaque, int irq, 
int level)
      SunxiPICState *s = opaque;

      if (level) {
-        set_bit(irq, (void *)&s->irq_pending[irq/32]);
+        set_bit(irq%32, (void *)&s->irq_pending[irq/32]);
      }
      sunxi_pic_update(s);