Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp867962rdb; Thu, 15 Feb 2024 19:40:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU/nMD/iiWPDr80p9BhxD8wi/86Lt3E9t92xICSB4SJ+rwXeVbaMlisinfwDw9MXf8HU1dIG0tiuYlGZWbv7Blp1SNgD5cT9q38eNdv5w== X-Google-Smtp-Source: AGHT+IF7Z8DwsAy3FB5ex9O2N9mR90VxqDd48WuQhQz/NOQ7XV03ZO4Hwez0jPAS7aomWsqjcXw4 X-Received: by 2002:a2e:9cc2:0:b0:2d0:ca46:46be with SMTP id g2-20020a2e9cc2000000b002d0ca4646bemr2724136ljj.20.1708054840030; Thu, 15 Feb 2024 19:40:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708054840; cv=pass; d=google.com; s=arc-20160816; b=WvQUN1+HymE+ZlBuzF3F/RMdRBezg6munLjpZpPrRqNvyiXp1FRpqGVnorGR0N5x9f G8xukOMa/RFLc66vq4jhb7aSqqU8njln0EhnVest7CZBaZIG2r7wrKZhLcL+FWbjtLbV FpheovXK+bO6yWqSPRGxI+jryjdWN3UmePEnC+05H0Vy9k74eBn1I2cJ0Uo7gIOgs/Dn ViI+oKwLclhIFzhO0hFDFag3AviJYYxaVbsIp6KmFMSwJxsCOfEjcClPtlh0YwhRyFpO yz4a2FTSYLsTA8oIoBnmu2nIkK4zSanV2OmlVCXwoe3Kw3cofh74wyN7pmPSx0t4kGqf xolg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=+HvNP4HeZxJQGwmKeBhXQTJyp0uyBWgHT7/E9bmTiA8=; fh=119R0DZRwIns1LRpqAK2A6izyPVjL4TEe6VydCwW0T8=; b=eixnW0oUi6ICtjfdHmvtPraKjLttE01ap7zjLKebbuWEOR5IEI38bWcyYWKVu54suG Tvp3AAH+TCeW2vNgEBts+tue9ufmoIC8IFjOno3M2Ab9ph4jbmVRd3YdUx21cdjqmfbx U1TXc508fry54z4N/iiS0D1Zdvl/wCg8zEwdgIsGfz2Em/A+w16PXqJ/jr3MOc1AskdP cg6XdTf32Neba6pDsOSI4pcFFgkei7ipCWWWLuCGK4eQAgCqZ6c/2Ddkj4VU79nWw31p opfIbX6sb8DLPCrd5g5rmbZiThIOxBP2ollxAFZJxzuZWT8/FPUQRjZpzidmsNzqFDG0 fL+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-3658-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3658-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q16-20020aa7d450000000b00563eb951f36si203793edr.528.2024.02.15.19.40.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 19:40:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3658-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-3658-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3658-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B2B4C1F2329A for ; Fri, 16 Feb 2024 03:40:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAECCFBEB; Fri, 16 Feb 2024 03:40:36 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2879EFBE9 for ; Fri, 16 Feb 2024 03:40:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708054836; cv=none; b=CE0VjXJtXgjovxbU4zw64W0mImEFRgNbV2gu2JsdY2S3cGcxOoy3NBtObeRT7mbtEBxHZEhT2WvkPhNHgfQ0cqQCB1OyZkChzsrbaEukEsBESY6cktfMFWKvb4AuqxwYltsENc8zBKoJ/9X/pNvhewqLml54aI3FMKD/uEQe9zo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708054836; c=relaxed/simple; bh=JaNlrt99jNuGGWlLsHoNrOzjmXZPT3SYqyOR7UVVIhc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=hjpS4hskswqTSxmvbZ1VeHsCULxZY9aqpp2FBONIMNB10eoEkai02fq2WczqoTOcK3g0KnytO1WoI2TH0bS1mvlEQj+lFD5irD2wCp3jGcLAsRaSZt0U1SN/Ir5XOwifRo1JLZoQU1gbgABaBFWpTOLURmq96aRC1PjE4utgN7Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 41G3eSTw92751851, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 41G3eSTw92751851 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 11:40:28 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.17; Fri, 16 Feb 2024 11:40:28 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 16 Feb 2024 11:40:27 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH] wifi: rtlwifi: set initial values for unexpected cases of USB endpoint priority Date: Fri, 16 Feb 2024 11:39:49 +0800 Message-ID: <20240216033949.34765-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) Map USB endpoints to hardware and AC queues according to number of USB endpoints. However, original only give a warning for unexpected cases but initial values are not given. Then, smatch warns: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:642 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'. drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:644 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'. drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:649 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'. drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:650 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'. The regular selection is high and low queues, so move default (unexpected) case along with that. Compile tested only. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c index 5ec0eb8773a5..4217c9a08d01 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c @@ -622,6 +622,9 @@ static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw, u16 valuelow; switch (queue_sel) { + default: + WARN_ON(1); + fallthrough; case (TX_SELE_HQ | TX_SELE_LQ): valuehi = QUEUE_HIGH; valuelow = QUEUE_LOW; @@ -634,9 +637,6 @@ static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw, valuehi = QUEUE_HIGH; valuelow = QUEUE_NORMAL; break; - default: - WARN_ON(1); - break; } if (!wmm_enable) { beq = valuelow; -- 2.25.1