Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1879993ybc; Wed, 20 Nov 2019 05:38:26 -0800 (PST) X-Google-Smtp-Source: APXvYqzam2u2ukARZThCcQp+zVJL7rHifeZC5aaAU9ve18g50iDh5QepHKxqsjTI5QYmXS8+OI52 X-Received: by 2002:adf:df8b:: with SMTP id z11mr3266551wrl.12.1574257106420; Wed, 20 Nov 2019 05:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574257106; cv=none; d=google.com; s=arc-20160816; b=XqCsFCkb1i4QbfhoOQmoOlmGoqLMD0OuLvfThlYYYmymrtUYHuXEsgFd9glG+/Ex7i 5WrzgeaTNyt80Gn2SO2X7EoZ60vrZy0DiPBwC59Rc2noENtyldTRVp1a7Yd0ssLmOiSd Zkf0/RRDVheDOyIx4ZPTC96wGEa/ERG1JkJwcDTvTqIRBDPwA/Hq/mtkywHxPMSoAq4k G1RlG0uUhmEAkVbcj6I0xwEzFq5xhJyf8s8zqaSiRo6hsKOpkLXWWdatKqwAgw78MwLx 0QVQg2cTIo+Y7CL9VHsTJoUrBBWSP3mSv23bR57C0sU/zcbWJjvyKZ+/HyiDK3RUYHVc 1WoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LRGWqzi+17lsLccM7lXZL5uFHtiZxgR1vAluB55LEiU=; b=ZlSQWgdLa9wP2GCWQZFBIWVMNmkWXplIVFGXmasxNrq0z9VfBytq5paJ4PDVTSc8B7 WSLhe4NgGnWX1SzZEExSBTQGuG7fyeEPbbF+XzsiZ/Da4ydd/Zx4N6/Tdyq8KhGvtsYM tJTE2YPiFkz6By3ETTVZtEBz5AuEV9oEdSuAp/KvXmQSFJA/E6q4sQ2u4be7LEJsghSC Ak4MlMKDz99mAXHoDJfm8u+TOT7ZEUrUP//ubpde6NxJLi4cchc9jvOxui+R02ASZPkt 80qtdet4EJEB8ozjQ1TMj+xUO/HycCS0jgiIckLKQC4YVjTR7pdCmRbQgG6ovF4BqKNB 7wDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WPWp9kAk; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi17si18992801edb.430.2019.11.20.05.38.00; Wed, 20 Nov 2019 05:38:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WPWp9kAk; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728560AbfKTNCA (ORCPT + 99 others); Wed, 20 Nov 2019 08:02:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:59914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727960AbfKTNB7 (ORCPT ); Wed, 20 Nov 2019 08:01:59 -0500 Received: from localhost.localdomain.com (unknown [77.139.212.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8BB492251E; Wed, 20 Nov 2019 13:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574254919; bh=fUcpQp83cxM2DtMmXkoDEzTWGdVUn3l4dH5tGoj/2+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WPWp9kAkKESgIPhHXQWl/2lIEhdXdD/bWGeBfkFwd36Phew2h+fdxasCreN5ViaQI zeNxW2V6pThASs6gZZDHoYXUPwq4kbWfMQDAuOzu0EbAq2U0U9dbwBUhOWh2bd9NS9 7pqDoMp65dwc2M6Vh4BscczxF13q0sOOhw3Din9k= From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, ryder.lee@mediatek.com, royluo@google.com Subject: [PATCH v2 1/3] mt76: mt76x02: fix coverage_class type Date: Wed, 20 Nov 2019 15:01:43 +0200 Message-Id: <2418c6670f8e3880d62e679a62949a49b3ac65c7.1574253996.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix coverage_class type in mt76x02_dev data structure since coverage_class can be negative to enable dynack (just supported by ath9k). Set 0 as minimum value for coverage_class Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e") Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76x02.h | 2 +- drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02.h b/drivers/net/wireless/mediatek/mt76/mt76x02.h index 0ca0bbfe8769..cdc1cbd1d392 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x02.h @@ -110,7 +110,7 @@ struct mt76x02_dev { bool no_2ghz; - u8 coverage_class; + s16 coverage_class; u8 slottime; struct mt76x02_dfs_pattern_detector dfs_pd; diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c index c0500d8f9a67..dd0fc87ee9a7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c @@ -544,7 +544,7 @@ void mt76x02_set_coverage_class(struct ieee80211_hw *hw, struct mt76x02_dev *dev = hw->priv; mutex_lock(&dev->mt76.mutex); - dev->coverage_class = coverage_class; + dev->coverage_class = max_t(s16, coverage_class, 0); mt76x02_set_tx_ackto(dev); mutex_unlock(&dev->mt76.mutex); } -- 2.21.0