Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2671142ybl; Thu, 29 Aug 2019 11:15:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbIUeurG4eFlwdV9PrkMxv9xLsxdUfQ5UJe63VE42CiphjHE+QGD6M9D0DIZSNVvcdbYtm X-Received: by 2002:a62:24a:: with SMTP id 71mr13219970pfc.148.1567102517474; Thu, 29 Aug 2019 11:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567102517; cv=none; d=google.com; s=arc-20160816; b=MUwdwnTYQGUlx43x/vObiLg4MO3NAN2maMH0CN9b7pU9/ZTX51oxUrTmOrjHyNesja FdFQj19k6rQnJQwF5mhNHXAQl3K6IzIxptHWboMPX7dyPYHxVhhCUaoc6RBZUvRqOThA hw16pqbhkdk5DEb4ekDgpSyzePg+cINvbOsmm4dey6DSuP1679HAH6EgaN/CXczl/8sZ v3pQC41KH2jO/PjfecfvYTLqwwvvEmr6U4KUhds8foxvn+P0rnW0ZqMB8zsox7scIVUH rptYnk/CCkVedWYjfpdr8UNOG826O+weOWZu/HYi2rfQRc40ZyhhJcCLxJiSZHBw1e5D 9yIA== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=m0leWSexNW5q/kQ2BsCZyDDTplyy2g/Xw+TTbvg+4gw=; b=OnzF2Ren76fSeYNrruMf6aKzHkNIEcLE0/bMnH6jBy+LQL+Z/fM5+6883ROd84Z3Eh 9M9GnjPstR5kWkGyVUlWx/YyhRxh9vGXcddRhKWieGtKaLuvWdFYD4OYJ5dQ/wDfoe8J jSTFk60TYD7bNUoaah1xJtRlnF1lMFHHXUivqZueH+Jhc4aVoNf/ad/FxHG7+fcBLqGl YpVC9UEFvHMsPNF8mT3OVApIe+8di57vnATKsxz7JGFWoZJ0YeduRicOMaS2Y/1Oi7Ne 11rjVXEjkOVSxdbP1f4/HCVwDCVS0hxAoYeRcRkthoViEBOWjOxMbUYUUBqnSjC/ddz8 oEGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NEf62xWt; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14si3640431pfp.253.2019.08.29.11.15.01; Thu, 29 Aug 2019 11:15:17 -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=NEf62xWt; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbfH2SNu (ORCPT + 99 others); Thu, 29 Aug 2019 14:13:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:55484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728503AbfH2SNr (ORCPT ); Thu, 29 Aug 2019 14:13:47 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D2D082339E; Thu, 29 Aug 2019 18:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567102426; bh=/APi8MhdMaI1X9POkFVoeegdl5V7Rfg/wP5JWu/pxf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NEf62xWtvGCcmfYsfNa0m7sONMphArwetnyjj65+bjWY66RQERfqzLV+CrjEUWdB+ WmgpOYFMrOtQEjR3V5un8yMoX+yBzlTIJnjMR5WB67lMI8kCPbF3IfrySN6Q2o55h/ MQWm772AM5EC2frpRd3SY+zQRh/wWIXRIfuNKX04= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH AUTOSEL 5.2 17/76] net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx Date: Thu, 29 Aug 2019 14:12:12 -0400 Message-Id: <20190829181311.7562-17-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190829181311.7562-1-sashal@kernel.org> References: <20190829181311.7562-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ 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