From patchwork Mon Mar 6 11:48:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cox X-Patchwork-Id: 9605875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D5BAB602B4 for ; Mon, 6 Mar 2017 11:49:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B592E28249 for ; Mon, 6 Mar 2017 11:49:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9C6928338; Mon, 6 Mar 2017 11:49:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4081428249 for ; Mon, 6 Mar 2017 11:49:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752945AbdCFLtV (ORCPT ); Mon, 6 Mar 2017 06:49:21 -0500 Received: from mga04.intel.com ([192.55.52.120]:28897 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752799AbdCFLtV (ORCPT ); Mon, 6 Mar 2017 06:49:21 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2017 03:48:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,253,1484035200"; d="scan'208";a="56538264" Received: from unknown (HELO acox1-desk1.ger.corp.intel.com) ([10.252.14.195]) by orsmga002.jf.intel.com with ESMTP; 06 Mar 2017 03:48:30 -0800 Subject: [PATCH] atomisp: fix __udiv warning From: Alan Cox To: greg@kroah.com, linux-media@vger.kernel.org Date: Mon, 06 Mar 2017 11:48:30 +0000 Message-ID: <148880090137.25601.18382191536021391777.stgit@acox1-desk1.ger.corp.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Certain combinations of compiler and compiler options product an imx.o that calls compiler helpers for a u64 divide. Use the do_div() call instead. Signed-off-by: Alan Cox --- drivers/staging/media/atomisp/i2c/imx/imx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/imx/imx.c b/drivers/staging/media/atomisp/i2c/imx/imx.c index 47286de..f6e12c6 100644 --- a/drivers/staging/media/atomisp/i2c/imx/imx.c +++ b/drivers/staging/media/atomisp/i2c/imx/imx.c @@ -819,13 +819,14 @@ static int imx_get_intg_factor(struct i2c_client *client, if (dev->sensor_id == IMX132_ID || dev->sensor_id == IMX208_ID) vt_pix_clk_freq_mhz = ext_clk_freq_hz / div; - else if (dev->sensor_id == IMX227_ID) + else if (dev->sensor_id == IMX227_ID) { /* according to IMX227 datasheet: * vt_pix_freq_mhz = * num_of_vt_lanes(4) * ivt_pix_clk_freq_mhz */ vt_pix_clk_freq_mhz = - (u64)4 * ext_clk_freq_hz * pll_multiplier / div; - else + (u64)4 * ext_clk_freq_hz * pll_multiplier; + do_div(vt_pix_clk_freq_mhz, div); + } else vt_pix_clk_freq_mhz = 2 * ext_clk_freq_hz / div; vt_pix_clk_freq_mhz *= pll_multiplier;