DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Shreyansh Jain <shreyansh.jain@nxp.com>, Rosen Xu <rosen.xu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"tianfei.zhang@intel.com" <tianfei.zhang@intel.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: Re: [dpdk-dev] [PATCH] drivers/raw/ifpga_rawdev: fix coverity issue 323508
Date: Tue, 23 Oct 2018 13:14:42 +0100	[thread overview]
Message-ID: <aab8e2de-857e-2f3a-8c84-bbfa354a69c9@intel.com> (raw)
In-Reply-To: <ca844202-cfd4-45d5-8c34-c96596ceffab@nxp.com>

On 10/23/2018 11:43 AM, Shreyansh Jain wrote:
> On Tuesday 23 October 2018 03:21 PM, Ferruh Yigit wrote:
>> On 10/23/2018 8:09 AM, Shreyansh Jain wrote:
>>> Besides the comment I sent before about 'Fixes' before sign-off, a
>>> single trivial comment inline ...
>>>
>>> On Tuesday 23 October 2018 07:20 AM, Rosen Xu wrote:
>>>> This patch fixes rte_eal_hotplug_add without checking return value issue
>>>>
>>>> Signed-off-by: Rosen Xu <rosen.xu@intel.com>
>>>> Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver")
>>>> Cc: rosen.xu@intel.com
>>>> ---
>>>>    drivers/raw/ifpga_rawdev/ifpga_rawdev.c | 5 +++--
>>>>    1 file changed, 3 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
>>>> index 3fed057..32e318f 100644
>>>> --- a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
>>>> +++ b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
>>>> @@ -542,6 +542,7 @@
>>>>    	int port;
>>>>    	char *name = NULL;
>>>>    	char dev_name[RTE_RAWDEV_NAME_MAX_LEN];
>>>> +	int ret = -1;
>>>>    
>>>>    	devargs = dev->device.devargs;
>>>>    
>>>> @@ -583,7 +584,7 @@
>>>>    	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
>>>>    	port, name);
>>>>    
>>>> -	rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
>>>> +	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
>>>>    			dev_name, devargs->args);
>>>
>>> Ideally, the function argument spreading on next line should start
>>> underneath the previous arguments - something like:
>>>
>>> 	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
>>> 				  dev_name, devargs->args);
>>
>> Hi Shreyansh,
>>
>> According dpdk coding convention [1], indentation done by hard tab, code seems
>> inline with coding convention, only perhaps can be done single tab instead of
>> double.
>>
>> And to remind again, I am not for syntax discussions but just defining one and
>> consistently follow it .
>>
>> [1]
>> https://doc.dpdk.org/guides/contributing/coding_style.html#c-indentation
>> https://doc.dpdk.org/guides/contributing/coding_style.html#prototypes
>>
> 
> Oh!. Thanks - something I had missed reading.
> 
> I don't want to hijack the conversation, but for my clarity, I think
> 
>  >>>    	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
>  >>>    	port, name);
> 
> won't be correct. Right?

You are right, it doesn't look correct.

> I am not suggesting that it should be changed now that it is already 
> part of code.
> 
>>>
>>> But, in this file this is not being done at multiple places (for
>>> example, the snprintf in this code snippet). So, either you can ignore
>>> this comment, or fix it for just this change.
>>>
>>>>    end:
>>>>    	if (kvlist)
>>>> @@ -591,7 +592,7 @@
>>>>    	if (name)
>>>>    		free(name);
>>>>    
>>>> -	return 0;
>>>> +	return ret;
>>>>    }
>>>>    
>>>>    static int
>>>>
>>>
>>> Otherwise, the patch is simple enough.
>>>
>>> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>>>
>>
> 

  reply	other threads:[~2018-10-23 12:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  1:50 Rosen Xu
2018-10-23  6:59 ` Shreyansh Jain
2018-10-23  7:09 ` Shreyansh Jain
2018-10-23  9:51   ` Ferruh Yigit
2018-10-23 10:43     ` Shreyansh Jain
2018-10-23 12:14       ` Ferruh Yigit [this message]
2018-10-25 10:25   ` Ferruh Yigit
2018-10-25 12:49     ` Xu, Rosen

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=aab8e2de-857e-2f3a-8c84-bbfa354a69c9@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=rosen.xu@intel.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=tianfei.zhang@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).