Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp138858rdh; Mon, 18 Dec 2023 06:38:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTzgI+M77oRiRzppD+H3w/mNMW2I3rX5gbgNvEunjaOBiLDGbUDWzZsxHwRoZUcIdRHh1v X-Received: by 2002:a05:6102:3e8e:b0:466:5bd2:a2f2 with SMTP id m14-20020a0561023e8e00b004665bd2a2f2mr6990896vsv.1.1702910302295; Mon, 18 Dec 2023 06:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702910302; cv=none; d=google.com; s=arc-20160816; b=LyPZNvfZwMQvo1tj+3FipAjOjAhRahT3csp8OOR4cts+VwIITv+sATrw7N3aRnBlcm 3emxofW9k1ndmAPqFoG+fo+GKQJ5EBUPfzAYCg/qxlrGInFxepXeHARKalrYaL9FPwb6 1HRhsEsLuxepC3YcWti1ZlgAsbwiY5vt0Z6/UpHe9XkzWlBD5WqmAb8reiLP0FJyqKIo hlWkfsatCc+erFF9hf3qyJ8Qstv7KBZn5CvRGQoOIFeUmC17Uofge3w3ba79YnjZBzN7 iUWbkwTH7IJJD3lwo8arqE/bB6FZWEqdXGd3tVOcmkDY4zsBlFC8cn8NXO/pRYVRysjP 2ACw== ARC-Message-Signature: i=1; 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:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=p8RuRhMrs3kLb0LdYS9LLCJzvgc4hFqIDQ54H2oKUFk=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=qewOTGWmBlH8ytgtmkTqey3P9FeutIPVYs60Jf5hyiQeSFN2eKM7RBculGo/v7FMld TAaKH64OX/sumMp4qQKf3/qRyKWlpPNidLnnmKYj8BhyJUs1G1r3F/je69NRKndUgvZ/ cCwMSZdhwvmJXCK8Hz9z2h8YF+3e2B5/DKPlyt7wHsoYWqXnfKP2BlhY6KF7Bh9LH0Zl Afl7lHUb5UTmhF9nrJw1VZVwB26+3NmqPYdHPF0gRArhPQj2eUBmUr+vKNNwlvofvJYY 7kJ/PbGaL03aEdKD8gKia87l74JewLuYryYy8I9K8B6SdcdMFC/rUem2YCl2avJGzXp/ 6SVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZmKDN7Xt; dkim=neutral (no key) header.i=@linutronix.de header.b=xIzDYuqs; spf=pass (google.com: domain of linux-wireless+bounces-927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-927-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d22-20020a67ec16000000b004669daf695asi160687vso.28.2023.12.18.06.38.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 06:38:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZmKDN7Xt; dkim=neutral (no key) header.i=@linutronix.de header.b=xIzDYuqs; spf=pass (google.com: domain of linux-wireless+bounces-927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-927-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0B7041C23F4D for ; Mon, 18 Dec 2023 14:38:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E5F31D157; Mon, 18 Dec 2023 14:37:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZmKDN7Xt"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xIzDYuqs" X-Original-To: linux-wireless@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5659C3D568 for ; Mon, 18 Dec 2023 14:37:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Martin Kaistra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702910230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p8RuRhMrs3kLb0LdYS9LLCJzvgc4hFqIDQ54H2oKUFk=; b=ZmKDN7XttL6GUIUlbdK6Yn6FYw9m1LMXrw00MkwniYZ1kQRB0X/HjuQaHqa4E0bK/0XYCA nIdZM56qiUYKJ7rPsXVZUOWJYuLxiJy9Z492T2nVCr1pKObXB0d9Bmo3iuRjjosLH0oeNt h4G7fOXTzS3i6qNlRNijU2WGOxrIzq8waD/F0K5xxWlg3mZuvl8An/dsjc3gudLa0mn9CN haoAYLvbM9rb7j+cT6F8W1AqXJhPc3SAimhO/hcS5iqrGJV+lySh4gPOmly0/t06pmYGD0 UhaP6aBJ3WypwmfLkqyiau2EDlQdL8engqgvIhn0oIymuqbiJQcinN2zLKwIRA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702910230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p8RuRhMrs3kLb0LdYS9LLCJzvgc4hFqIDQ54H2oKUFk=; b=xIzDYuqs45+Dxv1aoEvtgUA3dSJpr8L7MrrDimSNZvmly7Gh4IrfX1Z62dRc26pKv3NqSl NADipIM1F7IOgFCg== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH 16/20] wifi: rtl8xxxu: support multiple interfaces in get_macid() Date: Mon, 18 Dec 2023 15:36:41 +0100 Message-Id: <20231218143645.433356-17-martin.kaistra@linutronix.de> In-Reply-To: <20231218143645.433356-1-martin.kaistra@linutronix.de> References: <20231218143645.433356-1-martin.kaistra@linutronix.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit As sta_info->macid does not get set in station mode, we can simplify this function by directly returning 0 if sta itself or sta_info is not set. Signed-off-by: Martin Kaistra --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 3851fc90339e0..ad76cddef81b2 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4053,10 +4053,13 @@ static inline u8 rtl8xxxu_get_macid(struct rtl8xxxu_priv *priv, { struct rtl8xxxu_sta_info *sta_info; - if (!priv->vif || priv->vif->type == NL80211_IFTYPE_STATION || !sta) + if (!sta) return 0; sta_info = (struct rtl8xxxu_sta_info *)sta->drv_priv; + if (!sta_info) + return 0; + return sta_info->macid; } -- 2.39.2