Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3635393pxb; Mon, 24 Jan 2022 14:04:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYnTIR9ztdrs8pVIZoQQvd6EwZ43XVo56uPnI6K54Zf7jppXW01td7rqOa9/kmIFOK3Giz X-Received: by 2002:aa7:9f5b:0:b0:4c6:fe0c:2e27 with SMTP id h27-20020aa79f5b000000b004c6fe0c2e27mr15813275pfr.65.1643061854189; Mon, 24 Jan 2022 14:04:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061854; cv=none; d=google.com; s=arc-20160816; b=OAr4O/OOkDVghmlCuFdCxJvIBKJf8t4Vrz2A6aUj+T8gcHBdAVv4e533x9fg24d9Ky qa349pQYoiR7B0A6ux7W0Pvo+5QoOF6fh7XXDNQ+yWV23eKgibo7+3YSAJJ4TWM0xIoe zCFKPUo8zTLP80qEUt+XZDe+gr2SoqgZUrBncSAkI/mQzwHRM3NApdSrQ678j4PdTq7G kvBWtrlaxaSMMUqbitkcS3WLp3+/IxTDO9bpi1uP440eUKnJ4tvLfyNs+9cjs+gptYZ4 kaBGCOufAKBy8xRe5eIDGf23CglFEEbVXCHkC17P+UVdT0GOWff2qYmelIoLe7XC72Vw MWXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=APrHLN6P8Ta1IRMFoTL+xL5rV8lBYlUcPCu1k0u8Vek=; b=N+Va2bXQs3gOhPBdaeVNmjOg3381mbI4w7FhPLscHDstknVA1NOhMURP/VHJewPcG/ SKN3OPNxU+Q+Yb/T1UmhSU0TcI+Ruc3TySdqiDjToQpAOdzNJPwZIA3NCmTOEk9Omfr9 1QLgzfOaGqGQVWNhnigNlgyxPpVOZZSRG109we0O4IjAtUK5D/obM7Btx5icudQORcLU jvFG8LdecUI0NQNKtFVYpLiHd0CSJEaGO9RRQa+zCzvwRVZsYX3Tn9nk/FKnTnd7Z3Aw lvI6ABpbHMxZvaIXRWD1YW0RSnBLje8IUmO1la1OLdfTeXe0p2k+XQ1WpdEufyEEPvls cIlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MydZCj4g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si14462798pgm.271.2022.01.24.14.03.48; Mon, 24 Jan 2022 14:04:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MydZCj4g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1575414AbiAXVvi (ORCPT + 99 others); Mon, 24 Jan 2022 16:51:38 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:35534 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1449879AbiAXVRQ (ORCPT ); Mon, 24 Jan 2022 16:17:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 77314B81142; Mon, 24 Jan 2022 21:17:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3F77C340E5; Mon, 24 Jan 2022 21:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059030; bh=Rx5RxhbS8kMvSzbQfANI2qKyuJIM3o5KzFcelYuNImg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MydZCj4gYiqyFxf0SfUAxph4H9lDWY2N/IGYJ8UiS/S8IF02tlcOBXQnua07mapr7 CQKPv49FcwVcmfDYEgGl40cCZlYrLuo992FKitQdHlpgRjj5cq61TY+APZcvI50Yw/ pu6rDf5IJrVsP6E+IQXf8teEhHAOpsOnfKly4ujE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.16 0439/1039] iwlwifi: mvm: Use div_s64 instead of do_div in iwl_mvm_ftm_rtt_smoothing() Date: Mon, 24 Jan 2022 19:37:08 +0100 Message-Id: <20220124184140.050838206@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 4ccdcc8ffd955490feec05380223db6a48961eb5 ] When building ARCH=arm allmodconfig: drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c: In function ‘iwl_mvm_ftm_rtt_smoothing’: ./include/asm-generic/div64.h:222:35: error: comparison of distinct pointer types lacks a cast [-Werror] 222 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ | ^~ drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1070:9: note: in expansion of macro ‘do_div’ 1070 | do_div(rtt_avg, 100); | ^~~~~~ do_div() has to be used with an unsigned 64-bit integer dividend but rtt_avg is a signed 64-bit integer. div_s64() expects a signed 64-bit integer dividend and signed 32-bit divisor, which fits this scenario, so use that function here to fix the warning. Fixes: 8b0f92549f2c ("iwlwifi: mvm: fix 32-bit build in FTM") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211227191757.2354329-1-nathan@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c index 9449d1af3c11a..628aee634b2ad 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c @@ -1066,8 +1066,7 @@ static void iwl_mvm_ftm_rtt_smoothing(struct iwl_mvm *mvm, overshoot = IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT; alpha = IWL_MVM_FTM_INITIATOR_SMOOTH_ALPHA; - rtt_avg = alpha * rtt + (100 - alpha) * resp->rtt_avg; - do_div(rtt_avg, 100); + rtt_avg = div_s64(alpha * rtt + (100 - alpha) * resp->rtt_avg, 100); IWL_DEBUG_INFO(mvm, "%pM: prev rtt_avg=%lld, new rtt_avg=%lld, rtt=%lld\n", -- 2.34.1