Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1544548 > unrolled thread
| Started by | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| First post | 2016-12-19 15:10 +0100 |
| Last post | 2016-12-29 20:10 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 1/2] mmc: block: Avoid uninitialized warning in mmc_blk_issue_discard_rq() Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-19 15:10 +0100
Re: [PATCH 1/2] mmc: block: Avoid uninitialized warning in mmc_blk_issue_discard_rq() Ulf Hansson <ulf.hansson@linaro.org> - 2016-12-29 20:10 +0100
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| Date | 2016-12-19 15:10 +0100 |
| Subject | [PATCH 1/2] mmc: block: Avoid uninitialized warning in mmc_blk_issue_discard_rq() |
| Message-ID | <sQ6Nz-lK-9@gated-at.bofh.it> |
With gcc-4.1.2:
mmc/core/block.c: In function ‘mmc_blk_issue_discard_rq’:
mmc/core/block.c:1150: warning: ‘arg’ may be used uninitialized in this function
mmc/core/block.c:1150: warning: ‘nr’ may be used uninitialized in this function
mmc/core/block.c:1150: warning: ‘from’ may be used uninitialized in this function
While this is a false positive, it can be avoided easily by jumping over
the checks for "err" that are always false.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/mmc/core/block.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index bab3f07b1117ea81..8c0e0833d481cf94 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1152,7 +1152,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
if (!mmc_can_erase(card)) {
err = -EOPNOTSUPP;
- goto out;
+ goto fail;
}
from = blk_rq_pos(req);
@@ -1181,6 +1181,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
goto retry;
if (!err)
mmc_blk_reset_success(md, type);
+fail:
blk_end_request(req, err, blk_rq_bytes(req));
return err ? 0 : 1;
--
1.9.1
[toc] | [next] | [standalone]
| From | Ulf Hansson <ulf.hansson@linaro.org> |
|---|---|
| Date | 2016-12-29 20:10 +0100 |
| Message-ID | <sTOfo-28p-13@gated-at.bofh.it> |
| In reply to | #1544548 |
On 19 December 2016 at 15:03, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> With gcc-4.1.2:
>
> mmc/core/block.c: In function ‘mmc_blk_issue_discard_rq’:
> mmc/core/block.c:1150: warning: ‘arg’ may be used uninitialized in this function
> mmc/core/block.c:1150: warning: ‘nr’ may be used uninitialized in this function
> mmc/core/block.c:1150: warning: ‘from’ may be used uninitialized in this function
>
> While this is a false positive, it can be avoided easily by jumping over
> the checks for "err" that are always false.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Thanks, applied for next!
Kind regards
Uffe
> ---
> drivers/mmc/core/block.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index bab3f07b1117ea81..8c0e0833d481cf94 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -1152,7 +1152,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
>
> if (!mmc_can_erase(card)) {
> err = -EOPNOTSUPP;
> - goto out;
> + goto fail;
> }
>
> from = blk_rq_pos(req);
> @@ -1181,6 +1181,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
> goto retry;
> if (!err)
> mmc_blk_reset_success(md, type);
> +fail:
> blk_end_request(req, err, blk_rq_bytes(req));
>
> return err ? 0 : 1;
> --
> 1.9.1
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web