Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp850564img; Wed, 20 Mar 2019 12:12:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYpws6433uTH66dcmtQJKElNvsNeIN+2ecQ98Ei2kUl9/alP7jmp25hskDv3QJMfgRYtfj X-Received: by 2002:a17:902:3283:: with SMTP id z3mr5072796plb.236.1553109160343; Wed, 20 Mar 2019 12:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553109160; cv=none; d=google.com; s=arc-20160816; b=cxyWFMPslFIHvkzIwite66TVxJXhkKZER6cMaaJS78vi+CmjqFSHXNLg0mw8TfPjyd VWHX8Ac9UDcxKh7sdpDb957yrl7rQ81aLwGm7GRlBUFv8MJjGI3JNPokf/Z9vvYv+FIE LHBq/URCcm21dqZrjyvvwgKQ9nz+gY0zfARlBBw9UmN/0UcGubnekim8bwnCbdq/Ewe2 C3WWtKdcqcOAgKyqp+er/SBmJgmFKxbPl2WCpe9JKv7f782xqrnAkubSce8eg1qN8hmc 1+45ZjhKY4lWz1iXryXPKWN8SibmGyD8lOYifDyX130qfE5f0yFlpKvqjZrp/UkTevsg LT2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=E1J0TLtNxQGhiW+cnGH2Vxj6UXnA7Xkbtcf3KUCqpLY=; b=TMbryJubZatJ8xBWqYFCEwBgd9RVnwAgz6e+elfzsORgkPcuMbLbIy2sYODsW0k0gB 7nw6Li4J7A1Km6pU92ml50AAzudaR0BvloWbh02VAxYaH3RlqYTYIIM7CjKqTFbKCm2I EfNgD5MPBwAUocNZIhhvEjgq/h/dgVkO0ou2NrXpXR5Zwhucm8KRuX1UnU/FOZnQP2A9 ynHKl/+N/pgP1GGOhXcal1dfyNknATuyLihh1JFNbzY0JWy9J5vPwtxi+RSh3p9n2APo RN1nYGjcZ2qUZ2i+YGbCaJNj2NsLxGUcKn7hiVF4DKGp1LpOlsQjF3r5U538SteXMl9p HZnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bqKeYF2K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si2589056plf.356.2019.03.20.12.12.24; Wed, 20 Mar 2019 12:12:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bqKeYF2K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727062AbfCTTKb (ORCPT + 99 others); Wed, 20 Mar 2019 15:10:31 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:39333 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbfCTTKb (ORCPT ); Wed, 20 Mar 2019 15:10:31 -0400 Received: by mail-ed1-f68.google.com with SMTP id p27so2963576edc.6; Wed, 20 Mar 2019 12:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=E1J0TLtNxQGhiW+cnGH2Vxj6UXnA7Xkbtcf3KUCqpLY=; b=bqKeYF2KAVLf1abyHvg8mOPOBK4qTIE9S/qG1gyDlXcK3xGKmiUhWzIYProZPQM7aS toZByuvXfkrcQd9wLCFzWIeQmmeeVKhm/F0TqSvxbzUT08uAqlqEpzaiEVOmuE0eJOAL pYaNCC5xsPFx/6O4bwsC7z10Iz2vFFDgv3UDGxBhcBIUzijeMCFvHo56VitCNZhnxpWk NvZKYmwyU4bF/FU3K19q0i/cEllUQTjE3mGCdQb7LbnsPlHn0Ymz1LN9K7K/zbhKVEgP j758KAzqqLQnAFCJeVJfLjDC3y+a3YT1d+xcsREYoRLqbhzey39rmAzugcd3Qr2AV1fh 9CHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=E1J0TLtNxQGhiW+cnGH2Vxj6UXnA7Xkbtcf3KUCqpLY=; b=EUhckBePi0hnpjy/odqKsvoUk1Fi1oBUrrVduBHEc9nFOUwduRE2pPemZ+80qDaDAF I7DWD9zvV3etCjhR8QiaoqClBWkjtjbmjZLqCGEtXQEv3BjY9r5OglkQzLFx6UhZZPmv ucgzbc7GyBj5hi3gQKxPQqbPigIAB/l1jmo9pFxXU6TbtMlC9/CnNE2ZwEbqGbG3ipzI WC28FWk5/orfyFLpeUKSMujn3wZ+1pDef7R2sMVNlwICqRvcaCqtYyY2GHQgssgeZwUM IWN9aOS05Z3jIhaoQsdIp5tTapUU0yzUiedKMTDZXFR3TyZRmMeLch+JfiluSgMkjdMf 9ymw== X-Gm-Message-State: APjAAAU/l39hVzKxr0gzOudf9hPwdE7eCF2F2skYgqcqV2/sGGfMt1J9 +t6aK7ERPB5VX8JaGgJLqGw= X-Received: by 2002:a17:906:1d0f:: with SMTP id n15mr18193353ejh.102.1553109029444; Wed, 20 Mar 2019 12:10:29 -0700 (PDT) Received: from archlinux-ryzen ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id z3sm863426edh.74.2019.03.20.12.10.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 20 Mar 2019 12:10:28 -0700 (PDT) Date: Wed, 20 Mar 2019 12:10:26 -0700 From: Nathan Chancellor To: Johannes Berg Cc: linux-wireless@vger.kernel.org, "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers Subject: Re: [PATCH] cfg80211: Change an 'else if' into an 'else' in cfg80211_calculate_bitrate_he Message-ID: <20190320191026.GC28744@archlinux-ryzen> References: <20190307235735.31487-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190307235735.31487-1-natechancellor@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 07, 2019 at 04:57:35PM -0700, Nathan Chancellor wrote: > When building with -Wsometimes-uninitialized, Clang warns: > > net/wireless/util.c:1223:11: warning: variable 'result' is used > uninitialized whenever 'if' condition is false > [-Wsometimes-uninitialized] > > Clang can't evaluate at this point that WARN(1, ...) always returns true > because __ret_warn_on is defined as !!(condition), which isn't > immediately evaluated as 1. Change this branch to else so that it's > clear to Clang that we intend to bail out here. > > Link: https://github.com/ClangBuiltLinux/linux/issues/382 > Suggested-by: Nick Desaulniers > Signed-off-by: Nathan Chancellor > --- > net/wireless/util.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/net/wireless/util.c b/net/wireless/util.c > index e4b8db5e81ec..75899b62bdc9 100644 > --- a/net/wireless/util.c > +++ b/net/wireless/util.c > @@ -1220,9 +1220,11 @@ static u32 cfg80211_calculate_bitrate_he(struct rate_info *rate) > else if (rate->bw == RATE_INFO_BW_HE_RU && > rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_26) > result = rates_26[rate->he_gi]; > - else if (WARN(1, "invalid HE MCS: bw:%d, ru:%d\n", > - rate->bw, rate->he_ru_alloc)) > + else { > + WARN(1, "invalid HE MCS: bw:%d, ru:%d\n", > + rate->bw, rate->he_ru_alloc); > return 0; > + } > > /* now scale to the appropriate MCS */ > tmp = result; > -- > 2.21.0 > Gentle ping (if there was a response to this, I didn't receive it). I know I sent it in the middle of a merge window so I get if it slipped through the cracks. Thanks, Nathan