* [Qemu-devel] [PATCH] hw/block/onenand: Remove dead code block
@ 2017-10-03 9:57 Thomas Huth
2017-10-03 10:25 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2017-10-03 9:57 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-block, qemu-trivial, Kevin Wolf, Max Reitz
The condition of the for-loop makes sure that b is always smaller
than s->blocks, so the "if (b >= s->blocks)" statement is completely
superfluous here.
Buglink: https://bugs.launchpad.net/qemu/+bug/1715007
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/block/onenand.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index 30e40f3..de65c9e 100644
--- a/hw/block/onenand.c
+++ b/hw/block/onenand.c
@@ -520,10 +520,6 @@ static void onenand_command(OneNANDState *s)
s->intstatus |= ONEN_INT;
for (b = 0; b < s->blocks; b ++) {
- if (b >= s->blocks) {
- s->status |= ONEN_ERR_CMD;
- break;
- }
if (s->blockwp[b] == ONEN_LOCK_LOCKTIGHTEN)
break;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH] hw/block/onenand: Remove dead code block
2017-10-03 9:57 [Qemu-devel] [PATCH] hw/block/onenand: Remove dead code block Thomas Huth
@ 2017-10-03 10:25 ` Laurent Vivier
2017-10-04 15:10 ` Kevin Wolf
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2017-10-03 10:25 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: qemu-trivial, Kevin Wolf, qemu-block, Max Reitz
On 03/10/2017 11:57, Thomas Huth wrote:
> The condition of the for-loop makes sure that b is always smaller
> than s->blocks, so the "if (b >= s->blocks)" statement is completely
> superfluous here.
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1715007
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/block/onenand.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/hw/block/onenand.c b/hw/block/onenand.c
> index 30e40f3..de65c9e 100644
> --- a/hw/block/onenand.c
> +++ b/hw/block/onenand.c
> @@ -520,10 +520,6 @@ static void onenand_command(OneNANDState *s)
> s->intstatus |= ONEN_INT;
>
> for (b = 0; b < s->blocks; b ++) {
> - if (b >= s->blocks) {
> - s->status |= ONEN_ERR_CMD;
> - break;
> - }
> if (s->blockwp[b] == ONEN_LOCK_LOCKTIGHTEN)
> break;
>
>
Looks like a bad cut'n'paste from case 0x23.
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH] hw/block/onenand: Remove dead code block
2017-10-03 10:25 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
@ 2017-10-04 15:10 ` Kevin Wolf
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2017-10-04 15:10 UTC (permalink / raw)
To: Laurent Vivier
Cc: Thomas Huth, qemu-devel, qemu-trivial, qemu-block, Max Reitz
Am 03.10.2017 um 12:25 hat Laurent Vivier geschrieben:
> On 03/10/2017 11:57, Thomas Huth wrote:
> > The condition of the for-loop makes sure that b is always smaller
> > than s->blocks, so the "if (b >= s->blocks)" statement is completely
> > superfluous here.
> >
> > Buglink: https://bugs.launchpad.net/qemu/+bug/1715007
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> > hw/block/onenand.c | 4 ----
> > 1 file changed, 4 deletions(-)
> >
> > diff --git a/hw/block/onenand.c b/hw/block/onenand.c
> > index 30e40f3..de65c9e 100644
> > --- a/hw/block/onenand.c
> > +++ b/hw/block/onenand.c
> > @@ -520,10 +520,6 @@ static void onenand_command(OneNANDState *s)
> > s->intstatus |= ONEN_INT;
> >
> > for (b = 0; b < s->blocks; b ++) {
> > - if (b >= s->blocks) {
> > - s->status |= ONEN_ERR_CMD;
> > - break;
> > - }
> > if (s->blockwp[b] == ONEN_LOCK_LOCKTIGHTEN)
> > break;
> >
> >
>
> Looks like a bad cut'n'paste from case 0x23.
>
> Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-04 15:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 9:57 [Qemu-devel] [PATCH] hw/block/onenand: Remove dead code block Thomas Huth
2017-10-03 10:25 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2017-10-04 15:10 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).