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 B4F15459CC; Wed, 18 Sep 2024 17:24:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F14B4025E; Wed, 18 Sep 2024 17:24:51 +0200 (CEST) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by mails.dpdk.org (Postfix) with ESMTP id 6FAE94003C for ; Wed, 18 Sep 2024 17:24:49 +0200 (CEST) Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-71100987d1cso3339616a34.2 for ; Wed, 18 Sep 2024 08:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726673088; x=1727277888; 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=DBT1sXJ26+/tVjUZwzqWm/hFgun8b4sc+8hO3ltF84c=; b=wbaKcBfpBZ5Umz9Zx6f0pwUMdq7x/CnlrPEhBFETmEVvwN6cDLrcqkqMrgkPy64sEL 9OtG3Q5BTFdTM7KvYrbhG9mH6mY/cK82tJ3/XMKi5A8RIiHKUlYBtnUFIKdSLtRsX+fm tiuxobJ3hrgLEtAgpqPX7kVjk+IozmPA1hK0T6rsJRrifsvtiOKISerOEgN6tMs9nwCf JzqP50T2LmOhSdAwO/0PzmOMb0IqzGE21RUqc2zLLxO/W+gLSg6c0soToDsB9KJhySrj oJ832nvmFA8uiSUYP2nc6Z51l74xErkTGO+5bK3SWOZjJ+Xu14KL76YI1iWdNiU8W15B PLcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726673088; x=1727277888; 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=DBT1sXJ26+/tVjUZwzqWm/hFgun8b4sc+8hO3ltF84c=; b=XRFk3+T6d5RHnsfHR9gk5jsr97uRB64MG5acC/JWKSTpxctqhd/nnCqmOZ4HOa2/C5 JY25vQBnXC6NzUg/NtWhOhXxs/Pmx4hpTVJuKJtW8swx+zzm/FMW4nOjmsIc4vqPPuMB mT0sxEyIhQyQsEMRzzknM9hpIw4yIqg+7m1d6QyKAWvbl/2sSvaL1WPD6XoKwxkm5Fm0 b+3fi2SVv0s0zaJTVdfO52CmIhsp/rAiwiN1KOzZduOWijqLVW81xTpY1Nmv+r43p7/O QaauFJG50RdWNjUgqqmhHwkA7pYWhRvWjucnl4W83LifrN4sD49Yj18Hz8pZlONrnRcz Tmiw== X-Gm-Message-State: AOJu0Yw6uq+Vq5KcaCMQCajlx2SbiBkC1dptmHpTL315LqBP1O/TiTpJ VB+CNWmKHLl0GyEofIblHEDcXHT3eTMTZDm0hGxQEAPhz5eK1eXAucijtAdctfc= X-Google-Smtp-Source: AGHT+IGYsGtvPNmsilexCJNIlUwHBCI/0rH8GeCZiqRDZtDJV1Wl+oGh4UJu94RLJhsPW2N1BJrsMQ== X-Received: by 2002:a05:6830:3141:b0:710:f3cb:5b9d with SMTP id 46e09a7af769-71116c7aba5mr9353978a34.24.1726673088345; Wed, 18 Sep 2024 08:24:48 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71239e9b05bsm2032027a34.18.2024.09.18.08.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 08:24:47 -0700 (PDT) Date: Wed, 18 Sep 2024 08:24:45 -0700 From: Stephen Hemminger To: fengchengwen Cc: , Tyler Retzlaff , Morten =?UTF-8?B?QnLDuHJ1cA==?= Subject: Re: [PATCH v23 04/15] eal: make eal_log_level_parse common Message-ID: <20240918082445.1dd61eca@hermes.local> In-Reply-To: References: <20200814173441.23086-1-stephen@networkplumber.org> <20240918045830.3798-1-stephen@networkplumber.org> <20240918045830.3798-5-stephen@networkplumber.org> 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 Wed, 18 Sep 2024 15:18:04 +0800 fengchengwen wrote: > > +/* Parse the all arguments looking for log related ones */ > > +int > > +eal_log_level_parse(int argc, char * const argv[]) > > +{ > > + struct internal_config *internal_conf = eal_get_internal_configuration(); > > + int option_index, opt; > > + const int old_optind = optind; > > + const int old_optopt = optopt; > > + const int old_opterr = opterr; > > + char *old_optarg = optarg; > > +#ifdef RTE_EXEC_ENV_FREEBSD > > + const int old_optreset = optreset; > > + optreset = 1; > > +#endif > > + > > + optind = 1; > > + opterr = 0; > > + > > + while ((opt = getopt_long(argc, argv, eal_short_options, > > + eal_long_options, &option_index)) != EOF) { > > + > > + switch (opt) { > > + case OPT_LOG_LEVEL_NUM: > > + if (eal_parse_common_option(opt, optarg, internal_conf) < 0) > > + return -1; > > + break; > > + case '?': > > + /* getopt is not happy, stop right now */ > > + goto out; > > no need goto, could use break This function is only used to pre-scan options, it should just ignore anything it doesn't care about. Can remove the ? case and default part.