[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] x86/Viridian: drop dead variable updates
commit 8c6ea4a78485047ea78f9c07d457a56f5227a08b Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Wed Nov 24 11:10:36 2021 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Wed Nov 24 11:10:36 2021 +0100 x86/Viridian: drop dead variable updates Both hvcall_flush_ex() and hvcall_ipi_ex() update "size" without subsequently using the value; future compilers may warn about such. Alongside dropping the updates, shrink the variables' scopes to demonstrate that there are no outer scope uses. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Paul Durrant <paul@xxxxxxx> --- xen/arch/x86/hvm/viridian/viridian.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c index 7d1cfc530b..efdd60b205 100644 --- a/xen/arch/x86/hvm/viridian/viridian.c +++ b/xen/arch/x86/hvm/viridian/viridian.c @@ -776,7 +776,6 @@ static int hvcall_flush_ex(const union hypercall_input *input, { union hypercall_vpset *vpset = &this_cpu(hypercall_vpset); struct hv_vpset *set = &vpset->set; - size_t size; int rc; *set = input_params.set; @@ -784,8 +783,7 @@ static int hvcall_flush_ex(const union hypercall_input *input, { unsigned long offset = offsetof(typeof(input_params), set.bank_contents); - - size = sizeof(*set->bank_contents) * hv_vpset_nr_banks(set); + size_t size = sizeof(*set->bank_contents) * hv_vpset_nr_banks(set); if ( offsetof(typeof(*vpset), set.bank_contents[0]) + size > sizeof(*vpset) ) @@ -798,11 +796,7 @@ static int hvcall_flush_ex(const union hypercall_input *input, input_params_gpa + offset, size) != HVMTRANS_okay) return -EINVAL; - - size += sizeof(*set); } - else - size = sizeof(*set); rc = hv_vpset_to_vpmask(set, vpmask); if ( rc ) @@ -903,7 +897,6 @@ static int hvcall_ipi_ex(const union hypercall_input *input, } input_params; union hypercall_vpset *vpset = &this_cpu(hypercall_vpset); struct hv_vpset *set = &vpset->set; - size_t size; int rc; /* These hypercalls should never use the fast-call convention. */ @@ -929,8 +922,7 @@ static int hvcall_ipi_ex(const union hypercall_input *input, { unsigned long offset = offsetof(typeof(input_params), set.bank_contents); - - size = sizeof(*set->bank_contents) * hv_vpset_nr_banks(set); + size_t size = sizeof(*set->bank_contents) * hv_vpset_nr_banks(set); if ( offsetof(typeof(*vpset), set.bank_contents[0]) + size > sizeof(*vpset) ) @@ -943,11 +935,7 @@ static int hvcall_ipi_ex(const union hypercall_input *input, input_params_gpa + offset, size) != HVMTRANS_okay) return -EINVAL; - - size += sizeof(*set); } - else - size = sizeof(*set); rc = hv_vpset_to_vpmask(set, vpmask); if ( rc ) -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |