From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by dpdk.org (Postfix) with ESMTP id BEACA324D for ; Mon, 18 Mar 2019 16:27:11 +0100 (CET) Received: by mail-pg1-f181.google.com with SMTP id i7so8412703pgq.0 for ; Mon, 18 Mar 2019 08:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J8y9MhMgL0o1HOnEWLHjQMCLN+dH4bYA5V0YMet0hJ4=; b=iKQJXipKBTPLdhJjNjh7gx3o8UsC7e5sudd305F7d6AoIqY4j6Yp92FNRic8f8/FZ7 9GevoE8do2Qqjap7BibI3gKzo3dd97RTajF4nfbJh4Ny6NfzAli3azss/hsNAZcSP35+ vjDX/Ajuw9VzlHbrUD4C8TmYl2QA/jxUbsxX9ETzjH/Y9zOiEnWF5ZSOe6r+4AQw17oQ qgEOe2xffzRs4N7Yyl6EEwNIPfVBfd/+mlXyd5IDDzjTsTCWhdwZPAvNFBBy1gtnfS+o vE0KcJ6XswWTClKV9F9hHTjBSe5fbMExkkGKjqjEPTpwcOFVxqDBUTXx11oNU7ORyN92 1Mbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J8y9MhMgL0o1HOnEWLHjQMCLN+dH4bYA5V0YMet0hJ4=; b=GLzdd5sSczN5hKhxHZswspjj1pVUnFvSjRtbdhr+1Dg8H19po+0P0sXumT8ffQWXok xtEIa88fkbXMgNm4eQVMf0PX11tO0mM5oX/HwdQ4m7uqNdJ6gH6Hf+3HQ4841WFC7bO+ Az/0hPZ/XxHHoBb3UG6JmSemnlsQceqrNk27HaQzsUNCWOIV4T4SAdZwWLokCmDBe0jd dWHuGpB8UZwz3EKeIKMPWL165NauQyhBDFBtODxmQn6/EYYR3upVotr/hi6k+8dg7iqc 9jS/6Y93AaMhfeGF7EPL7MJ4VjOfKzEROFLWYzI6RJ3OfZgeEzNj2t9dSy8TRhTLMbta ogzw== X-Gm-Message-State: APjAAAWvgUGU/buOnyepXXlVG4ftv/DgjlgS0EH2i0ONi56NKkv5WfqR JAKbHT8hCeY12wcXxPKUV1/T3w== X-Google-Smtp-Source: APXvYqzdOkZEVjIGmx1EcyQvhmPlhBaeJC5fasRPRac6zg4AOmogE0Fu42qMjrJrQKEEAFPeF6xj4Q== X-Received: by 2002:a65:4381:: with SMTP id m1mr17021529pgp.97.1552922830966; Mon, 18 Mar 2019 08:27:10 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id j9sm18344540pfc.67.2019.03.18.08.27.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Mar 2019 08:27:10 -0700 (PDT) Date: Mon, 18 Mar 2019 08:27:07 -0700 From: Stephen Hemminger To: Wei Zhao Cc: dev@dpdk.org, stable@dpdk.org, qi.z.zhang@intel.com, adrien.mazarguil@6wind.com Message-ID: <20190318082707.1dfb60d7@shemminger-XPS-13-9360> In-Reply-To: <1552639435-68184-1-git-send-email-wei.zhao1@intel.com> References: <1552639435-68184-1-git-send-email-wei.zhao1@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix support of hex string parser for flow API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 15:27:12 -0000 On Fri, 15 Mar 2019 16:43:55 +0800 Wei Zhao wrote: > + /* Check input parameters */ > + if ((src == NULL) || > + (dst == NULL) || > + (size == NULL) || > + (*size == 0)) > + return -1; > + if ((*size & 1) != 0) > + return -1; > + > + for (c = src, i = 0; i < *size; c++, i++) { > + if ((((*c) >= '0') && ((*c) <= '9')) || > + (((*c) >= 'A') && ((*c) <= 'F')) || > + (((*c) >= 'a') && ((*c) <= 'f'))) > + continue; > + Excessive number of parens here. You don't need them around (*c) Why did you not use isxdigit() instead? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 3A4D8A05FE for ; Mon, 18 Mar 2019 16:27:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD804324D; Mon, 18 Mar 2019 16:27:13 +0100 (CET) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by dpdk.org (Postfix) with ESMTP id BEACA324D for ; Mon, 18 Mar 2019 16:27:11 +0100 (CET) Received: by mail-pg1-f181.google.com with SMTP id i7so8412703pgq.0 for ; Mon, 18 Mar 2019 08:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J8y9MhMgL0o1HOnEWLHjQMCLN+dH4bYA5V0YMet0hJ4=; b=iKQJXipKBTPLdhJjNjh7gx3o8UsC7e5sudd305F7d6AoIqY4j6Yp92FNRic8f8/FZ7 9GevoE8do2Qqjap7BibI3gKzo3dd97RTajF4nfbJh4Ny6NfzAli3azss/hsNAZcSP35+ vjDX/Ajuw9VzlHbrUD4C8TmYl2QA/jxUbsxX9ETzjH/Y9zOiEnWF5ZSOe6r+4AQw17oQ qgEOe2xffzRs4N7Yyl6EEwNIPfVBfd/+mlXyd5IDDzjTsTCWhdwZPAvNFBBy1gtnfS+o vE0KcJ6XswWTClKV9F9hHTjBSe5fbMExkkGKjqjEPTpwcOFVxqDBUTXx11oNU7ORyN92 1Mbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J8y9MhMgL0o1HOnEWLHjQMCLN+dH4bYA5V0YMet0hJ4=; b=GLzdd5sSczN5hKhxHZswspjj1pVUnFvSjRtbdhr+1Dg8H19po+0P0sXumT8ffQWXok xtEIa88fkbXMgNm4eQVMf0PX11tO0mM5oX/HwdQ4m7uqNdJ6gH6Hf+3HQ4841WFC7bO+ Az/0hPZ/XxHHoBb3UG6JmSemnlsQceqrNk27HaQzsUNCWOIV4T4SAdZwWLokCmDBe0jd dWHuGpB8UZwz3EKeIKMPWL165NauQyhBDFBtODxmQn6/EYYR3upVotr/hi6k+8dg7iqc 9jS/6Y93AaMhfeGF7EPL7MJ4VjOfKzEROFLWYzI6RJ3OfZgeEzNj2t9dSy8TRhTLMbta ogzw== X-Gm-Message-State: APjAAAWvgUGU/buOnyepXXlVG4ftv/DgjlgS0EH2i0ONi56NKkv5WfqR JAKbHT8hCeY12wcXxPKUV1/T3w== X-Google-Smtp-Source: APXvYqzdOkZEVjIGmx1EcyQvhmPlhBaeJC5fasRPRac6zg4AOmogE0Fu42qMjrJrQKEEAFPeF6xj4Q== X-Received: by 2002:a65:4381:: with SMTP id m1mr17021529pgp.97.1552922830966; Mon, 18 Mar 2019 08:27:10 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id j9sm18344540pfc.67.2019.03.18.08.27.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Mar 2019 08:27:10 -0700 (PDT) Date: Mon, 18 Mar 2019 08:27:07 -0700 From: Stephen Hemminger To: Wei Zhao Cc: dev@dpdk.org, stable@dpdk.org, qi.z.zhang@intel.com, adrien.mazarguil@6wind.com Message-ID: <20190318082707.1dfb60d7@shemminger-XPS-13-9360> In-Reply-To: <1552639435-68184-1-git-send-email-wei.zhao1@intel.com> References: <1552639435-68184-1-git-send-email-wei.zhao1@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix support of hex string parser for flow API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190318152707.qI0gO9JqBCCnnWUoN16ojhfD31s0qpq6TRTEAL0cuuw@z> On Fri, 15 Mar 2019 16:43:55 +0800 Wei Zhao wrote: > + /* Check input parameters */ > + if ((src == NULL) || > + (dst == NULL) || > + (size == NULL) || > + (*size == 0)) > + return -1; > + if ((*size & 1) != 0) > + return -1; > + > + for (c = src, i = 0; i < *size; c++, i++) { > + if ((((*c) >= '0') && ((*c) <= '9')) || > + (((*c) >= 'A') && ((*c) <= 'F')) || > + (((*c) >= 'a') && ((*c) <= 'f'))) > + continue; > + Excessive number of parens here. You don't need them around (*c) Why did you not use isxdigit() instead?