DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wodkowski, PawelX" <pawelx.wodkowski@intel.com>
To: Olivier MATZ <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/5] rte_timer: fix invalid declaration of rte_timer_cb_t
Date: Tue, 24 Feb 2015 11:12:52 +0000	[thread overview]
Message-ID: <F6F2A6264E145F47A18AB6DF8E87425D12BAD646@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <54EC54C5.2060002@6wind.com>



> -----Original Message-----
> From: Olivier MATZ [mailto:olivier.matz@6wind.com]
> Sent: Tuesday, February 24, 2015 11:39 AM
> To: Wodkowski, PawelX; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/5] rte_timer: fix invalid declaration of
> rte_timer_cb_t
> 
> Hi Pawel,
> 
> On 02/23/2015 03:09 PM, Pawel Wodkowski wrote:
> > Declaration for function pointer should be
> > typedef ret_type (*type_name)(args...)
> > not
> > typedef ret_type (type_name)(args...)
> >
> > although compiler treat both of them the same, the static analysis tool
> > like klocwork complain about that.
> 
> Can you give some details about the reason why klocwork is
> complaining?
> 
> Looking at the C11 standard, it seems that this syntax is
> legal. Please see EXAMPLE 4, page 156 of:
> http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1570.pdf
> 

Legal, might be. Problem is in using it. In struct rte_timer field 'f' if
declared as pointer to rte_timer_cb_t but  __rte_timer_reset() expects
rte_timer_cb_t. This have a little impact to real code but it is inconsistent
with declaration, definition and rest of the library where first syntax is used.
There are some places where second declaration is used but its usage there
is consistent with declaration.

I looked at the code in rest of library and for consistency I changed
typedef rather than function declaration.

Pawel

  reply	other threads:[~2015-02-24 11:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 14:09 [dpdk-dev] [PATCH 0/5] Fix issues reported by static analysis tool Pawel Wodkowski
2015-02-23 14:09 ` [dpdk-dev] [PATCH 1/5] rte_timer: fix invalid declaration of rte_timer_cb_t Pawel Wodkowski
2015-02-24 10:39   ` Olivier MATZ
2015-02-24 11:12     ` Wodkowski, PawelX [this message]
2015-02-24 12:36       ` Olivier MATZ
2015-02-23 14:09 ` [dpdk-dev] [PATCH 2/5] librte_kvargs: make rte_kvargs_free() be consistent with other "free()" functions Pawel Wodkowski
2015-02-24 11:30   ` Olivier MATZ
2015-02-23 14:09 ` [dpdk-dev] [PATCH 3/5] pmd ring: fix possible memory leak during devinit Pawel Wodkowski
2015-02-24 11:05   ` Olivier MATZ
2015-02-24 11:15     ` Pawel Wodkowski
2015-02-24 11:30       ` Olivier MATZ
2015-02-23 14:09 ` [dpdk-dev] [PATCH 4/5] cmdline: make parse_set_list() use size_t instead of int for low/high parameter Pawel Wodkowski
2015-02-24 11:05   ` Olivier MATZ
2015-02-23 14:10 ` [dpdk-dev] [PATCH 5/5] Fix usage of fgets in various places Pawel Wodkowski
2015-02-23 16:00   ` Stephen Hemminger
2015-02-24  9:20     ` Panu Matilainen
2015-02-24 19:01       ` Stephen Hemminger
2015-02-25  5:37         ` Panu Matilainen
2015-02-25 12:41 ` [dpdk-dev] [PATCH v2 0/4] Fix issues reported by static analysis tool Pawel Wodkowski
2015-02-25 12:41   ` [dpdk-dev] [PATCH v2 1/4] rte_timer: change declaration of rte_timer_cb_t Pawel Wodkowski
2015-02-25 12:41   ` [dpdk-dev] [PATCH v2 2/4] librte_kvargs: make rte_kvargs_free() be consistent with other "free()" functions Pawel Wodkowski
2015-02-25 12:41   ` [dpdk-dev] [PATCH v2 3/4] pmd ring: fix possible memory leak during devinit Pawel Wodkowski
2015-02-25 12:41   ` [dpdk-dev] [PATCH v2 4/4] cmdline: make parse_set_list() use size_t instead of int for low/high parameter Pawel Wodkowski
2015-02-27 13:28   ` [dpdk-dev] [PATCH v2 0/4] Fix issues reported by static analysis tool Olivier MATZ
2015-03-04 10:27     ` Thomas Monjalon

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=F6F2A6264E145F47A18AB6DF8E87425D12BAD646@IRSMSX102.ger.corp.intel.com \
    --to=pawelx.wodkowski@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    /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).