Linux Confidential Computing Development
 help / color / mirror / Atom feed
* [PATCH] KVM: SEV: Fix unused variable in guest request handling
@ 2024-05-13 18:19 Michael Roth
  2024-05-18 15:29 ` Carlos Bilbao
  2024-05-19  5:50 ` Markus Elfring
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Roth @ 2024-05-13 18:19 UTC (permalink / raw)
  To: kvm; +Cc: linux-kernel, Paolo Bonzini, linux-coco, Sean Christopherson

The variable 'sev' is assigned, but never used. Remove it.

Fixes: 449ead2d1edb ("KVM: SEV: Provide support for SNP_GUEST_REQUEST NAE event")
Signed-off-by: Michael Roth <michael.roth@amd.com>
---
 arch/x86/kvm/svm/sev.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 59c0d89a4d52..6cf665c410b2 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -3965,14 +3965,11 @@ static int __snp_handle_guest_req(struct kvm *kvm, gpa_t req_gpa, gpa_t resp_gpa
 				  sev_ret_code *fw_err)
 {
 	struct sev_data_snp_guest_request data = {0};
-	struct kvm_sev_info *sev;
 	int ret;
 
 	if (!sev_snp_guest(kvm))
 		return -EINVAL;
 
-	sev = &to_kvm_svm(kvm)->sev_info;
-
 	ret = snp_setup_guest_buf(kvm, &data, req_gpa, resp_gpa);
 	if (ret)
 		return ret;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] KVM: SEV: Fix unused variable in guest request handling
  2024-05-13 18:19 [PATCH] KVM: SEV: Fix unused variable in guest request handling Michael Roth
@ 2024-05-18 15:29 ` Carlos Bilbao
  2024-05-19  5:50 ` Markus Elfring
  1 sibling, 0 replies; 5+ messages in thread
From: Carlos Bilbao @ 2024-05-18 15:29 UTC (permalink / raw)
  To: Michael Roth, kvm
  Cc: linux-kernel, Paolo Bonzini, linux-coco, Sean Christopherson

On 5/13/24 13:19, Michael Roth wrote:

> The variable 'sev' is assigned, but never used. Remove it.
>
> Fixes: 449ead2d1edb ("KVM: SEV: Provide support for SNP_GUEST_REQUEST NAE event")
> Signed-off-by: Michael Roth <michael.roth@amd.com>


Reviewed-by: Carlos Bilbao <carlos.bilbao.osdev@gmail.com>


> ---
>  arch/x86/kvm/svm/sev.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index 59c0d89a4d52..6cf665c410b2 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -3965,14 +3965,11 @@ static int __snp_handle_guest_req(struct kvm *kvm, gpa_t req_gpa, gpa_t resp_gpa
>  				  sev_ret_code *fw_err)
>  {
>  	struct sev_data_snp_guest_request data = {0};
> -	struct kvm_sev_info *sev;
>  	int ret;
>  
>  	if (!sev_snp_guest(kvm))
>  		return -EINVAL;
>  
> -	sev = &to_kvm_svm(kvm)->sev_info;
> -
>  	ret = snp_setup_guest_buf(kvm, &data, req_gpa, resp_gpa);
>  	if (ret)
>  		return ret;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] KVM: SEV: Fix unused variable in guest request handling
  2024-05-13 18:19 [PATCH] KVM: SEV: Fix unused variable in guest request handling Michael Roth
  2024-05-18 15:29 ` Carlos Bilbao
@ 2024-05-19  5:50 ` Markus Elfring
  2024-05-20 13:49   ` Carlos Bilbao
  1 sibling, 1 reply; 5+ messages in thread
From: Markus Elfring @ 2024-05-19  5:50 UTC (permalink / raw)
  To: Michael Roth, kvm, kernel-janitors, linux-coco
  Cc: LKML, Carlos Bilbao, Paolo Bonzini, Sean Christopherson

> The variable 'sev' is assigned, but never used. Remove it.

Would it be a bit nicer to use the word “Omit” instead of “Fix”
in the summary phrase?

Regards,
Markus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] KVM: SEV: Fix unused variable in guest request handling
  2024-05-19  5:50 ` Markus Elfring
@ 2024-05-20 13:49   ` Carlos Bilbao
  2024-05-20 14:16     ` Markus Elfring
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos Bilbao @ 2024-05-20 13:49 UTC (permalink / raw)
  To: Markus Elfring, Michael Roth, kvm, kernel-janitors, linux-coco
  Cc: LKML, Paolo Bonzini, Sean Christopherson

Hey Markus,

On 5/19/24 12:50 AM, Markus Elfring wrote:
>> The variable 'sev' is assigned, but never used. Remove it.
> Would it be a bit nicer to use the word “Omit” instead of “Fix”
> in the summary phrase?


I can find many instances of "Fix unused variable" in the history of the
kernel:

ubsan: fix unused variable warning in test module
x86/resctrl: Fix unused variable warning in cache_alloc_hsw_probe()
octeontx2-pf: Fix unused variable build error
etc...

but not a single "Omit unused variable" commit.


>
> Regards,
> Markus


Thanks,
Carlos


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KVM: SEV: Fix unused variable in guest request handling
  2024-05-20 13:49   ` Carlos Bilbao
@ 2024-05-20 14:16     ` Markus Elfring
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2024-05-20 14:16 UTC (permalink / raw)
  To: Carlos Bilbao, Michael Roth, kvm, kernel-janitors, linux-coco
  Cc: LKML, Paolo Bonzini, Sean Christopherson

>>> The variable 'sev' is assigned, but never used. Remove it.
>> Would it be a bit nicer to use the word “Omit” instead of “Fix”
>> in the summary phrase?
>
>
> I can find many instances of "Fix unused variable" in the history of the
> kernel:
> but not a single "Omit unused variable" commit.

Some implementation details were fixed somehow because of a warning or error message.
You would probably like to point the desire out in your summary phrase
to get rid of another bit of redundant source code.

Were any analysis tools involved in the discovery of corresponding change possibilities?

Regards,
Markus

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-20 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-13 18:19 [PATCH] KVM: SEV: Fix unused variable in guest request handling Michael Roth
2024-05-18 15:29 ` Carlos Bilbao
2024-05-19  5:50 ` Markus Elfring
2024-05-20 13:49   ` Carlos Bilbao
2024-05-20 14:16     ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox