diff mbox series

net/nfc/nic: refined function nci_hci_resp_received

Message ID 1605239517-49707-1-git-send-email-alex.shi@linux.alibaba.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series net/nfc/nic: refined function nci_hci_resp_received | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 1 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 26 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Alex Shi Nov. 13, 2020, 3:51 a.m. UTC
We don't use the parameter result actually, so better to remove it and
skip a gcc warning for unused variable.

Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>
Cc: "David S. Miller" <davem@davemloft.net> 
Cc: Jakub Kicinski <kuba@kernel.org> 
Cc: netdev@vger.kernel.org 
Cc: linux-kernel@vger.kernel.org 
---
 net/nfc/nci/hci.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Jakub Kicinski Nov. 15, 2020, 12:54 a.m. UTC | #1
You had a typo in the subject nic -> nci. But really nfc: would be
enough.

On Fri, 13 Nov 2020 11:51:57 +0800 Alex Shi wrote:
> We don't use the parameter result actually, so better to remove it and
> skip a gcc warning for unused variable.
> 
> Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>

Let's CC the nfc list.

nfc folks any reason the list is not mentioned under NFC SUBSYSTEM?

> diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
> index c18e76d6d8ba..6b275a387a92 100644
> --- a/net/nfc/nci/hci.c
> +++ b/net/nfc/nci/hci.c
> @@ -363,16 +363,13 @@ static void nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe,
>  }
>  
>  static void nci_hci_resp_received(struct nci_dev *ndev, u8 pipe,
> -				  u8 result, struct sk_buff *skb)
> +				  struct sk_buff *skb)
>  {
>  	struct nci_conn_info    *conn_info;
> -	u8 status = result;
>  
>  	conn_info = ndev->hci_dev->conn_info;
> -	if (!conn_info) {
> -		status = NCI_STATUS_REJECTED;
> +	if (!conn_info)
>  		goto exit;
> -	}
>  
>  	conn_info->rx_skb = skb;
>  

LGTM based on the fact that commit d8cd37ed2fc8 ("NFC: nci: Fix improper
management of HCI return code") started seemingly intentionally ignoring 
the status.

Applied, thanks!
diff mbox series

Patch

diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index c18e76d6d8ba..6b275a387a92 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -363,16 +363,13 @@  static void nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe,
 }
 
 static void nci_hci_resp_received(struct nci_dev *ndev, u8 pipe,
-				  u8 result, struct sk_buff *skb)
+				  struct sk_buff *skb)
 {
 	struct nci_conn_info    *conn_info;
-	u8 status = result;
 
 	conn_info = ndev->hci_dev->conn_info;
-	if (!conn_info) {
-		status = NCI_STATUS_REJECTED;
+	if (!conn_info)
 		goto exit;
-	}
 
 	conn_info->rx_skb = skb;
 
@@ -388,7 +385,7 @@  static void nci_hci_hcp_message_rx(struct nci_dev *ndev, u8 pipe,
 {
 	switch (type) {
 	case NCI_HCI_HCP_RESPONSE:
-		nci_hci_resp_received(ndev, pipe, instruction, skb);
+		nci_hci_resp_received(ndev, pipe, skb);
 		break;
 	case NCI_HCI_HCP_COMMAND:
 		nci_hci_cmd_received(ndev, pipe, instruction, skb);