From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 561DFC433DB for ; Thu, 25 Feb 2021 16:02:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E01264EDB for ; Thu, 25 Feb 2021 16:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233230AbhBYQBo (ORCPT ); Thu, 25 Feb 2021 11:01:44 -0500 Received: from m42-2.mailgun.net ([69.72.42.2]:24573 "EHLO m42-2.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbhBYQB3 (ORCPT ); Thu, 25 Feb 2021 11:01:29 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1614268871; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=nax/2qkYZxFNNsM/IxQmHhHuh8ylQMIKgrDBwB+k6Ek=; b=aItq5QFcYgmmN6KvAKcBYqsyd03I2l1zqVwrcdl6CIWz9EdlsGE1m5ywpr5B997Mxsux7xZy npds5JpHKMSgCkoUv2DMaFBaCYNNScVhK3onxN7Z8hJ2dsThKj/DKrWczylz3MCvpmWUO68q m3D2m8d/Zsi4Ko064DDEuRk+iUg= X-Mailgun-Sending-Ip: 69.72.42.2 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 6037c98f1d6d3a470fdfe10f (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 25 Feb 2021 16:00:15 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 5F3E6C433CA; Thu, 25 Feb 2021 16:00:14 +0000 (UTC) Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 51CAFC433CA; Thu, 25 Feb 2021 16:00:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 51CAFC433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Arnd Bergmann Cc: Felix Fietkau , Lorenzo Bianconi , "David S. Miller" , Jakub Kicinski , Arnd Bergmann , Ryder Lee , Matthias Brugger , Nathan Chancellor , Nick Desaulniers , Shayne Chen , Sean Wang , 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, clang-built-linux@googlegroups.com Subject: Re: [PATCH 1/2] mt76: mt7915: fix unused 'mode' variable References: <20210225145953.404859-1-arnd@kernel.org> Date: Thu, 25 Feb 2021 18:00:07 +0200 In-Reply-To: <20210225145953.404859-1-arnd@kernel.org> (Arnd Bergmann's message of "Thu, 25 Feb 2021 15:59:14 +0100") Message-ID: <871rd4f88o.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann writes: > From: Arnd Bergmann > > clang points out a possible corner case in the mt7915_tm_set_tx_cont() > function if called with invalid arguments: > > drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:593:2: warning: variable 'mode' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] > default: > ^~~~~~~ > drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:597:13: note: uninitialized use occurs here > rateval = mode << 6 | rate_idx; > ^~~~ > drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:506:37: note: initialize the variable 'mode' to silence this warning > u8 rate_idx = td->tx_rate_idx, mode; > ^ > > Change it to return an error instead of continuing with invalid data > here. > > Fixes: 3f0caa3cbf94 ("mt76: mt7915: add support for continuous tx in testmode") > Signed-off-by: Arnd Bergmann Felix, can I take these two to wireless-drivers? An ack would be good. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches