Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2044501rwb; Fri, 19 Aug 2022 14:12:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR4CXZ+Jlld1Dnr1vkFHu185Ujh+vzl23MwDl61gO4NY/3CYGeWw8k4b1HVSxMeb6JQu9bub X-Received: by 2002:a17:907:94d0:b0:730:7a68:3093 with SMTP id dn16-20020a17090794d000b007307a683093mr6226532ejc.760.1660943548211; Fri, 19 Aug 2022 14:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660943548; cv=none; d=google.com; s=arc-20160816; b=TneWawmWek1Qi3v20M4WQntXIZ0ghDSJIkR/BpiKDyfyhuF0c7lSRyUJYqZMjI318S yyuxS6WNTQvT9E9AxqUhoVqQbQDV4AS+z5+td4km5ROQyK1L/RKk+LWfDnW8yk5TISm1 PZgnP2jnskgs2aH+yrJlit8oUVVCwghuvYuftpQVfUpUO6uqDr2YtiUR+Q6HHPfOdl9r jm6MwRn0SFmzNUzzCBWz8C7VlrcrORAe3ozTlrc8jfN/4dcxne+U7rcWM5h2+6gPu4Mj aRZ+Gv560hxoVSSHG0uhLe0SYMHBotjfWKrQ1Ckj14lU1YoomarkGTNcci0+vVenOR14 yRrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YuF+xqYANb0UpSKdFXaPIjdGoUsETegDwAlHIfHh17s=; b=gmPpkoGh9KuJURxqMBaVElF2xFsqerfZojzcPPeuaULifhgPDYw592e1EPSdkdCT6P 4ND1WsOkT71zasVjMDEWTfScdaZ3+/fDi7r+xmLtGdVnMlk+6js9koqccYfousncXXZ4 xYFz1bu1DhO4aYZ4DOTrVIw3eE+VnAt0I9KH+zTYAyIYoGNzuwOWxESyBkhtLSF65afJ qIOE46UtjiVX4bDIVWya93UcCHV9FewV/ua0O0szK4S9NsIpn6DnTwnwNFjSi/hu7SlD xPUNyknIQKPKvG9r95QTYQQ+q6qZonliMmfjU0GW8W8Xc/O8hz0PCx/Jz5JEDda9CJrI raZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=SmwVsSxL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n9-20020a05640205c900b00445f6ff57bfsi4247273edx.335.2022.08.19.14.11.36; Fri, 19 Aug 2022 14:12:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=SmwVsSxL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351696AbiHSUJR (ORCPT + 99 others); Fri, 19 Aug 2022 16:09:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351558AbiHSUJO (ORCPT ); Fri, 19 Aug 2022 16:09:14 -0400 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D01A9D11E for ; Fri, 19 Aug 2022 13:09:13 -0700 (PDT) Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-32a09b909f6so150506227b3.0 for ; Fri, 19 Aug 2022 13:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=YuF+xqYANb0UpSKdFXaPIjdGoUsETegDwAlHIfHh17s=; b=SmwVsSxLi/TN3be8ePf4Zt26MSe+mpgAQ9Yj1M7BSIb+2/45bT5dcu90JsXbPBl5vH caJzUu+A8tA+CqBs274jJpfoLUC/7GmPmhVg8b6otV8Dg+XUbZaq4LVnJUo5r2JnpOd1 oZC+HNnX9iXvL2IpKtVVL/slYa6BOXTlJ7kWQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=YuF+xqYANb0UpSKdFXaPIjdGoUsETegDwAlHIfHh17s=; b=6DLY+Piig78XU31U4zRz1FOCDRCHBu6Ir8N2XxQzzF/8jaTYqlHJMHHiXNskPjjvAg I2qWq+8iybfEQZafHAZAI3nyJ4LreS8t7+wXElW7leXqtkIC+hXhClD+a1vvgRR8S/Hk JOQ+I6rSgYYya5pubNUtrZSdV6HPqAagwof0wvSxni3h0g6imPhEEniU1mbHoIk8S/NY 9NMFiIt+QeuO4DEGKB4raL99NaI1kFdpF1ZB5vwk3Zg2PZGNL8Rjlunrxwrb3X/BHlat DMwknjzjgzcpDzMzVLovtbiukL9bv0iIvUZljUZuwjTrE1g55grUgslS0rtdmOu/3Cnh HoMA== X-Gm-Message-State: ACgBeo2Q9sm+vWgkVRn81YgvSf4vcoubYzyJqK/AigjXltkkmNubjl/R 4l71hJMPJUqMJSFYvGY8FK2QMkgInOaDh7SGYyHC X-Received: by 2002:a25:5105:0:b0:692:17f6:62b6 with SMTP id f5-20020a255105000000b0069217f662b6mr8381453ybb.361.1660939752536; Fri, 19 Aug 2022 13:09:12 -0700 (PDT) MIME-Version: 1.0 References: <20220814141237.493457-1-mail@conchuod.ie> <20220814141237.493457-2-mail@conchuod.ie> In-Reply-To: <20220814141237.493457-2-mail@conchuod.ie> From: Atish Patra Date: Fri, 19 Aug 2022 13:09:01 -0700 Message-ID: Subject: Re: [PATCH 1/4] riscv: kvm: vcpu_timer: fix unused variable warnings To: Conor Dooley Cc: Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Guo Ren , Vincent Chen , Xianting Tian , Heiko Stuebner , Kefeng Wang , Tong Tiangen , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 14, 2022 at 7:12 AM Conor Dooley wrote: > > From: Conor Dooley > > In two places, csr is set but never used: > > arch/riscv/kvm/vcpu_timer.c:302:23: warning: variable 'csr' set but not used [-Wunused-but-set-variable] > struct kvm_vcpu_csr *csr; > ^ > arch/riscv/kvm/vcpu_timer.c:327:23: warning: variable 'csr' set but not used [-Wunused-but-set-variable] > struct kvm_vcpu_csr *csr; > ^ > > Remove the variable. > > Fixes: 8f5cb44b1bae ("RISC-V: KVM: Support sstc extension") > Signed-off-by: Conor Dooley > --- > arch/riscv/kvm/vcpu_timer.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/arch/riscv/kvm/vcpu_timer.c b/arch/riscv/kvm/vcpu_timer.c > index 16f50c46ba39..185f2386a747 100644 > --- a/arch/riscv/kvm/vcpu_timer.c > +++ b/arch/riscv/kvm/vcpu_timer.c > @@ -299,7 +299,6 @@ static void kvm_riscv_vcpu_update_timedelta(struct kvm_vcpu *vcpu) > > void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu) > { > - struct kvm_vcpu_csr *csr; > struct kvm_vcpu_timer *t = &vcpu->arch.timer; > > kvm_riscv_vcpu_update_timedelta(vcpu); > @@ -307,7 +306,6 @@ void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu) > if (!t->sstc_enabled) > return; > > - csr = &vcpu->arch.guest_csr; > #if defined(CONFIG_32BIT) > csr_write(CSR_VSTIMECMP, (u32)t->next_cycles); > csr_write(CSR_VSTIMECMPH, (u32)(t->next_cycles >> 32)); > @@ -324,13 +322,11 @@ void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu) > > void kvm_riscv_vcpu_timer_save(struct kvm_vcpu *vcpu) > { > - struct kvm_vcpu_csr *csr; > struct kvm_vcpu_timer *t = &vcpu->arch.timer; > > if (!t->sstc_enabled) > return; > > - csr = &vcpu->arch.guest_csr; > t = &vcpu->arch.timer; > #if defined(CONFIG_32BIT) > t->next_cycles = csr_read(CSR_VSTIMECMP); > -- > 2.37.1 > Thanks for fixing this. Sorry for missing those. -- Regards, Atish