From nobody Sat May 18 19:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695653339; cv=none; d=zohomail.com; s=zohoarc; b=hT3vZFEdRNo20pYl3ZT85ulKZbdv11iH23YDufKZ5CG3Qc5yoCp0kXQLPKIGQfdgo+LsBNKOf1+jtOVcD300BIr8PmU9WsrWk9IaGIn7xK04SDubRlf+IXReENXu0AG8xyzGcFXpbPJNSjE5LcDHYUrk2eV5KHRGB8GuGrZhUVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653339; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=+ynynMgJ00sGhsDMCQzVUy7jtIudZ5+n2/lNWTNS1uM=; b=S9NjNvlQFxfog3mn0LN7EAA/hKlRJjryZATZueMJc6VRjc0krp3S/FLGFwFPDBSVE1YJ83fM6v7zC1wE3EyHnuLT6KljLFetrTFJZCoDBFOhSriMdCRk/7NJzN1e920NqbFYWFLQBPXHx8IVVqpE6Twp4pjBIMqTg9Cx8JKmbS0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653339284776.6741831789717; Mon, 25 Sep 2023 07:48:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmsi-0000cq-B2; Mon, 25 Sep 2023 10:48:16 -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 1qkmsN-0000ZV-Ow for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:48:07 -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 1qkmsJ-00082F-VW for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:47:54 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-262-zkE0yReDMQmgee56BUZRgQ-1; Mon, 25 Sep 2023 10:47:48 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4053d832d51so49356865e9.0 for ; Mon, 25 Sep 2023 07:47:48 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id 23-20020a05600c229700b00403b63e87f2sm12556827wmf.32.2023.09.25.07.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695653270; 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; bh=+ynynMgJ00sGhsDMCQzVUy7jtIudZ5+n2/lNWTNS1uM=; b=DmeLFmXQgfzeLvS3qIyH8hDp5+lip20NAhKHTNKZgsyZWFdE/PUZFbZp5CV2Fgs2sYTtyy tfWga+JNkxqImS1Ok/W4+X8l2/sfG8vz7RZIjYSI6gmyKdqybo+kRRDVLE6uzLXSql+l8r tL+t4LAqIjiotnA6K+pOCUuwY1QXpn0= X-MC-Unique: zkE0yReDMQmgee56BUZRgQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653266; x=1696258066; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+ynynMgJ00sGhsDMCQzVUy7jtIudZ5+n2/lNWTNS1uM=; b=ebM89zmxcYjAmMlpFb3eGzGSb/OVpp1Lvm9OW8rAF6HiCsi0jaUR/TUsGsAaIryZYW rEv1Tt3tXtUWTkceJ4c/CJgfjnH0BgABvDzlmAsNqWkRZ7vUtF5KcQ75kpzOk8BudJi3 NypcNhVnFVTSlV9QTJqgBImR8toXnXcRwT5vJue2woxB/WkHj7DqT49+UgoBSCZxXEBo WmKsI6BICQ8f4ARtHdglRfHYGitcg2YFshqUBBfieVGbANKft/5KYP1n+S71eFZpWM6i frJ2nUV032HLadvbbYsieOdSgZ+qp/QnyCztIDB6RQRZZDyOjK29dYUTXu3EHnarTyzp f7Xg== X-Gm-Message-State: AOJu0Ywn762jaLkcavXzslX9dDeFsKzdJvijOo1g27d0/gj7cXO1aoRV 3l03e5wIpfiMEulB4Q6SquTY32x21WLSrJ7pDkVqBhbrQ3kpTZ5mVVJ4WvHzgJXmIka9SHF7MCn MCWLwn1kCyN0pPicvpNsC+PAYVUN2Nuvvophn/feSJjmzZsXRyBwm8CdRxWFeJ+eZf8ERVEzJ6Q o= X-Received: by 2002:a1c:721a:0:b0:3ff:516b:5c65 with SMTP id n26-20020a1c721a000000b003ff516b5c65mr6018672wmc.30.1695653266605; Mon, 25 Sep 2023 07:47:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjE1RYMgykv5A2EjOUaCIOxpuZMxOOxoaCHhQY1kZs+dqqlG0vlEwHqN3eUfwdzs7BbGOvwA== X-Received: by 2002:a1c:721a:0:b0:3ff:516b:5c65 with SMTP id n26-20020a1c721a000000b003ff516b5c65mr6018654wmc.30.1695653266193; Mon, 25 Sep 2023 07:47:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: armbru@redhat.com Subject: [PATCH] mptsas: avoid shadowed local variables Date: Mon, 25 Sep 2023 16:47:38 +0200 Message-ID: <20230925144744.527958-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695653339875100001 Content-Type: text/plain; charset="utf-8" Rename the argument so that "addr" is only used inside the for loop. Signed-off-by: Paolo Bonzini --- hw/scsi/mptsas.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index 3de288b454c..75d3ab8bd18 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi/mptsas.c @@ -192,7 +192,7 @@ static dma_addr_t mptsas_ld_sg_base(MPTSASState *s, uin= t32_t flags_and_length, return addr; } =20 -static int mptsas_build_sgl(MPTSASState *s, MPTSASRequest *req, hwaddr add= r) +static int mptsas_build_sgl(MPTSASState *s, MPTSASRequest *req, hwaddr req= _addr) { PCIDevice *pci =3D (PCIDevice *) s; hwaddr next_chain_addr; @@ -201,8 +201,8 @@ static int mptsas_build_sgl(MPTSASState *s, MPTSASReque= st *req, hwaddr addr) uint32_t chain_offset; =20 chain_offset =3D req->scsi_io.ChainOffset; - next_chain_addr =3D addr + chain_offset * sizeof(uint32_t); - sgaddr =3D addr + sizeof(MPIMsgSCSIIORequest); + next_chain_addr =3D req_addr + chain_offset * sizeof(uint32_t); + sgaddr =3D req_addr + sizeof(MPIMsgSCSIIORequest); pci_dma_sglist_init(&req->qsg, pci, 4); left =3D req->scsi_io.DataLength; =20 --=20 2.41.0