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 47C9A460D8; Tue, 21 Jan 2025 19:30:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D501A402CB; Tue, 21 Jan 2025 19:30:39 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 6D8F14026C for ; Tue, 21 Jan 2025 19:30:38 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-219f8263ae0so107452575ad.0 for ; Tue, 21 Jan 2025 10:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737484237; x=1738089037; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=lPvilPkCWyApIKtQqewpWl3u7mnqk6jwWMQG9wOmGmg=; b=t4BRiWKTUL594m1BHRmE3VXH6ug5FI+hA7xVwWEVt0QwY+6rGEMpGiY1KQdI9+ey9t K3l05IIrK2XPhKPtn2ofMnXTKvtBiDje2v5MbToCMarekKFxkAUxAK4z1cZH/BEgN7GW X4gSC3QJQI8cdiBr7basvhLLK9R0CjxqETHRY1CPnu9xbn/w801m2L2TL+jz+JlzFfpk PevwqN3tQJxQgNyBtYhLssxBkDstOQuTu43QIGGLgJYLVsVnfa/f6aI+2BvDTcaHSq9A hYUODLLfkGJXM6SHMYRh3CSW9n/nbYhGKc5pIf20j1ys/3DYW9Hu4iCNG+n9HzkQ/XsH WkEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737484237; x=1738089037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lPvilPkCWyApIKtQqewpWl3u7mnqk6jwWMQG9wOmGmg=; b=NHLiTUDsGcRP0JFmtvKqmA4dcHB7LGtEcOwIXwuMZxrdrfyKO1sgUIBWd/S5AyG6Z7 YZceh3M8Ax5Z+UaxfUVgZafJCntBpA+nSrRKKgd+eKt/Y66xp1uK3+db+vRAg2VPSa7C XdqYqyqKb4Zf4RTQsz2bfaONKrpI/MnXE0/bmfBkJES+T12DYm0IjkBeUkSJ6ExEl9Jj VGPz34W20LMNCKqijeJE2mipTQevPMN0MIe58KCCEoTnR5RFDpU5KQd1ZmJ6j9Aud9Hd f0YujaufOEh4Tx4GN0B5cYVfZ1ALisjCl9DtDgKRLgvY8nDaJ4eteH2eQv/q5xxfSO5u pvgw== X-Gm-Message-State: AOJu0Yx1MIPtTSCbq0Nf8U2IrREMGEzYpjjX7wHhrmOmrFto9JhQHpUm JuRKupQ3z436fqureyaxJROJFVc7ghxPre+NCr44Z6A4H2mh+qx65aphx4p8Y3k= X-Gm-Gg: ASbGncu8XEhmF0tb9SK2n/KmALGTaIu3YLQJTtucZlfeGSY19tjPtniPIKVe5Pfit+T 0GOEtpW73pU15DQab61ORWQKYfz+mHk0cSmoKXm+jVTniahM52veuYUw84MpiIcSdTiR9xTF30u oHOyoSImdFnlDYuX+L46ckGQbw28hYvb67ZhfQXt8oOHxD5DmLUcU8+EUJY9Gwz6rsB9KL/gDOX X+ZzPr/P95nAdTxTxkvLG8wYLvOxeZS9jvNDpsrPjaz/iUdwGdBwfQcNYsZHEmP0TYFR+Nf2cIg hLNRMFjipZsikKHPL+SHgzwvJHdYK9aXRJkmQvdwjgfpKm4= X-Google-Smtp-Source: AGHT+IFaTVjbv7269MtrRCBKQoRlPGrEQqZNNIqjNiOcLMbDjIbU8VcpCawq5E152Flfv2aSkDgiCA== X-Received: by 2002:a05:6a21:338f:b0:1e1:cdff:5f18 with SMTP id adf61e73a8af0-1eb21452a39mr24173359637.4.1737484237351; Tue, 21 Jan 2025 10:30:37 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72dab9d5335sm9362827b3a.110.2025.01.21.10.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 10:30:37 -0800 (PST) Date: Tue, 21 Jan 2025 10:30:35 -0800 From: Stephen Hemminger To: Serhii Iliushyk Cc: dev@dpdk.org, mko-plv@napatech.com, ckm@napatech.com, Danylo Vodopianov , Oleksandr Kolomeiets Subject: Re: [PATCH v1 03/31] net/ntnic: add return code handling Message-ID: <20250121103035.5977f739@hermes.local> In-Reply-To: <20250121170814.3252171-4-sil-plv@napatech.com> References: <20250121170814.3252171-1-sil-plv@napatech.com> <20250121170814.3252171-4-sil-plv@napatech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Tue, 21 Jan 2025 18:07:41 +0100 Serhii Iliushyk wrote: > From: Danylo Vodopianov > > CI found couple coverity problems which were fixed in this commit. > > CID: 448984, 448982, 448975, 448969, 448968, 448967 > API usage errors (BAD_COMPARE). > > Add memcmp return value checking. > > Coverity issue: 448984 > Fixes: 6e8b7f11205f ("net/ntnic: add categorizer (CAT) FPGA module") > > Signed-off-by: Danylo Vodopianov > --- > drivers/net/ntnic/include/hw_mod_backend.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ntnic/include/hw_mod_backend.h b/drivers/net/ntnic/include/hw_mod_backend.h > index f91a3ed058..40002f3343 100644 > --- a/drivers/net/ntnic/include/hw_mod_backend.h > +++ b/drivers/net/ntnic/include/hw_mod_backend.h > @@ -114,10 +114,10 @@ enum { > typeof(be_module_reg) *temp_be_module = &(be_module_reg); \ > typeof(idx) tmp_idx = (idx); \ > typeof(cmp_idx) tmp_cmp_idx = (cmp_idx); \ > - if ((unsigned int)(tmp_idx) != (unsigned int)(tmp_cmp_idx)) { \ > - (void)memcmp(temp_be_module + tmp_idx, &temp_be_module[tmp_cmp_idx], \ > - sizeof(type)); \ > - } \ > + if ((unsigned int)(tmp_idx) != (unsigned int)(tmp_cmp_idx)) \ > + if (memcmp(temp_be_module + tmp_idx, &temp_be_module[tmp_cmp_idx], \ > + sizeof(type)) == 0) \ > + return 1; \ > } while (0) > Complex generic macros like this are brittle. Adding a return in the middle of a loop means it will do unexpected exit of function??