From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id DDE102B87 for ; Tue, 11 Apr 2017 10:29:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491899379; x=1523435379; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=Z0i0DqFcWGwSDEG76x9PWJlh2S18DxV3236JqEjEuvY=; b=ukiIGPk6MoEgZepJfSNNPeBRb/5UsE+gH9JntAuCOZwtHUrRgTBwlBI8 cVQQpgnSoHOe5/zVDB8p4OuYBGfF/Q==; Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2017 01:29:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,184,1488873600"; d="scan'208";a="1133863581" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.122]) ([10.237.220.122]) by fmsmga001.fm.intel.com with ESMTP; 11 Apr 2017 01:29:30 -0700 To: "Wiles, Keith" , DPDK References: <20170410182018.918882C1A@dpdk.org> <1B5FAA53-FFB2-44D4-8A08-3EEC17D3761E@intel.com> From: Ferruh Yigit Message-ID: <764c030e-ac67-da9c-53d3-0fd311b17469@intel.com> Date: Tue, 11 Apr 2017 09:29:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <1B5FAA53-FFB2-44D4-8A08-3EEC17D3761E@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] Fwd: |WARNING| pw23442 [PATCH] net/tap: add support for fixed mac addresses 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: , X-List-Received-Date: Tue, 11 Apr 2017 08:29:39 -0000 On 4/10/2017 7:29 PM, Wiles, Keith wrote: > > > Begin forwarded message: > > From: > > Subject: |WARNING| pw23442 [PATCH] net/tap: add support for fixed mac addresses > Date: April 10, 2017 at 1:20:18 PM CDT > To: > > Cc: Keith Wiles > > > 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 >