Skip to content

Commit

Permalink
nfc: st-nci: remove unnecessary assignment and label
Browse files Browse the repository at this point in the history
In function st_nci_hci_network_init, the variable r is assigned then
goto exit label, which just return r, so we use return to replace it.
and exit label only used once at here, so we remove exit label.

Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
wengjianfeng authored and David S. Miller committed May 24, 2021
1 parent ec7d6dd commit 62f148d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/nfc/st-nci/se.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,8 @@ static int st_nci_hci_network_init(struct nci_dev *ndev)
dest_params =
kzalloc(sizeof(struct core_conn_create_dest_spec_params) +
sizeof(struct dest_spec_params), GFP_KERNEL);
if (dest_params == NULL) {
r = -ENOMEM;
goto exit;
}
if (dest_params == NULL)
return -ENOMEM;

dest_params->type = NCI_DESTINATION_SPECIFIC_PARAM_NFCEE_TYPE;
dest_params->length = sizeof(struct dest_spec_params);
Expand Down Expand Up @@ -594,8 +592,6 @@ static int st_nci_hci_network_init(struct nci_dev *ndev)

free_dest_params:
kfree(dest_params);

exit:
return r;
}

Expand Down

0 comments on commit 62f148d

Please sign in to comment.