Message ID | 20210726032917.30076-1-samirweng1979@163.com (mailing list archive) |
---|---|
State | Accepted |
Commit | a0302ff5906ac021d1d79cecd7b710970e40e588 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | nfc: s3fwrn5: remove unnecessary label | expand |
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/cc_maintainers | success | CCed 3 of 3 maintainers |
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: 0 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, 49 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
On 26/07/2021 05:29, samirweng1979 wrote: > From: wengjianfeng <wengjianfeng@yulong.com> > > Simplify the code by removing unnecessary label and returning directly. > > Signed-off-by: wengjianfeng <wengjianfeng@yulong.com> > --- > drivers/nfc/s3fwrn5/firmware.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Best regards, Krzysztof > diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c > index eb5d7a5b..1421ffd 100644 > --- a/drivers/nfc/s3fwrn5/firmware.c > +++ b/drivers/nfc/s3fwrn5/firmware.c > @@ -421,10 +421,9 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) > > tfm = crypto_alloc_shash("sha1", 0, 0); > if (IS_ERR(tfm)) { > - ret = PTR_ERR(tfm); > dev_err(&fw_info->ndev->nfc_dev->dev, > "Cannot allocate shash (code=%d)\n", ret); > - goto out; > + return PTR_ERR(tfm); > } > > ret = crypto_shash_tfm_digest(tfm, fw->image, image_size, hash_data); > @@ -433,7 +432,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) > if (ret) { > dev_err(&fw_info->ndev->nfc_dev->dev, > "Cannot compute hash (code=%d)\n", ret); > - goto out; > + return ret; > } > > /* Firmware update process */ > @@ -446,7 +445,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) > if (ret < 0) { > dev_err(&fw_info->ndev->nfc_dev->dev, > "Unable to enter update mode\n"); > - goto out; > + return ret; > } > > for (off = 0; off < image_size; off += fw_info->sector_size) { > @@ -455,7 +454,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) > if (ret < 0) { > dev_err(&fw_info->ndev->nfc_dev->dev, > "Firmware update error (code=%d)\n", ret); > - goto out; > + return ret; > } > } > > @@ -463,13 +462,12 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) > if (ret < 0) { > dev_err(&fw_info->ndev->nfc_dev->dev, > "Unable to complete update mode\n"); > - goto out; > + return ret; > } > > dev_info(&fw_info->ndev->nfc_dev->dev, > "Firmware update: success\n"); > > -out: > return ret; > } > >
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Mon, 26 Jul 2021 11:29:17 +0800 you wrote: > From: wengjianfeng <wengjianfeng@yulong.com> > > Simplify the code by removing unnecessary label and returning directly. > > Signed-off-by: wengjianfeng <wengjianfeng@yulong.com> > --- > drivers/nfc/s3fwrn5/firmware.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) Here is the summary with links: - nfc: s3fwrn5: remove unnecessary label https://git.kernel.org/netdev/net-next/c/a0302ff5906a You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c index eb5d7a5b..1421ffd 100644 --- a/drivers/nfc/s3fwrn5/firmware.c +++ b/drivers/nfc/s3fwrn5/firmware.c @@ -421,10 +421,9 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) tfm = crypto_alloc_shash("sha1", 0, 0); if (IS_ERR(tfm)) { - ret = PTR_ERR(tfm); dev_err(&fw_info->ndev->nfc_dev->dev, "Cannot allocate shash (code=%d)\n", ret); - goto out; + return PTR_ERR(tfm); } ret = crypto_shash_tfm_digest(tfm, fw->image, image_size, hash_data); @@ -433,7 +432,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) if (ret) { dev_err(&fw_info->ndev->nfc_dev->dev, "Cannot compute hash (code=%d)\n", ret); - goto out; + return ret; } /* Firmware update process */ @@ -446,7 +445,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) if (ret < 0) { dev_err(&fw_info->ndev->nfc_dev->dev, "Unable to enter update mode\n"); - goto out; + return ret; } for (off = 0; off < image_size; off += fw_info->sector_size) { @@ -455,7 +454,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) if (ret < 0) { dev_err(&fw_info->ndev->nfc_dev->dev, "Firmware update error (code=%d)\n", ret); - goto out; + return ret; } } @@ -463,13 +462,12 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info) if (ret < 0) { dev_err(&fw_info->ndev->nfc_dev->dev, "Unable to complete update mode\n"); - goto out; + return ret; } dev_info(&fw_info->ndev->nfc_dev->dev, "Firmware update: success\n"); -out: return ret; }