DPDK patches and discussions
 help / color / mirror / Atom feed
From: Li Han <han.li1@zte.com.cn>
To: qi.z.zhang@intel.com
Cc: dev@dpdk.org, Li Han <han.li1@zte.com.cn>
Subject: [dpdk-dev] [PATCH] drivers/net/i40e/:remove i40e_nvmupd_command redundant code
Date: Thu, 27 Sep 2018 03:26:30 -0400	[thread overview]
Message-ID: <1538033190-2884-1-git-send-email-han.li1@zte.com.cn> (raw)

in function i40e_nvmupd_validate_command, when "cmd->data_size < 1"
it'll return I40E_NVMUPD_INVALID,and in function "i40e_nvmupd_command"
when "upd_cmd == I40E_NVMUPD_STATUS",it check "!cmd->data_size" again,
but it's no need.

Signed-off-by: Li Han <han.li1@zte.com.cn>
---
 drivers/net/i40e/base/i40e_nvm.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c
index c77dac0..5de22e4 100644
--- a/drivers/net/i40e/base/i40e_nvm.c
+++ b/drivers/net/i40e/base/i40e_nvm.c
@@ -869,11 +869,6 @@ enum i40e_status_code i40e_nvmupd_command(struct i40e_hw *hw,
 	 * going into the state machine
 	 */
 	if (upd_cmd == I40E_NVMUPD_STATUS) {
-		if (!cmd->data_size) {
-			*perrno = -EFAULT;
-			return I40E_ERR_BUF_TOO_SHORT;
-		}
-
 		bytes[0] = hw->nvmupd_state;
 
 		if (cmd->data_size >= 4) {
-- 
1.8.3.1

             reply	other threads:[~2018-09-27  7:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27  7:26 Li Han [this message]
2018-09-30  2:12 ` Zhang, Qi Z

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=1538033190-2884-1-git-send-email-han.li1@zte.com.cn \
    --to=han.li1@zte.com.cn \
    --cc=dev@dpdk.org \
    --cc=qi.z.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).