Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4049754ybe; Mon, 9 Sep 2019 03:25:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEeMbJgL8p/tFV64fp3PYljk7O577BZazFNOznGgBOSMadFWLrGPo+ojAIecSe+Bg8foSg X-Received: by 2002:a50:a0e2:: with SMTP id 89mr23110942edo.118.1568024751678; Mon, 09 Sep 2019 03:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568024751; cv=none; d=google.com; s=arc-20160816; b=tO+oJoumOMCG3dwA0q7Bp5gZbNwEXPIZlXvFkIMfs83h36JVgZof/bP3dDAYWBBSZ3 zC6/ANP4wu7s/m5sgxw3WWKEcGKtbPhxs6QQ6TOyCsV8+AdJJuF4XsSPgf6MKhhi/HYV 9W+ga2X8xDhgE+clA//xeLQeZevxrV5irsftJ18McdL0g24S+5aS0+KM7gEDKjA6WtBA 7RQ6MSS71bG5AUFYe/Ek8tSbtR4MulYeUWQcMeJNyNZHdvpWMUdgHmk4ttaYreC2yg3D qIUwZoVbrLgi709TMyanNnYGwdQBnp68X1no12xG2dNg/bqHnnhUNJ4Pnz0iuXxRhG56 EfOA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q4T67kkdRKJKE/TqU/UKhrrGIYfaGTtWl2dwfB8SgiY=; b=GS5DlxGVkK/EgQN8JwpnIzMqs/uv9tXHWJ8Hsf26KeJ89MLJCZiq+Y3ojLXZ15RXjb KkPGk7aIJ4dvTemlk+zzsElDCxlXv7neaH+hzzUfc1gysE1eiHIJsk6+/4IoZGv58KrZ di/2S75vsschceZ4+IW5+VPcTjkCgAKMYeRjKbRP4vfBYPcDanAXkdogmcyFJzAnGgrm o7o8UmuVNk8vOZgYecaSKWK4ygHijqKAMiAlR3Dr5hx/hfSnyhW8B3J+RhmZYSafYw5r 6HnKJW2VB5EVRc2L2/JuSorOj1Gdcn1TlXR/WDMCgkfhcah0JCtO09A5PtjQpAMyFcpa SJYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W0N8Ir1n; 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 k7si8733703edb.238.2019.09.09.03.25.28; Mon, 09 Sep 2019 03:25:51 -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=@kernel.org header.s=default header.b=W0N8Ir1n; 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 S1732223AbfIHMum (ORCPT + 99 others); Sun, 8 Sep 2019 08:50:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:41472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732150AbfIHMud (ORCPT ); Sun, 8 Sep 2019 08:50:33 -0400 Received: from localhost (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 132D121A49; Sun, 8 Sep 2019 12:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567947032; bh=5+II5HNYrMrDE2tZb894YLsh8Bk2aDw3oznzM2GPMHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W0N8Ir1nP+cqprKw9e3K4Tb+n07X815TDOZ/mgai1B0E7ljZRNXhF2oEE2pr3NNGe dcFYnqOJ9TZRWU/668SlIqDBXQi3GHR+RtRWQe0MPKgbcqi2sJIs1jOCJE7CE+lm3B WpN04QriAu1vj26D5JUsfKwfh8zGL6JKeyTf3N7Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 35/94] net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx Date: Sun, 8 Sep 2019 13:41:31 +0100 Message-Id: <20190908121151.442955738@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121150.420989666@linuxfoundation.org> References: <20190908121150.420989666@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 125b7e0949d4e72b15c2b1a1590f8cece985a918 ] clang warns: drivers/net/ethernet/toshiba/tc35815.c:1507:30: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] if (!HAVE_DMA_RXALIGN(lp) && NET_IP_ALIGN) ^ ~~~~~~~~~~~~ drivers/net/ethernet/toshiba/tc35815.c:1507:30: note: use '&' for a bitwise operation if (!HAVE_DMA_RXALIGN(lp) && NET_IP_ALIGN) ^~ & drivers/net/ethernet/toshiba/tc35815.c:1507:30: note: remove constant to silence this warning if (!HAVE_DMA_RXALIGN(lp) && NET_IP_ALIGN) ~^~~~~~~~~~~~~~~ 1 warning generated. Explicitly check that NET_IP_ALIGN is not zero, which matches how this is checked in other parts of the tree. Because NET_IP_ALIGN is a build time constant, this check will be constant folded away during optimization. Fixes: 82a9928db560 ("tc35815: Enable StripCRC feature") Link: https://github.com/ClangBuiltLinux/linux/issues/608 Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/toshiba/tc35815.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c index c50a9772f4aff..3b5a26b05295f 100644 --- a/drivers/net/ethernet/toshiba/tc35815.c +++ b/drivers/net/ethernet/toshiba/tc35815.c @@ -1504,7 +1504,7 @@ tc35815_rx(struct net_device *dev, int limit) pci_unmap_single(lp->pci_dev, lp->rx_skbs[cur_bd].skb_dma, RX_BUF_SIZE, PCI_DMA_FROMDEVICE); - if (!HAVE_DMA_RXALIGN(lp) && NET_IP_ALIGN) + if (!HAVE_DMA_RXALIGN(lp) && NET_IP_ALIGN != 0) memmove(skb->data, skb->data - NET_IP_ALIGN, pkt_len); data = skb_put(skb, pkt_len); -- 2.20.1