From patchwork Fri Dec 11 16:11:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 66716 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 nBBGBJ39028316 for ; Fri, 11 Dec 2009 16:11:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933481AbZLKQLJ (ORCPT ); Fri, 11 Dec 2009 11:11:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933182AbZLKQLI (ORCPT ); Fri, 11 Dec 2009 11:11:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:25695 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933120AbZLKQLH (ORCPT ); Fri, 11 Dec 2009 11:11:07 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBBGB9nf013359 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Dec 2009 11:11:09 -0500 Received: from warthog.cambridge.redhat.com (kibblesnbits.boston.devel.redhat.com [10.16.60.12]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBBGB6Ts030090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Dec 2009 11:11:08 -0500 Received: from [127.0.0.1] (helo=warthog.procyon.org.uk) by warthog.cambridge.redhat.com with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NJ85B-0004D8-LS; Fri, 11 Dec 2009 16:11:05 +0000 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells Subject: [PATCH] V4L/DVB: lgs8gxx: Use shifts rather than multiply/divide when possible To: davidtlwong@gmail.com, mchehab@redhat.com Cc: dhowells@redhat.com, linux-media@vger.kernel.org Date: Fri, 11 Dec 2009 16:11:05 +0000 Message-ID: <20091211161105.16160.26479.stgit@warthog.procyon.org.uk> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/dvb/frontends/lgs8gxx.c b/drivers/media/dvb/frontends/lgs8gxx.c index eabcadc..dee5396 100644 --- a/drivers/media/dvb/frontends/lgs8gxx.c +++ b/drivers/media/dvb/frontends/lgs8gxx.c @@ -199,7 +199,7 @@ static int lgs8gxx_set_if_freq(struct lgs8gxx_state *priv, u32 freq /*in kHz*/) val = freq; if (freq != 0) { - val *= (u64)1 << 32; + val <<= 32; if (if_clk != 0) do_div(val, if_clk); v32 = val & 0xFFFFFFFF; @@ -246,7 +246,7 @@ static int lgs8gxx_get_afc_phase(struct lgs8gxx_state *priv) val = v32; val *= priv->config->if_clk_freq; - val /= (u64)1 << 32; + val >>= 32; dprintk("AFC = %u kHz\n", (u32)val); return 0; }