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 6424A45E94; Fri, 13 Dec 2024 22:06:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88B1B40E1B; Fri, 13 Dec 2024 22:05:58 +0100 (CET) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id 4B3DB40E1B for ; Fri, 13 Dec 2024 22:05:57 +0100 (CET) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-725abf74334so1907930b3a.3 for ; Fri, 13 Dec 2024 13:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734123956; x=1734728756; 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=9y3M9PABVHCNnNyNOf8hUGgcr+7flm01XmtaQmgA3c4=; b=fDQSXETHUmSnmbTiVUSF5JZlK+KW+P497mbn/suY3mYC4dIBwtZHIAdc1HCBBIG1ar 6jczS5wu50l41egVMF/lLEzSpbd8TL6oheWDIi5LqgmULjwCdmH6L+nCGZo4jVhC+aEa DOSODJ+oNqyP5axYk8DS+KtvUvmqTfjPWoHMZ2Ifgf6cl0BGnbpLm1oZNJhkavR7vTy7 wtBzEMnbibSc3kxgZ1IpltTMJW2p1WR3g5pQf2UOvTLr8skuxeMrli1jO7Qa57zs6LWc bbhF4ATo+A2a/xzb3Ir3D23oxSt8vRrZMG2oA2oDpokG9Mq9gCejxXo/211s0fe4rVuH JarQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734123956; x=1734728756; 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=9y3M9PABVHCNnNyNOf8hUGgcr+7flm01XmtaQmgA3c4=; b=xFE6XfUW/yEr48pLsLcBkCZ40mkb/In36fZzscoMUXdCaRQNr6CCYaqmCKVeBBaz7r csNQnsVTsgmwWwDtro64SRRXvTct69YYYJjT5241+L2Q7f9Sn79RyfSM0WB5HlSN945C FObhvs2XxDcACgbbAeww0oHtXd0eUdjz8sXvUDIBliZ5NYqpeu9ZA815GbEIIHr3FaWl aZwkV2bsz7iObt5d45HHGwDcLp32DjMfTrI9rEW9uq/gZrbzbkPo3MHI5QhFFlYW782C XpYZ2lyWIk36lumIGKnI5nZtdDGGR6+U7rUE/LHx7EgdZXIYFEfyrpLzF+pR++5z90nu p+5Q== X-Forwarded-Encrypted: i=1; AJvYcCWSqTyzUyXU9H11DltD7iNOpLTDYerwD/q4V4ITQrPi4vZ0BKT2FtcksxnmWsuFMgetT58=@dpdk.org X-Gm-Message-State: AOJu0Yzr7UrOJ34aslPAbX3YYtCKNh5V/1wa6zRg2+cWilCqWycdYCtB q+4rqN13cB2ePpB//2Bq/WoYgNogm4Uc++2uAMs3kodGlGgMnAeUrlvn384Go8g= X-Gm-Gg: ASbGncsJAGjpPmdVAB2UQLycADBo5D5ByGgm9oQ2G3xYFAF7glr40C9KdEw3nAjHwHD 0nebNE7chIB9a3sA3Dp0OwEIijmxn9lXiBIvrplw8Qnj8wkg28/MRKD6cyv2bjw1B/GC4o25UMK d2pnyZG/aAZYA4uwTbRO9UUOKs80SrSJvnpfUqxIjQI+DUbBUl8sJ4DezlguKKnwtIqxsgSzmop sS/NkDlk8dae3IeM6z5pfRLOnA4hTj/d7Ru4RSQd/OaYZvpr+GkGCIk6X1PvqKkWz0uIDQ8OjUw hYsim/Ug47BIyCAQr7kYh5vjGr9EtsfVog== X-Google-Smtp-Source: AGHT+IGYHF86mVIwiryEMVfF2FOfN4Ea91uX56fsB1lRAtheyGmdGh73MNl85Bi/zfEF9spwSGgfFA== X-Received: by 2002:a05:6a00:4c12:b0:727:3c7b:738 with SMTP id d2e1a72fcca58-7290c0f850fmr6292781b3a.5.1734123956399; Fri, 13 Dec 2024 13:05:56 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72918bc020csm210583b3a.178.2024.12.13.13.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 13:05:56 -0800 (PST) Date: Fri, 13 Dec 2024 11:41:20 -0800 From: Stephen Hemminger To: Junlong Wang Cc: ferruh.yigit@amd.com, dev@dpdk.org Subject: Re: [PATCH v2 02/15] net/zxdh: zxdh np uninit implementation Message-ID: <20241213114120.4f6dc3cf@hermes.local> In-Reply-To: <20241210055333.782901-3-wang.junlong1@zte.com.cn> References: <20241206055715.506961-2-wang.junlong1@zte.com.cn> <20241210055333.782901-1-wang.junlong1@zte.com.cn> <20241210055333.782901-3-wang.junlong1@zte.com.cn> 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, 10 Dec 2024 13:53:20 +0800 Junlong Wang wrote: > +static uint32_t > +zxdh_np_comm_read_bits(uint8_t *p_base, uint32_t base_size_bit, > + uint32_t *p_data, uint32_t start_bit, uint32_t end_bit) > +{ > + uint32_t len = 0; > + uint32_t start_byte_index = 0; > + uint32_t end_byte_index = 0; > + uint32_t byte_num = 0; > + uint32_t buffer_size = 0; > + > + if (0 != (base_size_bit % 8)) > + return 1; > + > + if (start_bit > end_bit) > + return 1; > + > + if (base_size_bit < end_bit) > + return 1; > + > + len = end_bit - start_bit + 1; Another case of the "initialize everything" style. len is set to zero when declared then first use assigns it.