From patchwork Wed Apr 8 22:56:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWlyb3NsYXYgw4XCoHVzdGVr?= X-Patchwork-Id: 17285 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n38MuFfE003588 for ; Wed, 8 Apr 2009 22:56:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753688AbZDHW4N (ORCPT ); Wed, 8 Apr 2009 18:56:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754565AbZDHW4N (ORCPT ); Wed, 8 Apr 2009 18:56:13 -0400 Received: from main.gmane.org ([80.91.229.2]:54781 "EHLO ciao.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753688AbZDHW4M (ORCPT ); Wed, 8 Apr 2009 18:56:12 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Lrggl-0000ET-4X for linux-media@vger.kernel.org; Wed, 08 Apr 2009 22:56:11 +0000 Received: from 63.84.broadband6.iol.cz ([88.101.84.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Apr 2009 22:56:11 +0000 Received: from sustmidown by 63.84.broadband6.iol.cz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Apr 2009 22:56:11 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: linux-media@vger.kernel.org From: Miroslav =?utf-8?b?xaB1c3Rlaw==?= Subject: Re: [cron job] v4l-dvb daily build 2.6.22 and up: ERRORS, 2.6.16-2.6.21: WARNINGS Date: Wed, 8 Apr 2009 22:56:00 +0000 (UTC) Lines: 81 Message-ID: References: <61526.207.214.87.58.1239228654.squirrel@webmail.xs4all.nl> Mime-Version: 1.0 X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 88.101.84.63 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3) Gecko/20090327 Fedora/3.1-0.11.beta3.fc11 Firefox/3.1b3) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hans Verkuil xs4all.nl> writes: > > Can someone take a look at these warnings and errors? Looking at the log > these seem to be pretty easy to fix (compat stuff for the most part). > > I don't have the time for this for several more days, so I'd appreciate it > if someone could take a look at this for me. > > Thanks, > > Hans > Yes, it looks like my version of kernel luckily built, but other (older) versions have problems. Here: http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/4400 Marton Balint sent patch with include and changed 'div_s64_rem' to 'div_s64'. But kernels older than 2.26.x have neither 'div_s64' nor 'div_s64_rem'. Better apply this patch instead that from Marton. It uses 'do_div' which is much longer supported. With 'do_div' results should be same but for completeness here are some appointments: * 'do_div' does computation with unsigned numbers. * So we need to pass dividend as unsigned (its ABS) and then alter the sign of the result (if dividend was negative). * But function 'int_goertzel' returns u32 so if we pass dividend as u64 (cast from s64), then no sign change is needed before returning. */ * Also, divisor is N*N, so it will be always non-negative. * I think that some implementations(platforms) of 'do_div' requires divisor to be 32bit. That's why I rather use u32 for divisor (and not u64). (Here http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/4337 Marton wrote that N is at most 576.) ----- FILE: cx88-dsp_64bit_math3.patch ----- cx88-dsp: again fixing 64bit math on 32bit kernels From: Miroslav Sustek Signed-off-by: Miroslav Sustek --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r 77ebdc14cc24 linux/drivers/media/video/cx88/cx88-dsp.c --- a/linux/drivers/media/video/cx88/cx88-dsp.c Wed Apr 08 14:01:19 2009 -0300 +++ b/linux/drivers/media/video/cx88/cx88-dsp.c Thu Apr 09 00:52:27 2009 +0200 @@ -22,6 +22,7 @@ #include #include #include +#include #include "cx88.h" #include "cx88-reg.h" @@ -101,8 +102,8 @@ s32 coeff = 2*int_cos(freq); u32 i; - s64 tmp; - u32 remainder; + u64 tmp; + u32 divisor; for (i = 0; i < N; i++) { s32 s = x[i] + ((s64)coeff*s_prev/32768) - s_prev2; @@ -115,7 +116,10 @@ /* XXX: N must be low enough so that N*N fits in s32. * Else we need two divisions. */ - return (u32) div_s64_rem(tmp, N*N, &remainder); + divisor = N*N; + do_div(tmp, divisor); + + return (u32) tmp; } static u32 freq_magnitude(s16 x[], u32 N, u32 freq)