From patchwork Wed Jul 21 15:06:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 483309 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp6283818jao; Wed, 21 Jul 2021 08:07:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5nng8EGKoXVZOpOFhYKlm4eauIgUaBQiuMn38+T2Faz2ExN1jXc1NPTbYI01c0ktjkcwt X-Received: by 2002:a05:6602:1814:: with SMTP id t20mr23214418ioh.204.1626880073928; Wed, 21 Jul 2021 08:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626880073; cv=none; d=google.com; s=arc-20160816; b=PoVkL17DcJg4/CB2b2FBsjnn3r3/nqtfM8Iazo1DOA6rHhqb7Y4zaVmIOMxeSTjjTs Sce6Jho0KjuaRNY7MuzcVlMeq0I2RU5KU5xEKzNKRbsJv89otRBU8CPPeGmjdLuW5zyf dYTM6oSlpD5ajW2KJ0n+Teepu/wZZwLu6jshk1wEn5oc1kpdGtNN7UPIm1NIgqmOc1Jh 1Q4383C5FvIUmRGJ4bN+CMOOG2pMxneNecFasYD9oF2CiZH5H8woBKdGt9k2CVIR2n2Q 4Tv/7qL0CkJN2AcO4t6FnPnymGm/i7fNz8Y18WX5e+eEOO8Hq/sGKJ51CZbvUbxZGKWc IRnA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=5B0JIfHKk2u96tiU1ItjleGAH9UENc1UQS7DTb2Bf1c=; b=FfOSTZnXtq3CnmyraGNa4YdkGtVtatsbPyiK0hqU/8Oxl/53S5WZJYfv+TSvSucv+h +RrKsD0UM9dSyWo1KmEwEbfn/18IkqIGWasv9XOiYeTrM9Bic4vxazfhB8PG3AP8ck/a pugRZZ9jSJOcQVL0pCsywFCRp7cu2uUKTh/M/qZt68xO+KJoB8AYIQ75Vu5/SYbhx3U2 K/NNftCgAS38SkLx59cSzHr+GPqe+vrLznJgU2062noLgRNZS4L+c9I8xHPf1scQ0v9N csLVcTvCAK7sItzQdyj0kphARfxCWowV2I0y0RSkdlN2PkihNcErrpyYyFM51nvmNgkY wnuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uzxaFRjr; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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. [23.128.96.18]) by mx.google.com with ESMTP id k5si25228090ioq.67.2021.07.21.08.07.53; Wed, 21 Jul 2021 08:07:53 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=@kernel.org header.s=k20201202 header.b=uzxaFRjr; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S239506AbhGUO1P (ORCPT + 8 others); Wed, 21 Jul 2021 10:27:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:58896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239021AbhGUO1O (ORCPT ); Wed, 21 Jul 2021 10:27:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0795A60FE9; Wed, 21 Jul 2021 15:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626880071; bh=CohVxwuDisL11y0VTlPi65KYI3TaQeWuxldXen3M5sg=; h=From:To:Cc:Subject:Date:From; b=uzxaFRjrHeoZnGWliZY4qiD5WImC1kwJEK+DEsojPYsYt4ghnLHJGO2g12/4Pfz8A t7DXoip/4x5NlJ0PVCcf4In0/m+fVcR5Xpf5ji7bAG65ZqeAbLoYjok/vXwDDsVLb5 /cAvzD+otHDHdg7UoOlUrkRJvRyUANq6+KfWtmLwAAJ8uxO2WK9ZTeQvzWeo9Ji/lA NbpkNcjSKhyEftbOnMMDSRq2nviUHzNPfnIirSddM/vkYuRzlVmKoUPfLcD5hhdJYI 4OLP55IHOTYFYzsHiAiOx42K/4bSYAT7ZRJ9LdZLEuVbcIP+o5CMPoPa1//9+L4Te5 +Q7Ih4NOMUk2Q== From: Arnd Bergmann To: Felix Fietkau , Lorenzo Bianconi , Kalle Valo Cc: Arnd Bergmann , Ryder Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Shayne Chen , Sean Wang , Soul Huang , Deren Wu , Xing Song , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] mt76: fix enum type mismatch Date: Wed, 21 Jul 2021 17:06:56 +0200 Message-Id: <20210721150745.1914829-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann There is no 'NONE' version of 'enum mcu_cipher_type', and returning 'MT_CIPHER_NONE' causes a warning: drivers/net/wireless/mediatek/mt76/mt7921/mcu.c: In function 'mt7921_mcu_get_cipher': drivers/net/wireless/mediatek/mt76/mt7921/mcu.c:114:24: error: implicit conversion from 'enum mt76_cipher_type' to 'enum mcu_cipher_type' [-Werror=enum-conversion] 114 | return MT_CIPHER_NONE; | ^~~~~~~~~~~~~~ Add the missing MCU_CIPHER_NONE defintion that fits in here with the same value. Fixes: c368362c36d3 ("mt76: fix iv and CCMP header insertion") Signed-off-by: Arnd Bergmann --- This problem currently exists in 5.14-rc2, please ignore my patch if a fix is already queued up elsewhere. --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/mcu.h | 3 ++- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/mcu.h | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) -- 2.29.2 diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 863aa18b3024..43960770a9af 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -111,7 +111,7 @@ mt7915_mcu_get_cipher(int cipher) case WLAN_CIPHER_SUITE_SMS4: return MCU_CIPHER_WAPI; default: - return MT_CIPHER_NONE; + return MCU_CIPHER_NONE; } } diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h index edd3ba3a0c2d..e68a562cc5b4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h @@ -1073,7 +1073,8 @@ enum { }; enum mcu_cipher_type { - MCU_CIPHER_WEP40 = 1, + MCU_CIPHER_NONE = 0, + MCU_CIPHER_WEP40, MCU_CIPHER_WEP104, MCU_CIPHER_WEP128, MCU_CIPHER_TKIP, diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index cd690c64f65b..9fbaacc67cfa 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -111,7 +111,7 @@ mt7921_mcu_get_cipher(int cipher) case WLAN_CIPHER_SUITE_SMS4: return MCU_CIPHER_WAPI; default: - return MT_CIPHER_NONE; + return MCU_CIPHER_NONE; } } diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.h index d76cf8f8dfdf..de3c091f6736 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.h @@ -199,7 +199,8 @@ struct sta_rec_sec { } __packed; enum mcu_cipher_type { - MCU_CIPHER_WEP40 = 1, + MCU_CIPHER_NONE = 0, + MCU_CIPHER_WEP40, MCU_CIPHER_WEP104, MCU_CIPHER_WEP128, MCU_CIPHER_TKIP,