DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	David Marchand <david.marchand@redhat.com>,
	dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] log: add API to check if a logtype can log in a given level
Date: Tue, 3 Mar 2020 08:02:03 -0800	[thread overview]
Message-ID: <20200303080203.4c6f2ae1@hermes.lan> (raw)
In-Reply-To: <20200303132512.4138303-1-ferruh.yigit@intel.com>

On Tue,  3 Mar 2020 13:25:12 +0000
Ferruh Yigit <ferruh.yigit@intel.com> 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?

  reply	other threads:[~2020-03-03 16:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 13:25 Ferruh Yigit
2020-03-03 16:02 ` Stephen Hemminger [this message]
2020-03-03 16:15   ` Ferruh Yigit
2020-03-03 18:18 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
2020-03-04  7:50   ` Hyong Youb Kim (hyonkim)
2020-03-04  8:41   ` Hemant Agrawal (OSS)
2020-03-12 13:41   ` David Marchand
2020-03-12 14:52     ` Ferruh Yigit
2020-03-13 14:51   ` [dpdk-dev] [PATCH v3] " Ferruh Yigit
2020-03-26 14:04     ` Andrzej Ostruszka
2020-03-27 10:23     ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200303080203.4c6f2ae1@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).