From patchwork Fri Apr 3 11:43:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yanjiang.jin@windriver.com X-Patchwork-Id: 457964 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id DE9401401E7 for ; Fri, 3 Apr 2015 23:09:22 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 61465A3537; Fri, 3 Apr 2015 12:09:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OXDimPjfg32X; Fri, 3 Apr 2015 12:09:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 18976A3487; Fri, 3 Apr 2015 12:09:19 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 2B1671C2A52 for ; Fri, 3 Apr 2015 11:52:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 26B6795993 for ; Fri, 3 Apr 2015 11:52:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EUq+Z88nDClI for ; Fri, 3 Apr 2015 11:52:30 +0000 (UTC) X-Greylist: delayed 00:09:26 by SQLgrey-1.7.6 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by hemlock.osuosl.org (Postfix) with ESMTP id 6D64493189 for ; Fri, 3 Apr 2015 11:52:30 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 03 Apr 2015 04:43:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,517,1422950400"; d="scan'208";a="476347159" Received: from lwang4-mobl1.amr.corp.intel.com (HELO nnlmsdk142.ccr.corp.intel.com) ([10.254.109.203]) by FMSMGA003.fm.intel.com with ESMTP; 03 Apr 2015 04:43:03 -0700 From: Yanjiang Jin To: intel-wired-lan@lists.osuosl.org Date: Fri, 03 Apr 2015 04:43:03 -0700 Message-ID: <20150403114233.15851.28992.stgit@nnlmsdk142.ccr.corp.intel.com> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 03 Apr 2015 12:09:18 +0000 Subject: [Intel-wired-lan] [net-next] e1000e: define lat_ns as u64 instead of s64 X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" do_div() expects the type of "n" to be uint64_t, define "lat_ns" as u64 to avoid the below warning, also update its correlative operations and data. In file included from ./arch/powerpc/include/asm/div64.h:1:0, from include/linux/kernel.h:124, from include/linux/list.h:8, from include/linux/timer.h:4, from drivers/net/ethernet/intel/e1000e/e1000.h:29, from drivers/net/ethernet/intel/e1000e/ich8lan.c:59: drivers/net/ethernet/intel/e1000e/ich8lan.c: In function 'e1000_platform_pm_pch_lpt': include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default] (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ ^ drivers/net/ethernet/intel/e1000e/ich8lan.c:1016:4: note: in expansion of macro 'do_div' do_div(lat_ns, speed); Signed-off-by: Yanjiang Jin --- drivers/net/ethernet/intel/e1000e/ich8lan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 9d81c03..8899b20 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -1014,8 +1014,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link) u16 speed, duplex, scale = 0; u16 max_snoop, max_nosnoop; u16 max_ltr_enc; /* max LTR latency encoded */ - s64 lat_ns; /* latency (ns) */ - s64 value; + u64 lat_ns; /* latency (ns) */ + u64 value; u32 rxa; if (!hw->adapter->max_frame_size) { @@ -1040,8 +1040,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link) * 2^25*(2^10-1) ns. The scale is encoded as 0=2^0ns, * 1=2^5ns, 2=2^10ns,...5=2^25ns. */ - lat_ns = ((s64)rxa * 1024 - - (2 * (s64)hw->adapter->max_frame_size)) * 8 * 1000; + lat_ns = ((u64)rxa * 1024 - + (2 * (u64)hw->adapter->max_frame_size)) * 8 * 1000; if (lat_ns < 0) lat_ns = 0; else