Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1202529imm; Thu, 4 Oct 2018 09:41:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV62vwgiTXy9byP0NxgGrzt2khq/ZvSVHxhQhLOsd9+U+LkTEhrJq4NqDjYHICtrr4T+0Z7Vy X-Received: by 2002:a17:902:20c5:: with SMTP id v5-v6mr7436424plg.62.1538671284701; Thu, 04 Oct 2018 09:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538671284; cv=none; d=google.com; s=arc-20160816; b=MNrFkNZurrwVynKuhO47towkq06PC3uThycUhDMpOlcgSywbOtqY3z5HU9O31gRnQ9 B59SUNg/CLMwVeCPv+rL6bgwY8dSg4bJmSmZNhpUu2bmbtaxyP4nPDv3RtNhABD5NSuw nYR1uKLRGWrYHItltUGzi3g/th9FWvKomWro23uWGb3Azxo+/31PmRqv3ERlmGlcy1El t996QBJHUDbGYOvs2soRLx2zt5+NWP8469oJLXBgWF+jO9TSeECbtrwNExl7IseGwYQY JRH38A31qcsy+d7ZQICIJSlBucLIIbl/NVoD7b8nr9bs3Hmd+vCf0c4aarFeKwZi0QRw HmJQ== 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=P05siEmlZJdLv9lbBRxqmpdEf/LWQheaYzzXcNHz/T4=; b=Q6dtatgK1FJ+YCqzVrMaoPwpdXJd258R4FFfizW8yyHFIsoW0rRFCSVd/pkcmhg9y5 aW1cRsfqlmhUeuHh7BjHWYp7/jrsOj4GwzI2HBZk0oVhihcW4n6pmecEnX5hmxUALv9F nWwWQ4YOR6untM+Ieh2P1sDRbUBEvjmDhuZe41qA26ooELRs3yf6IKq9U1tN4MeOHS/4 lmiAZyHfpljqkJxGSZJ2V1LoAIQjqpU2Ih33FIhla4KOCXkI2rOiDH8P5LspnQ5JQyu/ cCAPp7MxVc2MIIh9YX9B8RnktvoawvsZg45DP/E0ulP4kS5pAKfWS2wVVo8R2twkr8QE +2Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QrybSpAI; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12-v6si4406688pgr.98.2018.10.04.09.41.08; Thu, 04 Oct 2018 09:41:24 -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=@gmail.com header.s=20161025 header.b=QrybSpAI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727634AbeJDXfF (ORCPT + 99 others); Thu, 4 Oct 2018 19:35:05 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53277 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727415AbeJDXfF (ORCPT ); Thu, 4 Oct 2018 19:35:05 -0400 Received: by mail-wm1-f67.google.com with SMTP id b19-v6so9681055wme.3; Thu, 04 Oct 2018 09:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P05siEmlZJdLv9lbBRxqmpdEf/LWQheaYzzXcNHz/T4=; b=QrybSpAIEZVtpurJRLovts6VJlZT78dU+/N5YTJX9QYtGxBW24vOg/5efM7QVPqa9o FDNTytUH6HV5YaKF2Zq+t5z/AMz64u1e752jsYvbsjm1+eCF+Fv+hRxbuEf4z/O/oNQW Bi8h7Ey+O949saMU3vR/2+rW8kBmftWRX40bPLQ3KaO5IE4+rn6b1GmxaaEcc4xlkLAO bnYM2yh9y8M0fqWtHp3d181z51oHLrzo29eYiCPg6Jz1wT03uYqVbJowqZ6UPYYkV+i0 dBad9RmhxW05o9ryPH+3tYRvEGiMSS7TfpfJHQOYllGIHdciOBPGUDvycZ7FBaLy1EVv 95OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P05siEmlZJdLv9lbBRxqmpdEf/LWQheaYzzXcNHz/T4=; b=i+87oguqaro+gnFRgynEiI8/Sc2TL4rgf16QIblaDAT+48/GP9ncmrdbOI9+6ohsEU 8NWwg2rCvh1/iZKuD+uH0dbbDzad6v5E5FrXWlGTmj/Hczda4zKJ6YffdqSOLVqJrfrp j8Brvevb037phfZDzLiCzpPlTIc+KeONeJAl299SjITcutll7/bpAqAyNDnH93iuVjEm Q2dYAkaAWrgTj/w+hwsNXNWptUV+bAe8KHDsn71UZeCmDTRaaWdr0yIC8bQ7QDnCXmjJ ZYvdpEGROvggU3uOiabign7TQ2Zj5d0YiLTintYxb/SGLl4zqLaHNhw6SDkldhlhnMbW 5jXQ== X-Gm-Message-State: ABuFfogl4sTshNWh6QsM40lAA+bhGGHMi/Y6+yvEKYmZV625KRdf12KI ZW/07YRFLN6YcAKUF2muC04= X-Received: by 2002:a1c:a9ce:: with SMTP id s197-v6mr5185799wme.82.1538671260099; Thu, 04 Oct 2018 09:41:00 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id l16-v6sm2806953wmc.38.2018.10.04.09.40.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 09:40:59 -0700 (PDT) From: Nathan Chancellor To: Ariel Elior , "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Dept-EngEverestLinuxL2@cavium.com, Tomer Tayar , Nathan Chancellor Subject: [PATCH v2] qed: Avoid implicit enum conversion in qed_ooo_submit_tx_buffers Date: Thu, 4 Oct 2018 09:39:20 -0700 Message-Id: <20181004163919.13972-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181004000912.22242-1-natechancellor@gmail.com> References: <20181004000912.22242-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns when one enumerated type is implicitly converted to another. drivers/net/ethernet/qlogic/qed/qed_ll2.c:799:32: warning: implicit conversion from enumeration type 'enum core_tx_dest' to different enumeration type 'enum qed_ll2_tx_dest' [-Wenum-conversion] tx_pkt.tx_dest = p_ll2_conn->tx_dest; ~ ~~~~~~~~~~~~^~~~~~~ 1 warning generated. Fix this by using a switch statement to convert between the enumerated values since they are not 1 to 1, which matches how the rest of the driver handles this conversion. Link: https://github.com/ClangBuiltLinux/linux/issues/125 Suggested-by: Tomer Tayar Signed-off-by: Nathan Chancellor --- v1 -> v2: * Use an explicit switch statement to convert between the enumerated types like the rest of the driver, as suggested by Tomer. drivers/net/ethernet/qlogic/qed/qed_ll2.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index da13117a604a..aa633381aa47 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c @@ -796,7 +796,18 @@ qed_ooo_submit_tx_buffers(struct qed_hwfn *p_hwfn, tx_pkt.vlan = p_buffer->vlan; tx_pkt.bd_flags = bd_flags; tx_pkt.l4_hdr_offset_w = l4_hdr_offset_w; - tx_pkt.tx_dest = p_ll2_conn->tx_dest; + switch (p_ll2_conn->tx_dest) { + case CORE_TX_DEST_NW: + tx_pkt.tx_dest = QED_LL2_TX_DEST_NW; + break; + case CORE_TX_DEST_LB: + tx_pkt.tx_dest = QED_LL2_TX_DEST_LB; + break; + case CORE_TX_DEST_DROP: + default: + tx_pkt.tx_dest = QED_LL2_TX_DEST_DROP; + break; + } tx_pkt.first_frag = first_frag; tx_pkt.first_frag_len = p_buffer->packet_length; tx_pkt.cookie = p_buffer; -- 2.19.0