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 699FF45D0B; Fri, 15 Nov 2024 07:07:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 905F742F5F; Fri, 15 Nov 2024 07:07:51 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 689E742F49 for ; Fri, 15 Nov 2024 07:07:50 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-20cf3e36a76so3936875ad.0 for ; Thu, 14 Nov 2024 22:07:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731650869; x=1732255669; 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=RI0TDUdAHInKpvJuNO/VVBaoMMdsp8K3gBKR5s7/wBI=; b=QbEQM/zOo91ck8y0/vfn6SR9aObWxshogsQ6/QRbtJ5uW59g8PzexKzGTkSiOoBif3 RZawhoTpPFuubOG/l4+UhAcOGyaH2HFfFsFctvlvNj/5idhRNOf2/NrCn5isdNu6dRj5 NWgwLr+cOyQ2v2G513LVRJz1eF0PDYm/63xf4JKeqa+1SzKtpWggAy1hyrnDqeuJGPX3 aO9f9PxQ46w3ZK7UxuY4iBbN6gdMuXUgNUzrsKru9p8aQzAp5Q7Jj5NJclCn9tRgzaj3 nyzr5ZttEr4Z1WtueN8Xa0lQZncLXgxlGU8FRiXp6894J6CuFMDc7swt+bF9npDlPzTt K3+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731650869; x=1732255669; 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=RI0TDUdAHInKpvJuNO/VVBaoMMdsp8K3gBKR5s7/wBI=; b=BMtF/aUpjYuEeY812UWhEr3ZjB3hl5cGOJUoxbsYi8h0SEGMwWm/GDs7UgJ0ee4Xrh LWKhLsIPKr/IfJcn5jSTDpG+mWSmz2XU60p7G3UN05qst7cKOBlCL6W0RqhLNpQvaett WxzkoMIgct8PGxzBH7q8wG5HTRh0IIyIphrg7CkEhWPm58X4D6sA7dgIn0Iw8/x9G8sQ OpeKaY096xF9tWEGmTuagEmc44c8Voq6MqDbanl+OwFcxlvmhyjFy3PkUXmjILvV8Hgm chNiGVCRekpPiDXeWceL8iWZAC32tHGJ/iaIZ1+8R+ECQB7ovKtK7sxAEGT1bynylI20 6/Hg== X-Gm-Message-State: AOJu0Yzqg6lvRE9jsjd6ISRQ2W7PrW61tpUOESezqNiH1z/wY8l66/Le mOyODsoE5D8+U691uOtAMBkc9+L5D0xhihuJOlGYP/RIgB8P1/eH3RYDIB97lX8CtRe/gbG+M5l K X-Google-Smtp-Source: AGHT+IHmNRUTC92wELXUOlSrHu4QA2njYcL1f85HeiADr+htWU3Cokwb0X07FwF7S5FJc+U3Yxtg/A== X-Received: by 2002:a05:6a21:6d99:b0:1db:dc13:735e with SMTP id adf61e73a8af0-1dc90bfe17dmr2117571637.30.1731650869561; Thu, 14 Nov 2024 22:07:49 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea06f4856esm2123781a91.23.2024.11.14.22.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 22:07:49 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra Subject: [PATCH 01/16] common/cnxk: remove duplicate condition Date: Thu, 14 Nov 2024 22:05:38 -0800 Message-ID: <20241115060738.313190-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241115060738.313190-1-stephen@networkplumber.org> References: <20241115060738.313190-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 --- 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