From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0BA2945CD8; Mon, 18 Nov 2024 19:22:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B8654279A; Mon, 18 Nov 2024 19:22:06 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id DFACA4025E for ; Mon, 18 Nov 2024 19:22:04 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2ea1e5fc65bso1565526a91.3 for ; Mon, 18 Nov 2024 10:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731954124; x=1732558924; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Coz/avlVVEPfIvAvsDQLhMt5D1aBkdvDxw6mQiYNLnc=; b=S+liCUbhPIdZTtYWlqeXSUZWZj3TC9PV7w6DXbvTx4EFLktR35SdFg/bLiu/m5OesO EBBM5B+JbyJTqou9DV7yQcDoCM8pwtrktK1pkRHZqMtlVaIug6MkBk37vu6u1/cGcUco BWJU/Psc1xW5EdNshzIzBZhtIEyFwcP8f7b05wlpyc7fdXHv/K99SD3MSeUfXIVtd3sl HgKRTpQMOvRtmyYLKRoGDTwQnIQuMiLY1/zAGkXcaejXcZBD2eBNsCbsGAS8TmbA7MxX E2t3BXVQcCF2HGwx2HLoz3YaiWLOOZP9EicezcLyXMujSezWYHoijyYTjI8CprnFCoBb Hgtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731954124; x=1732558924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Coz/avlVVEPfIvAvsDQLhMt5D1aBkdvDxw6mQiYNLnc=; b=DWOZnN74VG1DjfnTxK/PWBsecudf2Xr4fuLltJaDDwrGN1bsCj0ezpQhdLCDN2P57I QVZySZgE0oMxO/mu59K/XPgQ47yFD6BHw6VvB0RTxi5AhdkmOf+StqfcXZFlKHPnbHoz vmueqFcf9xRg72tv/SZsoX522jnX/vXFLKuSXFw94BZTMh3Y3z3LbiuQItNgZd7anovR F8eRy+Wig1ilH5tw6TQW0nKPmu0jxD4/zt/83hr7qy6IQObazPsaSExLlwhoz+9o9/D1 SNoSo38lUXNcjbH8gI6Rg5hFnEKW/N5bHiTeJj24RL99wCrhQ+e5r3hoisYsfBkIMCqQ OI7A== X-Gm-Message-State: AOJu0Ywp74vnp6oSemEqP/GQN/pY8X18KTzkUvaSLYihuLsV9qhJQ0kY JlxUdclvCpBg/EYRFnpvgdnDG2ukFitsA27cq2nlqV8E6FcE8F7LPZiPZvo5wKn2jioyw7jR13f e X-Google-Smtp-Source: AGHT+IHpE1yI4soDDSfhcN4Y/lY3qZasVL8r5kCIKgu1lMLzxc1gK+SszPP0AhULwkkCLfMuxbgNLw== X-Received: by 2002:a17:90b:1a87:b0:2ea:8e42:c39 with SMTP id 98e67ed59e1d1-2ea8e420d08mr2934046a91.11.1731954123838; Mon, 18 Nov 2024 10:22:03 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea61869bb2sm2916724a91.12.2024.11.18.10.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 10:22:03 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Anoob Joseph Subject: [PATCH v2 01/19] common/cnxk: remove duplicate condition Date: Mon, 18 Nov 2024 10:20:42 -0800 Message-ID: <20241118182153.87042-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241118182153.87042-1-stephen@networkplumber.org> References: <20241115060738.313190-1-stephen@networkplumber.org> <20241118182153.87042-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The same condition is checked twice in an if statement. Harmless, but redundant. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Signed-off-by: Stephen Hemminger Acked-by: Anoob Joseph --- drivers/common/cnxk/cnxk_security.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c index c2871ad2bd..9446c14ac8 100644 --- a/drivers/common/cnxk/cnxk_security.c +++ b/drivers/common/cnxk/cnxk_security.c @@ -174,9 +174,11 @@ ot_ipsec_sa_common_param_fill(union roc_ot_ipsec_sa_word2 *w2, uint8_t *cipher_k } /* Set AES key length */ - if (w2->s.enc_type == ROC_IE_SA_ENC_AES_CBC || w2->s.enc_type == ROC_IE_SA_ENC_AES_CCM || - w2->s.enc_type == ROC_IE_SA_ENC_AES_CTR || w2->s.enc_type == ROC_IE_SA_ENC_AES_GCM || - w2->s.enc_type == ROC_IE_SA_ENC_AES_CCM || w2->s.auth_type == ROC_IE_SA_AUTH_AES_GMAC) { + if (w2->s.enc_type == ROC_IE_SA_ENC_AES_CBC || + w2->s.enc_type == ROC_IE_SA_ENC_AES_CTR || + w2->s.enc_type == ROC_IE_SA_ENC_AES_GCM || + w2->s.enc_type == ROC_IE_SA_ENC_AES_CCM || + w2->s.auth_type == ROC_IE_SA_AUTH_AES_GMAC) { switch (length) { case ROC_CPT_AES128_KEY_LEN: w2->s.aes_key_len = ROC_IE_SA_AES_KEY_LEN_128; @@ -879,9 +881,11 @@ on_ipsec_sa_ctl_set(struct rte_security_ipsec_xform *ipsec, } /* Set AES key length */ - if (ctl->enc_type == ROC_IE_SA_ENC_AES_CBC || ctl->enc_type == ROC_IE_SA_ENC_AES_CCM || - ctl->enc_type == ROC_IE_SA_ENC_AES_CTR || ctl->enc_type == ROC_IE_SA_ENC_AES_GCM || - ctl->enc_type == ROC_IE_SA_ENC_AES_CCM || ctl->auth_type == ROC_IE_SA_AUTH_AES_GMAC) { + if (ctl->enc_type == ROC_IE_SA_ENC_AES_CBC || + ctl->enc_type == ROC_IE_SA_ENC_AES_CTR || + ctl->enc_type == ROC_IE_SA_ENC_AES_GCM || + ctl->enc_type == ROC_IE_SA_ENC_AES_CCM || + ctl->auth_type == ROC_IE_SA_AUTH_AES_GMAC) { switch (aes_key_len) { case 16: ctl->aes_key_len = ROC_IE_SA_AES_KEY_LEN_128; -- 2.45.2