From: Qi Zhang Subject: [PATCH 09/17] net/fm10k/base: update comment regarding reserved bits check Date: Thu, 2 Mar 2017 22:17:19 -0500 Message-ID: <20170303031727.461-10-qi.z.zhang@intel.com> References: <20170303031727.461-1-qi.z.zhang@intel.com> Cc: helin.zhang@intel.com, dev@dpdk.org, Qi Zhang To: jing.d.chen@intel.com Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9F4ED37B0 for ; Fri, 3 Mar 2017 03:26:46 +0100 (CET) In-Reply-To: <20170303031727.461-1-qi.z.zhang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The original comment may be read incorrectly as referring to checking the *entire* length is zero. However, it merely checks only the reserved bits of both length and reserved in a small amount of code. Update the comment to indicate this is a clever trick and clearly spell out that it only checks the reserve bits. Signed-off-by: Qi Zhang --- drivers/net/fm10k/base/fm10k_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/fm10k/base/fm10k_vf.c b/drivers/net/fm10k/base/fm10k_vf.c index 533dfeb..dd3d318 100644 --- a/drivers/net/fm10k/base/fm10k_vf.c +++ b/drivers/net/fm10k/base/fm10k_vf.c @@ -225,7 +225,7 @@ STATIC s32 fm10k_update_vlan_vf(struct fm10k_hw *hw, u32 vid, u8 vsi, bool set) if (vsi) return FM10K_ERR_PARAM; - /* verify upper 4 bits of vid and length are 0 */ + /* clever trick to verify reserved bits in both vid and length */ if ((vid << 16 | vid) >> 28) return FM10K_ERR_PARAM; -- 2.9.3