Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2875650pxu; Sat, 19 Dec 2020 05:03:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJy10QKi65aTcVK2ZpK+w9IMszjjpMgiNjYgJJpX/8+WitTxk2RApAgs4MzP+8PrC7FOZVrx X-Received: by 2002:a05:6402:17a3:: with SMTP id j3mr8736934edy.333.1608382981420; Sat, 19 Dec 2020 05:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608382981; cv=none; d=google.com; s=arc-20160816; b=iU60fgrThFkDUYrji4eVAi4yCnWGIPSwxo9Db9dGNjWaBr8AV+0nnnfi2AuN7yl+aW sDAAiKoPpkNhQxc7UsqrSAJy1lkPAsxtdqGRmsrOsIIKmnzK+95qvFAEkXQri3o3IiJu W3IMDZRJ9fKEsYIYNCmOeACclLEl3RT7xafePeNZXsteukvfGhJE3pJ0WpHvjFfsoBSa Dw4N4qan7tnog1l7uJSRlihTY8zCEfCAv6HQfdfUWrswh2cNHQZzGSbAVOXouX009e/K Yv9mu+LXbwsaf9lft0IJMcv9wWtZUw52KElVBlhNMzUTeiSNYDiePOH9zmGIcal1xJVb ESOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Fl3vTpO33wJZdXSmhF0m1bM6vzwksatinDcNxfenBcE=; b=zOlAI8vhorIriFilgXRGmLikmOerJGsbNE5coYhXdQn0pEyP6IiKRKa0UolT6W158N 1yug8rCQmQ6SvdqN3Fb1O7iFthGzFN60Roc9Y9EOS6RVEjPO4fEHEtl+23h2I7tRnhP9 2S6syrnnOhcpbdiGG0VhRh4bRFjHWegHNSfoXhzvuwTfHlW/YYaKL7s13eA8zmxIjkmd XYjvqVEyntTZ6BPrFAyAS2WFuX7hbCvx1SyMl/GVQxkYKBY4IMyJOVOAxdFD15Pg9bO9 dp7HnsQxodozovvf0dZv56gE3cDnVbi0MS4xcwhpRh8yJupJ7a3IBY7+nWNBpNUXvChR JDCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si8018002eds.52.2020.12.19.05.02.38; Sat, 19 Dec 2020 05:03:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728500AbgLSNAv (ORCPT + 99 others); Sat, 19 Dec 2020 08:00:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:47090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728328AbgLSM7v (ORCPT ); Sat, 19 Dec 2020 07:59:51 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jakub Kicinski Subject: [PATCH 5.9 29/49] ch_ktls: fix build warning for ipv4-only config Date: Sat, 19 Dec 2020 13:58:33 +0100 Message-Id: <20201219125346.104892973@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125344.671832095@linuxfoundation.org> References: <20201219125344.671832095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit a54ba3465d86fa5dd7d41bb88c0b5e71fb3b627e ] When CONFIG_IPV6 is disabled, clang complains that a variable is uninitialized for non-IPv4 data: drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c:1046:6: error: variable 'cntrl1' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (tx_info->ip_family == AF_INET) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c:1059:2: note: uninitialized use occurs here cntrl1 |= T6_TXPKT_ETHHDR_LEN_V(maclen - ETH_HLEN) | ^~~~~~ Replace the preprocessor conditional with the corresponding C version, and make the ipv4 case unconditional in this configuration to improve readability and avoid the warning. Fixes: 86716b51d14f ("ch_ktls: Update cheksum information") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20201203222641.964234-1-arnd@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/chelsio/chcr_ktls.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/drivers/crypto/chelsio/chcr_ktls.c +++ b/drivers/crypto/chelsio/chcr_ktls.c @@ -921,9 +921,7 @@ chcr_ktls_write_tcp_options(struct chcr_ struct fw_eth_tx_pkt_wr *wr; struct cpl_tx_pkt_core *cpl; u32 ctrl, iplen, maclen; -#if IS_ENABLED(CONFIG_IPV6) struct ipv6hdr *ip6; -#endif unsigned int ndesc; struct tcphdr *tcp; int len16, pktlen; @@ -971,17 +969,15 @@ chcr_ktls_write_tcp_options(struct chcr_ cpl->len = htons(pktlen); memcpy(buf, skb->data, pktlen); - if (tx_info->ip_family == AF_INET) { + if (!IS_ENABLED(CONFIG_IPV6) || tx_info->ip_family == AF_INET) { /* we need to correct ip header len */ ip = (struct iphdr *)(buf + maclen); ip->tot_len = htons(pktlen - maclen); cntrl1 = TXPKT_CSUM_TYPE_V(TX_CSUM_TCPIP); -#if IS_ENABLED(CONFIG_IPV6) } else { ip6 = (struct ipv6hdr *)(buf + maclen); ip6->payload_len = htons(pktlen - maclen - iplen); cntrl1 = TXPKT_CSUM_TYPE_V(TX_CSUM_TCPIP6); -#endif } cntrl1 |= T6_TXPKT_ETHHDR_LEN_V(maclen - ETH_HLEN) |