Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3117404ybc; Thu, 14 Nov 2019 04:19:25 -0800 (PST) X-Google-Smtp-Source: APXvYqywm6FZ0VYImAo7Xd831YLlBd3MgIx/cb6UyNVXSW2Vw/vRczXmxPpoXUEIVdZ23of0gYC2 X-Received: by 2002:aa7:df8c:: with SMTP id b12mr907766edy.166.1573733965706; Thu, 14 Nov 2019 04:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573733965; cv=none; d=google.com; s=arc-20160816; b=ZzbfVBDBjloGcmCrhq5DzMETx6ndyYZrsYDzWenLVLAvkeXiBbSjMXmoSatl+yLCmu AheUNTW1WVTiOlWTroSOFrHwk0xfC/oz3jI3yVhsCtkrC0r2KkVguEC+GAznqQCUVoX0 wzYHBvFpH4IpqxgzTYTgQHAyrYPR09z/SJJBtCJW187H/Mm880pluqODboPb/z3sWulI 3EFZ70dCIjCj0eE7RBsd+KKbH+C39c5mvcA3xLDOshrDO7e4Pj/PLAGyvB2qhV9unWnz +hKaJ3vVXDT6pfsTv9PPy7t4L7rQzyw3PzBtW42v5E167ZtHtTFaz83WNDzfaQZilxIG diXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=6g3FuiSmJL+Kk/iwiMI9WeS/k56NyXnRD61zjnDeFo8=; b=aWeQpSAWFoFzSu5ba4w2OQcul2Bv3ncBaCeNRtuNTj7mS20PO04ep3J6V15XaICMVK 4miECZdAXk3ZwQmo9TI+ROd8DubVITrbD4ZI1HKZBvHBR9nDAfY5XGTZcHS1SWKpK+cZ V0WTRhHFGXlCLMi5J9BLXfOwUUwDpnjdkTqqTs9QLNDnRIx+G/iY7fUDdT92auj1yAWw cjcnfZTyKoxxf6bkl6wjby/0NVVtkRLLUiElwYV3wc6ZLlxaNwyXT80Uy5T1zvSuzDQA EXg4X7eRSM3eEtg/zYo/dFU/6QmAt8Y0u6S9OfKMbTXeP7yEZyf/ZqChZVYfEnyar2cy 6bJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CWMhGPaU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si3160223ejb.296.2019.11.14.04.19.01; Thu, 14 Nov 2019 04:19:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CWMhGPaU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727354AbfKNMQf (ORCPT + 99 others); Thu, 14 Nov 2019 07:16:35 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56828 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726469AbfKNMQf (ORCPT ); Thu, 14 Nov 2019 07:16:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573733793; 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=6g3FuiSmJL+Kk/iwiMI9WeS/k56NyXnRD61zjnDeFo8=; b=CWMhGPaUV0aKGd4SQk5OlLb7qD4pwJ81W2piEt/dB2oRo6m+w6YeoO2CMqXwDx0U3J6zBB r3ob9WqqJCTyY1ZlIxYwYBsQbwuBSYON2zXLRrGo7Ee6jTAHzg1X1+OquUFGCOY2BCXcmV O2Wg3FiM8eCEX05YMGNmyPBPDAxvABY= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-406-F_irfEmtNmiIm8ZA6zRiGQ-1; Thu, 14 Nov 2019 07:16:32 -0500 Received: by mail-wm1-f70.google.com with SMTP id i23so3254729wmb.3 for ; Thu, 14 Nov 2019 04:16:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wbG6hQQW5/T3L1JRr4XcKwwPNPz10SDjCnOLcci1gTs=; b=YAFEaxsrwu+2kDoj6/5+8hccqCOGr/LayUXVBBRXSuksmPeIaPmVkgqNfu14im4sAq GYftR/Zm9STI+dCJ5TyyJA/n+7fBRSCd4ub0QG/oMGhzv6o4abQY9lmxZGcUq1hfDs35 2OuSWQuoZ3KmyRlEhSlKwWGvuiSL08sVRG2HAtvrWuHABbZ+XgzaBSvLHvkprWKt82eo ZNYVJjG/ZYknDwubwkNjR1G/Ok676ZG2J7xfzfjvu1uv8a1Yecql5hW6bNcvfpUeuVvF eHjJqVkrerJ1ACmn/7okvGLNA5ZSOGP9y7JD6dCWw3veyf7OpGjAFwD4Gb4rdXpZJMBT Mk3w== X-Gm-Message-State: APjAAAW4ykmaXqnAeTrF7ZzZaQi9Un4GfFVeHhmCLUGxPNA3If4y9cnf tTYEBhWs9NU/ehRiboOJA8Sz1aXkPEUH/UnFf9p9HOpKDGv8k1r0FRocnwhO+9CyGv2YgkaAtUg Cwe03s6Kgb1PHi2NjwAxEVEHO X-Received: by 2002:a1c:7f94:: with SMTP id a142mr7299108wmd.33.1573733791357; Thu, 14 Nov 2019 04:16:31 -0800 (PST) X-Received: by 2002:a1c:7f94:: with SMTP id a142mr7299081wmd.33.1573733791064; Thu, 14 Nov 2019 04:16:31 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:a15b:f753:1ac4:56dc? ([2001:b07:6468:f312:a15b:f753:1ac4:56dc]) by smtp.gmail.com with ESMTPSA id w13sm6588216wrm.8.2019.11.14.04.16.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Nov 2019 04:16:30 -0800 (PST) Subject: Re: [PATCH] selftests: kvm: Simplify loop in kvm_create_max_vcpus test To: Wainer dos Santos Moschetta , rkrcmar@redhat.com Cc: shuah@kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20191112142111.13528-1-wainersm@redhat.com> From: Paolo Bonzini Message-ID: <70986b1a-5a04-cbd6-fe1a-fda4d97d5a72@redhat.com> Date: Thu, 14 Nov 2019 13:16:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191112142111.13528-1-wainersm@redhat.com> Content-Language: en-US X-MC-Unique: F_irfEmtNmiIm8ZA6zRiGQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/11/19 15:21, Wainer dos Santos Moschetta wrote: > On kvm_create_max_vcpus test remove unneeded local > variable in the loop that add vcpus to the VM. >=20 > Signed-off-by: Wainer dos Santos Moschetta > --- > tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) >=20 > diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/t= esting/selftests/kvm/kvm_create_max_vcpus.c > index 231d79e57774..6f38c3dc0d56 100644 > --- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c > +++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c > @@ -29,12 +29,9 @@ void test_vcpu_creation(int first_vcpu_id, int num_vcp= us) > =20 > =09vm =3D vm_create(VM_MODE_DEFAULT, DEFAULT_GUEST_PHY_PAGES, O_RDWR); > =20 > -=09for (i =3D 0; i < num_vcpus; i++) { > -=09=09int vcpu_id =3D first_vcpu_id + i; > - > +=09for (i =3D first_vcpu_id; i < first_vcpu_id + num_vcpus; i++) > =09=09/* This asserts that the vCPU was created. */ > -=09=09vm_vcpu_add(vm, vcpu_id); > -=09} > +=09=09vm_vcpu_add(vm, i); > =20 > =09kvm_vm_free(vm); > } >=20 Queued, thanks. Paolo