]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: vchiq_2835_arm: Reduce scope of i in free_pagelist
authorStefan Wahren <stefan.wahren@i2se.com>
Thu, 25 May 2017 22:26:12 +0000 (00:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 May 2017 15:02:29 +0000 (17:02 +0200)
We can reduce the scope of the counting variable i. This has
been found by CppCheck.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c

index d04db3f555192d58a9e1f0d9357b0b25578f1a91..9105545a365626aa3acd4f6c14a96b713fed38c8 100644 (file)
@@ -577,7 +577,6 @@ static void
 free_pagelist(struct vchiq_pagelist_info *pagelistinfo,
              int actual)
 {
-       unsigned int i;
        PAGELIST_T *pagelist   = pagelistinfo->pagelist;
        struct page **pages    = pagelistinfo->pages;
        unsigned int num_pages = pagelistinfo->num_pages;
@@ -633,6 +632,8 @@ free_pagelist(struct vchiq_pagelist_info *pagelistinfo,
        /* Need to mark all the pages dirty. */
        if (pagelist->type != PAGELIST_WRITE &&
            pagelistinfo->pages_need_release) {
+               unsigned int i;
+
                for (i = 0; i < num_pages; i++)
                        set_page_dirty(pages[i]);
        }