DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Wiles, Keith" <keith.wiles@intel.com>, DPDK <dev@dpdk.org>
Subject: Re: [dpdk-dev] Fwd: |WARNING| pw23442 [PATCH] net/tap: add support for fixed mac addresses
Date: Tue, 11 Apr 2017 09:29:30 +0100	[thread overview]
Message-ID: <764c030e-ac67-da9c-53d3-0fd311b17469@intel.com> (raw)
In-Reply-To: <1B5FAA53-FFB2-44D4-8A08-3EEC17D3761E@intel.com>

On 4/10/2017 7:29 PM, Wiles, Keith wrote:
> 
> 
> Begin forwarded message:
> 
> From: <checkpatch@dpdk.org<mailto:checkpatch@dpdk.org>>
> Subject: |WARNING| pw23442 [PATCH] net/tap: add support for fixed mac addresses
> Date: April 10, 2017 at 1:20:18 PM CDT
> To: <test-report@dpdk.org<mailto:test-report@dpdk.org>>
> Cc: Keith Wiles <keith.wiles@intel.com<mailto:keith.wiles@intel.com>>
> 
> Test-Label: checkpatch
> Test-Status: WARNING
> http://dpdk.org/patch/23442
> 
> _coding style issues_
> 
> 
> CHECK:BRACES: braces {} should be used on all arms of this statement
> #100: FILE: drivers/net/tap/rte_eth_tap.c:1242:
> + if (fixed_mac_type) {
> [...]
> + } else
> [...]
> 
> CHECK:BRACES: Unbalanced braces around else statement
> #109: FILE: drivers/net/tap/rte_eth_tap.c:1251:
> + } else
> 
> total: 0 errors, 0 warnings, 2 checks, 123 lines checked
> 
> Got the above error running checkpatch locally then got the email above and I assumed this warning can be ignored is this the case?

Linux requires, if "if" or "else" part is multi-line, both block should
use brackets, that is the reason of the warning.

But DPDK does not requires this:
http://dpdk.org/doc/guides/contributing/coding_style.html#control-statements-and-loops

For DPDK, this is free to ignore.

> 
> Code that caused the warning:
> 
> } else {
> if (fixed_mac_type) {
> static int iface_idx;
> 
> pmd->eth_addr.addr_bytes[0] = 0x00;
> pmd->eth_addr.addr_bytes[1] = 'd';
> pmd->eth_addr.addr_bytes[2] = 't';
> pmd->eth_addr.addr_bytes[3] = 'a';
> pmd->eth_addr.addr_bytes[4] = 'p';
> pmd->eth_addr.addr_bytes[5] = 0 + iface_idx++;
> } else
> eth_random_addr((uint8_t *)&pmd->eth_addr);     <<<<<
> }
> 
> Regards,
> Keith
> 

      reply	other threads:[~2017-04-11  8:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170410182018.918882C1A@dpdk.org>
2017-04-10 18:29 ` Wiles, Keith
2017-04-11  8:29   ` Ferruh Yigit [this message]

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=764c030e-ac67-da9c-53d3-0fd311b17469@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.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).