mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen Zhou <chenzhou10@huawei.com>
To: tanhuazhong <tanhuazhong@huawei.com>, <yisen.zhuang@huawei.com>,
	<salil.mehta@huawei.com>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] net: hns3: replace snprintf with scnprintf in hns3_dbg_cmd_read
Date: Mon, 20 Jan 2020 10:37:01 +0800	[thread overview]
Message-ID: <dbd54fd8-b356-18a2-cb16-ad3aaaa933ca@huawei.com> (raw)
In-Reply-To: <2e1ab30a-af35-6bc6-f880-a3051375a6a8@huawei.com>



On 2020/1/20 9:28, tanhuazhong wrote:
> 
> 
> On 2020/1/19 20:41, Chen Zhou wrote:
>> The return value of snprintf may be greater than the size of
>> HNS3_DBG_READ_LEN, use scnprintf instead in hns3_dbg_cmd_read.
>>
>> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
>> ---
>>   drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
>> index 6b328a2..8fad699 100644
>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
>> @@ -297,7 +297,7 @@ static ssize_t hns3_dbg_cmd_read(struct file *filp, char __user *buffer,
>>       if (!buf)
>>           return -ENOMEM;
>>   -    len = snprintf(buf, HNS3_DBG_READ_LEN, "%s\n",
>> +    len = scnprintf(buf, HNS3_DBG_READ_LEN, "%s\n",
>>                  "Please echo help to cmd to get help information");
> 
> not align?

Ok, i will fix in next version.

Thanks,
Chen Zhou

> 
>>       uncopy_bytes = copy_to_user(buffer, buf, len);
>>  
> 
> 
> .
> 


      reply	other threads:[~2020-01-20  2:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-19 12:41 Chen Zhou
2020-01-20  1:28 ` tanhuazhong
2020-01-20  2:37   ` Chen Zhou [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=dbd54fd8-b356-18a2-cb16-ad3aaaa933ca@huawei.com \
    --to=chenzhou10@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=tanhuazhong@huawei.com \
    --cc=yisen.zhuang@huawei.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

all inboxes | Powered by JetHome®