From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlYAh-0003P6-El for qemu-devel@nongnu.org; Wed, 27 Nov 2013 01:00:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlYAb-0000l6-QM for qemu-devel@nongnu.org; Wed, 27 Nov 2013 01:00:23 -0500 Received: from [222.73.24.84] (port=4420 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlYAb-0000kT-Dt for qemu-devel@nongnu.org; Wed, 27 Nov 2013 01:00:17 -0500 Message-ID: <529586AD.3050309@cn.fujitsu.com> Date: Wed, 27 Nov 2013 13:44:13 +0800 From: Li Guang MIME-Version: 1.0 References: <1385450531-3170-1-git-send-email-lig.fnst@cn.fujitsu.com> <1385450531-3170-3-git-send-email-lig.fnst@cn.fujitsu.com> <529465AA.5030107@cn.fujitsu.com> <529568BF.2070507@cn.fujitsu.com> In-Reply-To: Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Subject: Re: [Qemu-devel] [PATCH v4 2/4] hw/intc: add sunxi interrupt controller device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Peter Maydell , "qemu-devel@nongnu.org Developers" Peter Crosthwaite wrote: > On Wed, Nov 27, 2013 at 1:36 PM, Li Guang wrote: > >> Li Guang wrote: >> >>> Peter Crosthwaite wrote: >>> >>>> On Tue, Nov 26, 2013 at 5:22 PM, liguang wrote: >>>> >>>>> Signed-off-by: liguang >>>>> --- >>>>> 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 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); thanks! Li Guang