Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp945355pxb; Sun, 11 Apr 2021 02:30:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyOcIxm2wIRhhQv+j90qaoXYMOPK/4J9PlMzUy1yGl1qbJFybLpBf1S3P6q9ybQdhZjOhM X-Received: by 2002:a17:903:310a:b029:e9:727b:b278 with SMTP id w10-20020a170903310ab02900e9727bb278mr19320948plc.26.1618133437244; Sun, 11 Apr 2021 02:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618133437; cv=none; d=google.com; s=arc-20160816; b=N5WG8rU52RYEvj0zo9SjyS+pufIRwMzjTmLBSS9HK4DSKuJQO/MBLZ+EvDCn7VBM5u KaOvAGq97O1gGtzeko0aYwoq8ri3bp0E1a4ggjXTSWwHLZQ0xReYA9VnlW92/9MYPOuU N+1+dm5jSKZiagOs7hUKswfjTGCTF4l8TdWJelpGptWdI0z9UOTRpU60kulZ+hHw+CDg G+QWDfytECEq3tiUZL9eGD96cXBITJQFOZXU3n7OCiQn4h+2294qlcPRBgBdVO3cLALM Tp6wyyJ52SpZfm4i+ilFqMXAjzeTyimX9NCPuF099bCiFB3FxypEHzCdnV2szB5n3GpB aReA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dmarc-filter:sender:dkim-signature; bh=CZaQsurYXafEiO8zvG37h8CkGJKclLCmc8SRLDWNp7g=; b=YB9ZTkaF6wLZXDkodQHJqcyIAk2xciQ6DD5RgjPY1w+1gRTxiGax6sWoEX0V0xJVts J9+oM9Lt2VX/9pVSTfMBg9nAJg48IVrVcABWIzoQ/gx0KiZTD0eBkLWQRsbUqRjnx6n+ xJwdaetVvILg4e8qsWH58y5BF+9LbOJyKRAu3D3iKs3d6SQFoJRBFQhyKOjYYHAGTpBR z1shDtXRM6nlt39T9CDA9Ag+M8RgdBp06EUlimvHaGcK/RVqXwrs4O424iKAwcjmmRJn ocvCHhI2PiiJhvjjy1Pjo23ZRF1P/m1MYvNw1DQEWBJJio+FyezSvkps8YILblmq1w6c YAww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=oKDOhuG6; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l5si9278025pjg.106.2021.04.11.02.30.24; Sun, 11 Apr 2021 02:30:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=oKDOhuG6; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235273AbhDKJai (ORCPT + 99 others); Sun, 11 Apr 2021 05:30:38 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:57283 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbhDKJai (ORCPT ); Sun, 11 Apr 2021 05:30:38 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1618133422; h=Date: Message-Id: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=CZaQsurYXafEiO8zvG37h8CkGJKclLCmc8SRLDWNp7g=; b=oKDOhuG6yEWclw0Kp5xGkFwLlRO+wqfQrndXiFYXijnfp/uYiVY5SAkzqG2wM2/lkwOfa3qW YjbzggpbkZ2n8E30czKiOZ63lRHHDYoBNTYuVlI6R/aDOqDheXuSgE2aYPMUD8XM9Qd8ml14 3DPP7/Py5Bn/dcckyI7Na8L/EpE= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 6072c1a39a9ff96d95c8e2b8 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 11 Apr 2021 09:30:11 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D8C1BC433CA; Sun, 11 Apr 2021 09:30:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,BAYES_00, MISSING_DATE,MISSING_MID,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 70DC3C433C6; Sun, 11 Apr 2021 09:30:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 70DC3C433C6 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 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] mt7601u: fix always true expression From: Kalle Valo In-Reply-To: <20210225183241.1002129-1-colin.king@canonical.com> References: <20210225183241.1002129-1-colin.king@canonical.com> To: Colin King Cc: Jakub Kicinski , "David S . Miller" , Matthias Brugger , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.5.2 Message-Id: <20210411093011.D8C1BC433CA@smtp.codeaurora.org> Date: Sun, 11 Apr 2021 09:30:11 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Colin King wrote: > From: Colin Ian King > > Currently the expression ~nic_conf1 is always true because nic_conf1 > is a u16 and according to 6.5.3.3 of the C standard the ~ operator > promotes the u16 to an integer before flipping all the bits. Thus > the top 16 bits of the integer result are all set so the expression > is always true. If the intention was to flip all the bits of nic_conf1 > then casting the integer result back to a u16 is a suitabel fix. > > Interestingly static analyzers seem to thing a bitwise ! should be > used instead of ~ for this scenario, so I think the original intent > of the expression may need some extra consideration. > > Addresses-Coverity: ("Logical vs. bitwise operator") > Fixes: c869f77d6abb ("add mt7601u driver") > Signed-off-by: Colin Ian King > Acked-by: Jakub Kicinski Patch applied to wireless-drivers-next.git, thanks. 87fce88658ba mt7601u: fix always true expression -- https://patchwork.kernel.org/project/linux-wireless/patch/20210225183241.1002129-1-colin.king@canonical.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches