summaryrefslogtreecommitdiff
path: root/boot/vbe_simple.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-08-23 11:31:56 +0300
committerSimon Glass <sjg@chromium.org>2022-08-27 01:32:59 +0300
commit49740e02555f72394fb319a8221bad833d8207db (patch)
treeff51888002e1acb78ef111fa00bc50b6a924a63a /boot/vbe_simple.c
parentd81eeacd48f760516abf12e69aba4ce5dd44545f (diff)
downloadu-boot-49740e02555f72394fb319a8221bad833d8207db.tar.xz
boot: simplify bootmeth_vbe_simple_ft_fixup()
Don't assign a value to a variable if it is not used afterwards. Move variables to the code fragment where they are used. Addresses-Coverity: CID 356243 ("Code maintainability issues (UNUSED_VALUE)") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/vbe_simple.c')
-rw-r--r--boot/vbe_simple.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/boot/vbe_simple.c b/boot/vbe_simple.c
index a395bc20a6..0fc57388f3 100644
--- a/boot/vbe_simple.c
+++ b/boot/vbe_simple.c
@@ -225,17 +225,16 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event)
{
oftree tree = event->data.ft_fixup.tree;
struct udevice *dev;
- ofnode node;
- int ret;
/*
* Ideally we would have driver model support for fixups, but that does
* not exist yet. It is a step too far to try to do this before VBE is
* in place.
*/
- for (ret = vbe_find_first_device(&dev); dev;
- ret = vbe_find_next_device(&dev)) {
+ for (vbe_find_first_device(&dev); dev; vbe_find_next_device(&dev)) {
struct simple_state state;
+ ofnode node;
+ int ret;
if (strcmp("vbe_simple", dev->driver->name))
continue;