From patchwork Sat Apr 11 12:05:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Rothwell X-Patchwork-Id: 721 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sat, 11 Apr 2009 12:05:34 +0000 Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Lsbxm-0005zl-JD; Sat, 11 Apr 2009 12:05:34 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755158AbZDKMFR (ORCPT + 1 other); Sat, 11 Apr 2009 08:05:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753091AbZDKMFQ (ORCPT ); Sat, 11 Apr 2009 08:05:16 -0400 Received: from chilli.pcug.org.au ([203.10.76.44]:34089 "EHLO smtps.tip.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753403AbZDKMFP (ORCPT ); Sat, 11 Apr 2009 08:05:15 -0400 Received: from ash.ozlabs.ibm.com (ta-1-1.tip.net.au [203.11.71.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtps.tip.net.au (Postfix) with ESMTPSA id 3D73F36800D; Sat, 11 Apr 2009 22:05:10 +1000 (EST) Date: Sat, 11 Apr 2009 22:05:08 +1000 From: Stephen Rothwell To: Mauro Carvalho Chehab Cc: Andrew Morton , linux-next@vger.kernel.org, LKML , Marton Balint , linux-media@vger.kernel.org Subject: Re: linux-next: Tree for April 9 Message-Id: <20090411220508.501e5c7d.sfr@canb.auug.org.au> In-Reply-To: <20090411080953.0c22cf4e@pedra.chehab.org> References: <20090409163305.8c7a0371.sfr@canb.auug.org.au> <20090410231158.33b85dc1.akpm@linux-foundation.org> <20090411080953.0c22cf4e@pedra.chehab.org> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Mauro, On Sat, 11 Apr 2009 08:09:53 -0300 Mauro Carvalho Chehab wrote: > > On Fri, 10 Apr 2009 23:11:58 -0700 > Andrew Morton wrote: > > > On Thu, 9 Apr 2009 16:33:05 +1000 Stephen Rothwell wrote: > > > > > I have created today's linux-next tree at > > > git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git > > > > It has a link failure with i386 allmodconfig due to missing __divdi3. > > > > It's due to this statement in drivers/media/video/cx88/cx88-dsp.c's > > int_goertzel(): > > > > return (u32)(((s64)s_prev2*s_prev2 + (s64)s_prev*s_prev - > > (s64)coeff*s_prev2*s_prev/32768)/N/N); > > > > that gem will need to be converted to use div64() or similar, please. > > Updated to use do_div(). Thank you. It will be included in next-20090414. Andrew, I have included the patch below in case you need it before then. diff --git a/drivers/media/video/cx88/cx88-dsp.c b/drivers/media/video/cx88/cx88-dsp.c index a78286e..3e5eaf3 100644 --- a/drivers/media/video/cx88/cx88-dsp.c +++ b/drivers/media/video/cx88/cx88-dsp.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "cx88.h" #include "cx88-reg.h" @@ -100,13 +101,25 @@ static u32 int_goertzel(s16 x[], u32 N, u32 freq) s32 s_prev2 = 0; s32 coeff = 2*int_cos(freq); u32 i; + + u64 tmp; + u32 divisor; + for (i = 0; i < N; i++) { s32 s = x[i] + ((s64)coeff*s_prev/32768) - s_prev2; s_prev2 = s_prev; s_prev = s; } - return (u32)(((s64)s_prev2*s_prev2 + (s64)s_prev*s_prev - - (s64)coeff*s_prev2*s_prev/32768)/N/N); + + tmp = (s64)s_prev2 * s_prev2 + (s64)s_prev * s_prev - + (s64)coeff * s_prev2 * s_prev / 32768; + + /* XXX: N must be low enough so that N*N fits in s32. + * Else we need two divisions. */ + divisor = N * N; + do_div(tmp, divisor); + + return (u32) tmp; } static u32 freq_magnitude(s16 x[], u32 N, u32 freq)