Received: by 10.223.176.46 with SMTP id f43csp1263992wra; Wed, 24 Jan 2018 13:29:34 -0800 (PST) X-Google-Smtp-Source: AH8x2273ebGMChfBj+rp1yLCGbtAYR2BqelropKc4k3lv/UOM2yG6+9cqAb4pWb9N19auA96KcCJ X-Received: by 2002:a17:902:604d:: with SMTP id a13-v6mr9217209plt.357.1516829373905; Wed, 24 Jan 2018 13:29:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516829373; cv=none; d=google.com; s=arc-20160816; b=K7YJUiKsA9psWYKd0GiHArL0oODIG1vKObNQjAQlty5qSsf4dpYrjc+YYstvEtSLVE PoLwcIxJhN0HmeJgdBvU941gPCjMDaJHoIJx9CeAjXhrbArFdEhF8AGdfZilQA0Vb3DJ Ru6pY2gqTZfZiA9GRprYgwnx2K/cfdPIfjQqhTs1exuq7Av8gtnobRh67iIMRiMOTa4e LqJSdhxKoMyufg1dEVBmLgSf4v3Us6wEI4osyjmGsWshYBFekCwepkTchC8wANfqxxhL anTt+mF+WaJp4nR9x6IK9xjLsn78UZHl9TzA5Vxd95xq10PTiAH3K++7bDRY8/o/C5aR hxEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=dVnOvaKmJDAfPJVg9pyBrMCpRz4L0DB5MpXQN0jZVUI=; b=ujTFDuzTN6e2BEzC/R0BUoaLNpVxhrudHQ2elll5y2/eIhG009yGl88xb0RRWv4NLC DRPkt712iEQHbfVH8TDtydSrscXElek3m1Ea6dWoKijoqH2rmK4HEcGQmSm7voTLWXVa aK9Vdmc8yzA8gzVFEMmf+HmjNQeo+zx32gSec//dmkCI0tV1Wd9KbI40TPF1l5HeiwaS EyxcDCGn7W2BdThErQkNUQoGR/Ljf5Blf4JPAH++7Itwtj/0CGW0SfEGBY/e+JEMJOfS mbJOAPkWQ4f69DQhdZVMDObQ20xIdgN4+qQgkZOm+XtrxmAr/zeOvp7OkTfbEGyIRkkQ z0OA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b188si595039pgc.452.2018.01.24.13.29.20; Wed, 24 Jan 2018 13:29:33 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932637AbeAXV2g (ORCPT + 99 others); Wed, 24 Jan 2018 16:28:36 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:50370 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932474AbeAXV2d (ORCPT ); Wed, 24 Jan 2018 16:28:33 -0500 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id D7EDD108A7C7B; Wed, 24 Jan 2018 13:28:31 -0800 (PST) Date: Wed, 24 Jan 2018 16:28:31 -0500 (EST) Message-Id: <20180124.162831.1299884714527054383.davem@davemloft.net> To: niklas.cassel@axis.com Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com, niklass@axis.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: stmmac: do not use a bitwise AND operator with a bool operand From: David Miller In-Reply-To: <20180122155950.3527-1-niklas.cassel@axis.com> References: <20180122155950.3527-1-niklas.cassel@axis.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 24 Jan 2018 13:28:32 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Niklas Cassel Date: Mon, 22 Jan 2018 16:59:50 +0100 > Doing a bitwise AND between a bool and an int is generally not a good idea. > The bool will be promoted to an int with value 0 or 1, > the int is generally regarded as true with a non-zero value, > thus ANDing them has the potential to yield an undesired result. > > This commit fixes the following smatch warnings: > > drivers/net/ethernet/stmicro/stmmac/enh_desc.c:344 enh_desc_prepare_tx_desc() warn: maybe use && instead of & > drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c:337 dwmac4_rd_prepare_tx_desc() warn: maybe use && instead of & > drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c:380 dwmac4_rd_prepare_tso_tx_desc() warn: maybe use && instead of & > > Signed-off-by: Niklas Cassel Applied.