From patchwork Wed Apr 8 23:18:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWlyb3NsYXYgw4XCoHVzdGVr?= X-Patchwork-Id: 17287 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 n38NJ40d005246 for ; Wed, 8 Apr 2009 23:19:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756227AbZDHXSk (ORCPT ); Wed, 8 Apr 2009 19:18:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756011AbZDHXSk (ORCPT ); Wed, 8 Apr 2009 19:18:40 -0400 Received: from main.gmane.org ([80.91.229.2]:33731 "EHLO ciao.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754565AbZDHXSi (ORCPT ); Wed, 8 Apr 2009 19:18:38 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Lrh2R-00013m-A1 for linux-media@vger.kernel.org; Wed, 08 Apr 2009 23:18:35 +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 23:18:35 +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 23:18:35 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: linux-media@vger.kernel.org From: Miroslav =?utf-8?b?xaB1c3Rlaw==?= Subject: [PATCH] Re: [cron job] v4l-dvb daily build 2.6.22 and up: ERRORS Date: Wed, 8 Apr 2009 23:18:24 +0000 (UTC) Lines: 61 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 Miroslav Å ustek centrum.cz> writes: > 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. Oh great, (not div64.h like I have written before) isn't in pre 2.6.26, too (yes I meant 2.6.26.x previously, not 2.26.x). :/ Including works as well for me and should work on older kernels, too. Forget about the previous (..._math3) patch :) - Mirek ----- FILE: cx88-dsp_64bit_math4.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 01:14:48 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)