Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4484997ybe; Mon, 9 Sep 2019 09:55:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtpOA5W9GWZrHzdiJeKEKy0yDNegTv5Lk1tgp1ZxKcaDqFYec2wcjASHKvYlCY1V6jrFbe X-Received: by 2002:a17:906:a40b:: with SMTP id l11mr20530839ejz.307.1568048157680; Mon, 09 Sep 2019 09:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568048157; cv=none; d=google.com; s=arc-20160816; b=oezbcAARnbu10aKcisBIYAzXhx8cjU4oGlIyvz4vGWH8+k3F9QqhUa+5Mj8Twb10sS VhHUJ2+63zMqs9y7u/Qx+kpPDYJXsZHnJ07hUlLYJ6YlQGi7q6+oslRMaLHwBi1cV/XR bMKBdV5MoQVlDJsfbHdCFbjOeHapGS45N1sYM10NVITC4xeL/JEZLLavBm5JLtEyKi7g 4JHiiqPfFG2+nBjgHM7iKR4GYHWPpOnwR6Vy7gt8tBtfo3d85n83Ot383wWG6gnygQDc Oba+19l/uZtHu99DBi0QJibgWPEe2ECYlx1fJscfBZh1OC29BxNBEFxxEI1cfpULcWLE ZuZQ== 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=uQHJbtxZ+n8ktwtJJRFAmjgRoBkjktL3gde+MNzT+zQ=; b=0nD5an+Hy1MO13nv5CelLlvO0xn5JarmF/ZOSQFyuszkQDju+AbBsTDaomvdOCp7c2 r1ayhCRueno1hpJmLgxxWGG4H/Zoa2sXifxw4uhQV8LfvW+KLuAyI2MSzZmx2l6ZIi3t DFZiG+Rvmwq8HZIg60n4AMZAKQGicCxs8Eb0N16a0Hzpda0gwzZnPBP4WO6lILAO9DUa Z/ufASc5Se2aBAPvfxwsSYle2xnL6l0f7/0c1t/VofU+DBLy4Mh+22S54HyZd9uLdLjC Vj4rKYo7ZZAt54TA7DXeFDak3aTm9eb/Tjx1EGKSsFg0cDtMx7zIVrnMgk/bHcVv1J0h KmGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T7mDNN45; 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 g20si9700487edb.149.2019.09.09.09.55.33; Mon, 09 Sep 2019 09:55:57 -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=T7mDNN45; 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 S1727360AbfIHNAf (ORCPT + 99 others); Sun, 8 Sep 2019 09:00:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:58992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729775AbfIHMoX (ORCPT ); Sun, 8 Sep 2019 08:44:23 -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 97E9021920; Sun, 8 Sep 2019 12:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946662; bh=yIjUwWTE+8HeBHbU8BkBrH+sJ9x9dxAyFoOxpRaGfV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T7mDNN45DAqdgFI4buuEkUwrTXq7JgzyfUUXe3cY1viiwJlqBZzjaZwgZuOXsuRN5 sa2FnXhb49MjbYSwmfq2lynWh2UPAAgTm0L/nXQLCDeVCKo1LGTS5SnAfPwepHTqLl fVhw03IiEtSrS+qCbMvVehsxQqM/1z37SdAcaTbI= 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 4.9 02/26] net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx Date: Sun, 8 Sep 2019 13:41:41 +0100 Message-Id: <20190908121058.021055200@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121057.216802689@linuxfoundation.org> References: <20190908121057.216802689@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 5b01b3fa9fec9..47ebac456ae57 100644 --- a/drivers/net/ethernet/toshiba/tc35815.c +++ b/drivers/net/ethernet/toshiba/tc35815.c @@ -1498,7 +1498,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