Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2451123ybg; Thu, 30 Jul 2020 23:00:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2A4DUuOuimg6FMKH6CBzj9xVCAAHbT7oSIdojHcyPaKCFVA+aQWq3IFq7Ix/Hp3oi3IAd X-Received: by 2002:a05:6402:1c88:: with SMTP id cy8mr2422385edb.24.1596175210985; Thu, 30 Jul 2020 23:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596175210; cv=none; d=google.com; s=arc-20160816; b=zdOgTdlqpgT5xxTgRfX3OPoKBYTuZSzLDyCIV3witS2LjfzQiSt+X4nN+t4Tqn5u0n dqa3gC737yfYW2HzdjRBcLJywmspBnnwj9pgBFcGkt70wwDhhuPA7jfYQiYC166BN9py 56y/F79JHmJwREL/eBqJ6TuMEihoH9ZesKpkGnQjnS7fTDwo7yzi1fPpwLyReRext9JO 4M98UQwr7itJ4aCQdNCIjUQAALQm458+iSDbbJOrrir0xiNOg5Iwd44U8lQDrTcN0Ebo TYdfYhe/BLZOcaS+iE69sbGZweH4i+yb4ZrM4BEx1zlohsvoQ7yjFnO/E6cDVwhRJLM7 jfTQ== 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 :message-id:date:subject:cc:to:from; bh=CejwZlIFRoH4ubM0PSdk5TE/WHWFcbovMHkwS78C+gI=; b=BVx732BkPWuLEy5ZIK3pBt2FFWyAYRlm6GdxoIlNe8hjJblBFDEub37OIB1DR4NUlM I+y63D1+0BkHOIqolhirusNUe8izd/wTutfNbNjcAFbXziEb94SkkF8UWSNS5x6Thsnq bxeaOFQUnUmEoQ6UJhOnA4cZ5S3hfr+a163sOQcfe/3UTinBZj8eCqa7QsskBbiQvYTy 03BW3QQEnjV9lPW4jyKTRGveDgQKLR0OGUsfuMklFXQGWm55DqnJFUSsmuw81pShf8ZJ nvNuBt0mP++jW00sV3ufgYy8c1USYgVPky+rTde1QCvLw1W9RmRlhl2WPI73JhhDXFSN pcXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk3si4755871ejb.323.2020.07.30.22.59.35; Thu, 30 Jul 2020 23:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730173AbgGaF4l (ORCPT + 99 others); Fri, 31 Jul 2020 01:56:41 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:56444 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726972AbgGaF4k (ORCPT ); Fri, 31 Jul 2020 01:56:40 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 228034E7D77; Fri, 31 Jul 2020 05:56:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at web.adapt-ip.com Received: from web.adapt-ip.com ([127.0.0.1]) by localhost (web.adapt-ip.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id X9p6TloNSJrd; Fri, 31 Jul 2020 05:56:37 +0000 (UTC) Received: from tractor.ibsgaard.io (c-73-202-5-52.hsd1.ca.comcast.net [73.202.5.52]) (Authenticated sender: thomas@adapt-ip.com) by web.adapt-ip.com (Postfix) with ESMTPSA id F40974E7AC3; Fri, 31 Jul 2020 05:56:36 +0000 (UTC) From: Thomas Pedersen To: Johannes Berg Cc: linux-wireless , ath10k , sfr@canb.auug.org.au, Thomas Pedersen Subject: [PATCH mac80211-next] ath10k: fix unhandled switch value warning Date: Thu, 30 Jul 2020 22:56:36 -0700 Message-Id: <20200731055636.795173-1-thomas@adapt-ip.com> X-Mailer: git-send-email 2.27.0 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 Cited commit introduced the following warnings: drivers/net/wireless/ath/ath10k/mac.c: In function 'chan_to_phymode': drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_1' not handled in switch [-Wswitch] 558 | switch (chandef->width) { | ^~~~~~ drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_2' not handled in switch [-Wswitch] drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_4' not handled in switch [-Wswitch] drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_8' not handled in switch [-Wswitch] drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_16' not handled in switch [-Wswitch] drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_1' not handled in switch [-Wswitch] 581 | switch (chandef->width) { | ^~~~~~ drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_2' not handled in switch [-Wswitch] drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_4' not handled in switch [-Wswitch] drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_8' not handled in switch [-Wswitch] drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_16' not handled in switch [-Wswitch] Fix them by making the existing invalid channel width cases the default, as the introduced channel widths currently don't make sense in 2 or 5GHz either. Fixes: e5cb3d34a66d ("nl80211: S1G band and channel definitions") Signed-off-by: Thomas Pedersen --- drivers/net/wireless/ath/ath10k/mac.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 919d15584d4a..3c0c33a9f30c 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -568,11 +568,7 @@ chan_to_phymode(const struct cfg80211_chan_def *chandef) case NL80211_CHAN_WIDTH_40: phymode = MODE_11NG_HT40; break; - case NL80211_CHAN_WIDTH_5: - case NL80211_CHAN_WIDTH_10: - case NL80211_CHAN_WIDTH_80: - case NL80211_CHAN_WIDTH_80P80: - case NL80211_CHAN_WIDTH_160: + default: phymode = MODE_UNKNOWN; break; } @@ -597,8 +593,7 @@ chan_to_phymode(const struct cfg80211_chan_def *chandef) case NL80211_CHAN_WIDTH_80P80: phymode = MODE_11AC_VHT80_80; break; - case NL80211_CHAN_WIDTH_5: - case NL80211_CHAN_WIDTH_10: + default: phymode = MODE_UNKNOWN; break; } -- 2.27.0