lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 28 Mar 2022 14:36:54 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     yuzhe <yuzhe@...china.com>
Cc:     james.morse@....com, alexandru.elisei@....com,
        suzuki.poulose@....com, catalin.marinas@....com, will@...nel.org,
        linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
        linux-kernel@...r.kernel.org, liqiong@...china.com,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] KVM: arm64: vgic-debug: remove unnecessary type castings

On Mon, 28 Mar 2022 11:38:36 +0100,
yuzhe <yuzhe@...china.com> wrote:
> 
> remove unnecessary castings, from "void *" to "struct kvm *"
> 
> Signed-off-by: yuzhe <yuzhe@...china.com>
> ---
>  arch/arm64/kvm/vgic/vgic-debug.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c
> index f38c40a76251..927e5c1f650d 100644
> --- a/arch/arm64/kvm/vgic/vgic-debug.c
> +++ b/arch/arm64/kvm/vgic/vgic-debug.c
> @@ -82,7 +82,7 @@ static bool end_of_vgic(struct vgic_state_iter *iter)
>  
>  static void *vgic_debug_start(struct seq_file *s, loff_t *pos)
>  {
> -	struct kvm *kvm = (struct kvm *)s->private;
> +	struct kvm *kvm = s->private;
>  	struct vgic_state_iter *iter;
>  
>  	mutex_lock(&kvm->lock);
> @@ -110,7 +110,7 @@ static void *vgic_debug_start(struct seq_file *s, loff_t *pos)
>  
>  static void *vgic_debug_next(struct seq_file *s, void *v, loff_t *pos)
>  {
> -	struct kvm *kvm = (struct kvm *)s->private;
> +	struct kvm *kvm = s->private;
>  	struct vgic_state_iter *iter = kvm->arch.vgic.iter;
>  
>  	++*pos;
> @@ -122,7 +122,7 @@ static void *vgic_debug_next(struct seq_file *s, void *v, loff_t *pos)
>  
>  static void vgic_debug_stop(struct seq_file *s, void *v)
>  {
> -	struct kvm *kvm = (struct kvm *)s->private;
> +	struct kvm *kvm = s->private;
>  	struct vgic_state_iter *iter;
>  
>  	/*
> @@ -229,7 +229,7 @@ static void print_irq_state(struct seq_file *s, struct vgic_irq *irq,
>  
>  static int vgic_debug_show(struct seq_file *s, void *v)
>  {
> -	struct kvm *kvm = (struct kvm *)s->private;
> +	struct kvm *kvm = s->private;
>  	struct vgic_state_iter *iter = (struct vgic_state_iter *)v;

How about you fully get rid of the unnecessary casts then?

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ