Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp698280lqp; Thu, 21 Mar 2024 12:44:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCtflMDxIHk9fU+RnanOt9obBVOfHw4ltgTthLPcwB13qAfRWTsHqn1OHNsnusqjCb7Y2m6t+GsFk51KKnGAREgn6K0TkJnpjc2PCEnA== X-Google-Smtp-Source: AGHT+IHV1IdL7RRoGxBF2ihtHxIgP1M4kW465GN4FfYWNRyDb+aonkSneMxQCTb4/mdNxFxiILQl X-Received: by 2002:a05:6a00:4f91:b0:6ea:74f5:5ff5 with SMTP id ld17-20020a056a004f9100b006ea74f55ff5mr455661pfb.27.1711050257987; Thu, 21 Mar 2024 12:44:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711050257; cv=pass; d=google.com; s=arc-20160816; b=i52eXv5kq5eZ7AHCuIafneJBoU7i1J0Cm91QZJgHz8OxpuJih8lC9vP8BWJnnNGUzH LyU28BqCV9P8DZLebEyPlqI3618xlC1OqjZ0EY/H01HlOCmogS66nZ2997AxP8hbFUnB WrJvIgZ4NALRCtbVZH4nYI12flhVqOT+phUjEgAXfrkx8S47WFTsbLAIOvZ/3M/euCmv dF1iRsH1nP8PM0wIOhRPFVQISY9pjWeJ3r6pfbuA8b1NtP18x1BdH1rEV2PgzXz8O9BL 589zi0hc4jK+WaxE7hjCHTJM2PU8vQwLO7aZnUV5sDQqTfhaA3UfPSzuSwa4xxAn4NTf TRcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :from; bh=eZ90dbkH9EDwZQHC0k1guSIde4lCEs5G/IQ4WF1HtYI=; fh=xCayoCXh6WZ3Dmkb6jcNzdbRoZrXRGzVfXm0TlGtcH0=; b=s45LhFqw4lA8M7D51BiWM+KNP9JVqJ7ZnOrCeiselv5Szk3Q3tnkhBr1vaS0d4QdqL JXNJfc4QkoojPzle24X8/BYloU5tiLL9vwmeUh+JkhTOsdpwGz8vAa+wH5dAdtJB9J9J pZQL72yuGP8r1fZeRW68LYk/5Cim3qY0AlD2C/tclpl/vreZCQKb/gwGitBbpwSM42pi BkOAyVCl8/K/w7Kq1qtULQjJylxV9EPXP3c/ssqsc5YzdU2My1yMp14ymIqfT0F2DDXi ZwwSFzvYCbKBOW3CFBG6bRnl8h58+oYs7Q5ovbbDsQksmMpdolM241/VoVSCTH0pHCvb UcHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=u+88zv5x; arc=pass (i=1 spf=pass spfdomain=toke.dk dkim=pass dkdomain=toke.dk dmarc=pass fromdomain=toke.dk); spf=pass (google.com: domain of linux-wireless+bounces-5114-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5114-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u64-20020a638543000000b005d8bb714e7csi370702pgd.593.2024.03.21.12.44.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 12:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5114-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=u+88zv5x; arc=pass (i=1 spf=pass spfdomain=toke.dk dkim=pass dkdomain=toke.dk dmarc=pass fromdomain=toke.dk); spf=pass (google.com: domain of linux-wireless+bounces-5114-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5114-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 81D47281C0D for ; Thu, 21 Mar 2024 19:44:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A21F133993; Thu, 21 Mar 2024 19:44:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toke.dk header.i=@toke.dk header.b="u+88zv5x" X-Original-To: linux-wireless@vger.kernel.org Received: from mail.toke.dk (mail.toke.dk [45.145.95.4]) (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 92A5D132C38 for ; Thu, 21 Mar 2024 19:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.145.95.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711050255; cv=none; b=qrDwuxE37UjhN2yxNiNHyt4P2RuKYbUrOUMMKiYSiX3DvmxLf/gukICsfdtUhadHN7f8c6a81JE4xYZ0JXtDYLowiX+bzzrGx8JDNmCyjyZxHTfp/IehVfPo3G+4Qj95vAcqxI5SjpZ92OrYvxgcmVJtIBD9dkShG6wGCoN7Y7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711050255; c=relaxed/simple; bh=OnhhZwYsqR8b6hhB4hEK0d/Aicu6xh0og4PaUHx7fvQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=aJsMOV9OSIEbbSk4NfM+bDQ0f1NstejViDMDPI+5bgcipG6qcgHj42GhbRTWXTwuSJOSAADXoOt4CVoRBsb1OlYbEM+1XpaWzkYsTHvdHrqNHGWnh1P/IRKu8E9Zpy+a+eweAfpJz/kT7wxGRKKXQmIAm8CA6x96200bPOee/HU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=toke.dk; spf=pass smtp.mailfrom=toke.dk; dkim=pass (2048-bit key) header.d=toke.dk header.i=@toke.dk header.b=u+88zv5x; arc=none smtp.client-ip=45.145.95.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=toke.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=toke.dk From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1711050250; bh=OnhhZwYsqR8b6hhB4hEK0d/Aicu6xh0og4PaUHx7fvQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=u+88zv5x+k4BFNiFnR8AZFyFilQht0b5VAhMLJJbEfIa2icDDvfuPx1Y9e52xhntA ASY31MCA+1MYWgRJjBiw2RgX74vHaAtPRQyRac/1C590bEeqB2kNoeSUmxIfnIKNq7 p32lhyWAKS8PAj14nTnGYe3XfqiDb5BB1Res6NAQQXJ7jw6VJKhpCuQ8E/CE9en6lw FBuCurFZ6yVqEN6nGPBP4x4MmNsZ149kDAllb9hVagyxcRwWFmE8LrKpPL5KqP1FJJ Eb4uyCsZvIpde9Qijn3XAmvCSznSSea7uRxlVQgLZ42CrZvMH8yhqRRFEHWWVc58wI 5wQz4d6aYFY1g== To: Dmitry Antipov Cc: Kalle Valo , linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org, Dmitry Antipov Subject: Re: [PATCH] wifi: ath9k: cleanup ath_tx_complete_aggr() In-Reply-To: <20240321122642.175645-1-dmantipov@yandex.ru> References: <20240321122642.175645-1-dmantipov@yandex.ru> Date: Thu, 21 Mar 2024 20:44:10 +0100 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87o7b7fjzp.fsf@toke.dk> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Dmitry Antipov writes: > Since 'skb', 'tx_info' and 'fi' are actually used within > buffers processing loop only, move them inside the latter > and avoid some redundant initialization at the beginning > of 'ath_tx_complete_aggr()'. Compile tested only. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Dmitry Antipov > --- > drivers/net/wireless/ath/ath9k/xmit.c | 13 +++---------- > 1 file changed, 3 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c > index d519b676a109..657862be45e5 100644 > --- a/drivers/net/wireless/ath/ath9k/xmit.c > +++ b/drivers/net/wireless/ath/ath9k/xmit.c > @@ -491,8 +491,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, > struct ath_tx_status *ts, int txok) > { > struct ath_node *an = NULL; > - struct sk_buff *skb; > - struct ieee80211_tx_info *tx_info; > struct ath_buf *bf_next, *bf_last = bf->bf_lastbf; > struct list_head bf_head; > struct sk_buff_head bf_pending; > @@ -501,15 +499,11 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, > int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0; > bool rc_update = true, isba; > struct ieee80211_tx_rate rates[4]; > - struct ath_frame_info *fi; > int nframes; > bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH); > int i, retries; > int bar_index = -1; > > - skb = bf->bf_mpdu; > - tx_info = IEEE80211_SKB_CB(skb); > - > memcpy(rates, bf->rates, sizeof(rates)); > > retries = ts->ts_longretry + 1; > @@ -571,14 +565,13 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, > ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad); > while (bf) { > u16 seqno = bf->bf_state.seqno; > + struct sk_buff *skb = bf->bf_mpdu; > + struct ath_frame_info *fi = get_frame_info(skb); > + struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); > > txfail = txpending = sendbar = 0; > bf_next = bf->bf_next; > > - skb = bf->bf_mpdu; > - tx_info = IEEE80211_SKB_CB(skb); > - fi = get_frame_info(skb); > - I'm OK with moving the variable declarations inside the loop body, but please keep the assignment here as separate statements (and maintain reverse x-mas tree ordering in the declarations at the top of the loop). -Toke