From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B7EACA0571; Tue, 3 Mar 2020 17:02:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 46E2D1BFF0; Tue, 3 Mar 2020 17:02:14 +0100 (CET) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id EF5671BFE9 for ; Tue, 3 Mar 2020 17:02:12 +0100 (CET) Received: by mail-pj1-f68.google.com with SMTP id a18so1523973pjs.5 for ; Tue, 03 Mar 2020 08:02:12 -0800 (PST) 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=rsjFc6hGA3Ez3lpLBZZWQJ4CU1a6jZDaNwtut9XpMjU=; b=TneREXPGOCZv28Lr51nY68oRnefFj8TynftAAxPCdkLWdBLvSsNaddg/uEov2FKFia Jq/t7Pe//hos57muQG2V5pg8R01KmVzb6pebirUzVp1xyRmAlbtw+jXuGvKz12przP4s 6bZq5p88nwlEs4ToEaxRLBvzKtTjZGs91VERIv7vy7S3KfsKUqVaCfjNL26mAQGFgGPo POygRFxPkN+d2GKaNr3hWKt8YoN3ejDtNSDoj0vBSczu9d1JTkgxPTXaED/Eal7p2otM t7bdadKe9/w/sudrt8sSqFJSZ6Ic+gQP9iq9qCQ6x23XvHzqEQZTvZOwK8m5XTwJH3O8 PVag== 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=rsjFc6hGA3Ez3lpLBZZWQJ4CU1a6jZDaNwtut9XpMjU=; b=GHIQKJyPSRZhSuwzQzrNLSYUG4o5rEcxmK832g42vi8NGjf7AE8LT/JQYD2upTXBgf e1R+NhUpyATyqdNxgBdE+pJikHxf2e5Xq5nLWvgtwv2CYKUCSFUHkeM7NwAWbV2AgiHJ 6fihXfb52pY0ho3HyIsLq8n+igH3kgB4QLd7K513zcHQeHf0Ochq0EevWO45YuW8fVVX wh1A+KEnRnJrbzR/FI7DUmeLMP9GFrvw8Gs+UH9Jjo/OBKQ7yfeiYZhf/P1wP7zL8xY6 ij2oviFlcZ5SFmNnFiUnZzUNNYO4sFeoyh75sgSHLyP8ITv7JPXGwSisSNo1LqSOd/fd nX6A== X-Gm-Message-State: ANhLgQ1qj/210HMvrhVWyIM6XDPUyGk8muTurmHV0P4Pkokobx+C68bZ kJknH/W7C3I3vectTKFwRCcmJA== X-Google-Smtp-Source: ADFU+vtyc18TIKYz5q4ZBzwzpwRf+l8rdgtLlYioFTGEhF2mI4XApK96EPY/Pv4Mw3jvV7XN9+nYUg== X-Received: by 2002:a17:90a:e28e:: with SMTP id d14mr4862036pjz.56.1583251331999; Tue, 03 Mar 2020 08:02:11 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b10sm3183879pjo.32.2020.03.03.08.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2020 08:02:11 -0800 (PST) Date: Tue, 3 Mar 2020 08:02:03 -0800 From: Stephen Hemminger To: Ferruh Yigit Cc: Thomas Monjalon , David Marchand , dev@dpdk.org Message-ID: <20200303080203.4c6f2ae1@hermes.lan> In-Reply-To: <20200303132512.4138303-1-ferruh.yigit@intel.com> References: <20200303132512.4138303-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] log: add API to check if a logtype can log in a given level 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" On Tue, 3 Mar 2020 13:25:12 +0000 Ferruh Yigit wrote: > > +int > +rte_log_can_log(uint32_t logtype, uint32_t level) > +{ > + int log_level; > + > + if (level > rte_log_get_global_level()) > + return 0; > + > + log_level = rte_log_get_level(logtype); > + if (log_level < 0) > + return 0; > + > + if (level > (uint32_t)log_level) > + return 0; > + > + return 1; > +} Why not use a boolean (stdbool) for return value?