From patchwork Fri Sep 29 08:50:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 727617 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp333217wrt; Fri, 29 Sep 2023 01:56:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFgU9W3bgaQ544HL0neiwgAc1Ydn73SEHaZY2+OW+zfO7naG/Vd4Zjkahgm7CroMQjc/Na X-Received: by 2002:ac8:7f0f:0:b0:417:a469:1680 with SMTP id f15-20020ac87f0f000000b00417a4691680mr3725551qtk.38.1695977805792; Fri, 29 Sep 2023 01:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695977805; cv=none; d=google.com; s=arc-20160816; b=ox4244X5RKz88x12SJvc1sMuKHZlRt//dBpqOSZhX3EefpawOTE+KlU+9URtPl2pu0 lLXFB9a12XqlP9uVADvjzcE83dHKqDAdo/C45YHF+vkRKd53/4z2giU+/HmcXijWBdMX Vlbz0Zd9FcT0LtnicSsq9Hjwr+Gb1nrHpUV8ipGc/ZIW9VgcuEuzVT4p+iCYl83WTwHw JBMZaorxrRmi0YlMh6kKZqPFAySIJIVW/KQ5q0jbdisUNiuQFnvu0hy6iQHuhL66x0lF O9YE8zUNgWuiwsb5cjVx8UE7vYH++VkzAVNkFiae9PwpUoltcVss3fEigdT4p2buj36g 6DMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7UV48sbdVMGeVoWJq1kENky0JQ2CPBfQXeo/C7cSXh8=; fh=5iGHHmEytlxi795Jw182k0/nUrkiSXWvul28mVK7agk=; b=GmmaYV18OQOPnrRaulZarvPDCVS9s5R87p6OnY6IJ26jtUxAH4SXNwCR5d3f1CpaXf QMEC/6XCLW1qm0QUw9pHXLmIaHEizNa+kQHY8+BixmxmXcbQKu97O/LEJil6w/D9AuoI fMu/cFV2A4oC48fwBOOFZt/xbm4Zbcvty5zSJGm255Xlad1kTbzo85ZIdLxx2foFEl9Y yNHyYZC4j8XXxdDdkieF5xksTt+/qKgzdKN7JYeXfsP59/5+TwPR0r93IypjF9rqhuAy ipZ/I4B5Tg6emrMZF16ZAssRfgIT9dFOzadOXfr6T6BVUAMygiC4Z+t1EVzfVaa3505q 9OhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XY3aWqCY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m17-20020a05622a055100b00417d9251452si5403597qtx.770.2023.09.29.01.56.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Sep 2023 01:56:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XY3aWqCY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dl-0005J2-Bq; Fri, 29 Sep 2023 04:51:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9Dc-0005Bp-FF for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DE-0005cP-T2 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7UV48sbdVMGeVoWJq1kENky0JQ2CPBfQXeo/C7cSXh8=; b=XY3aWqCY+N71Qt32+G/w+aL7ldDcN60kahxEYPGj4fxsqxaf/Sn5Tt0Nosamdyi8olRWyq vJcakSBmCMz0hBVxdwxXuRjqO7iPXRAdaQFW88l80TBjt0fW6nTAJca3j0MnjT9HoiSwdV VKAbH5znI87tFInOmz+V5NEvqtAoqbY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-310-ciDaImPKPEi6iFP2pYk-5Q-1; Fri, 29 Sep 2023 04:50:57 -0400 X-MC-Unique: ciDaImPKPEi6iFP2pYk-5Q-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B66C4811E86; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93827492B16; Fri, 29 Sep 2023 08:50:56 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9A4F021E688B; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P_=2E_Berrang=C3=A9?= , Peter Xu Subject: [PULL 26/56] softmmu/physmem: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:23 +0200 Message-ID: <20230929085053.2789105-27-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Fix: softmmu/physmem.c: In function ‘cpu_physical_memory_snapshot_and_clear_dirty’: softmmu/physmem.c:916:27: warning: declaration of ‘offset’ shadows a parameter [-Wshadow=compatible-local] 916 | unsigned long offset = page % DIRTY_MEMORY_BLOCK_SIZE; | ^~~~~~ softmmu/physmem.c:892:31: note: shadowed declaration is here 892 | (MemoryRegion *mr, hwaddr offset, hwaddr length, unsigned client) | ~~~~~~~^~~~~~ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20230904161235.84651-23-philmd@linaro.org> Reviewed-by: Daniel P. Berrangé Reviewed-by: Peter Xu Signed-off-by: Markus Armbruster --- softmmu/physmem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 4f6ca653b3..309653c722 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -913,16 +913,16 @@ DirtyBitmapSnapshot *cpu_physical_memory_snapshot_and_clear_dirty while (page < end) { unsigned long idx = page / DIRTY_MEMORY_BLOCK_SIZE; - unsigned long offset = page % DIRTY_MEMORY_BLOCK_SIZE; + unsigned long ofs = page % DIRTY_MEMORY_BLOCK_SIZE; unsigned long num = MIN(end - page, - DIRTY_MEMORY_BLOCK_SIZE - offset); + DIRTY_MEMORY_BLOCK_SIZE - ofs); - assert(QEMU_IS_ALIGNED(offset, (1 << BITS_PER_LEVEL))); + assert(QEMU_IS_ALIGNED(ofs, (1 << BITS_PER_LEVEL))); assert(QEMU_IS_ALIGNED(num, (1 << BITS_PER_LEVEL))); - offset >>= BITS_PER_LEVEL; + ofs >>= BITS_PER_LEVEL; bitmap_copy_and_clear_atomic(snap->dirty + dest, - blocks->blocks[idx] + offset, + blocks->blocks[idx] + ofs, num); page += num; dest += num >> BITS_PER_LEVEL;