From patchwork Wed Dec 14 19:46:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 9474607 X-Patchwork-Delegate: johannes@sipsolutions.net 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 82934607EE for ; Wed, 14 Dec 2016 19:47:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7218728595 for ; Wed, 14 Dec 2016 19:47:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6709B28651; Wed, 14 Dec 2016 19:47:47 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 1E57D286B1 for ; Wed, 14 Dec 2016 19:47:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756541AbcLNTrT (ORCPT ); Wed, 14 Dec 2016 14:47:19 -0500 Received: from nbd.name ([46.4.11.11]:54224 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756527AbcLNTrR (ORCPT ); Wed, 14 Dec 2016 14:47:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=yYh4HitTIvgEFNvo6dnTueudxjMZbIbkj1juP/NSAxw=; b=O2txRo4CKpupeJQmiBbIppdstsmr+50L36if63oPlUp+SPug2drxW+DKbXBxh8hfqq7eKvjvd5FXI8bLVeD86wJZspYmkyQG2oeUO+7syGZZNVjJyM+kYX726pacEIxzAv1jtooZ7Xu1KXUBXCu3TVKypNn3mbOu7j9TIQnpBzI=; Received: by nf-4.local (Postfix, from userid 501) id CF1A417728A6E; Wed, 14 Dec 2016 20:47:03 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, thomas.huehn@evernet-eg.de Subject: [PATCH 06/10] mac80211: minstrel: reduce MINSTREL_SCALE Date: Wed, 14 Dec 2016 20:46:59 +0100 Message-Id: <20161214194703.33429-6-nbd@nbd.name> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161214194703.33429-1-nbd@nbd.name> References: <20161214194703.33429-1-nbd@nbd.name> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The loss of a bit of extra precision does not hurt the calculation, 12 bits is still enough to calculate probabilities well. Reducing the scale makes it easier to avoid overflows Signed-off-by: Felix Fietkau --- net/mac80211/rc80211_minstrel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/rc80211_minstrel.h b/net/mac80211/rc80211_minstrel.h index 94b89b1..03716fd 100644 --- a/net/mac80211/rc80211_minstrel.h +++ b/net/mac80211/rc80211_minstrel.h @@ -14,7 +14,7 @@ #define SAMPLE_COLUMNS 10 /* number of columns in sample table */ /* scaled fraction values */ -#define MINSTREL_SCALE 16 +#define MINSTREL_SCALE 12 #define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div) #define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE)