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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2024010937-rental-filled-5ae6@gregkh>
Date: Tue, 9 Jan 2024 08:49:33 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: SilverPlate3 <arielsilver77@...il.com>
Cc: forest@...ttletooquiet.net, linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Staging: vt6655: Fix sparse warning. Restricted cast.

On Tue, Jan 09, 2024 at 09:27:04AM +0200, SilverPlate3 wrote:
> Running 'make M=drivers/staging/vt6655 C=2'
> causes sparse to generate few warnings.
> This patch fixes the following warnings by ensuring le64_to_cpu
> handles only __le64 values, thus dismissing chances of bad endianness.
> * drivers/staging/vt6655/card.c:302:45: warning: cast to restricted __le64
> * drivers/staging/vt6655/card.c:336:23: warning: cast to restricted __le64
> * drivers/staging/vt6655/card.c:804:23: warning: cast to restricted __le64
> * drivers/staging/vt6655/card.c:831:18: warning: cast to restricted __le64
> 
> Signed-off-by: Ariel Silver <arielsilver77@...il.com>

 From: line doesn't match the signed-off-by line :(

> ---
>  drivers/staging/vt6655/card.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
> index 350ab8f3778a..5dc2200466b7 100644
> --- a/drivers/staging/vt6655/card.c
> +++ b/drivers/staging/vt6655/card.c
> @@ -292,6 +292,7 @@ bool card_update_tsf(struct vnt_private *priv, unsigned char rx_rate,
>  {
>  	u64 local_tsf;
>  	u64 qwTSFOffset = 0;
> +	__le64 le_qwTSFOffset = 0;
>  
>  	local_tsf = vt6655_get_current_tsf(priv);
>  
> @@ -299,7 +300,8 @@ bool card_update_tsf(struct vnt_private *priv, unsigned char rx_rate,
>  		qwTSFOffset = CARDqGetTSFOffset(rx_rate, qwBSSTimestamp,
>  						local_tsf);
>  		/* adjust TSF, HW's TSF add TSF Offset reg */
> -		qwTSFOffset =  le64_to_cpu(qwTSFOffset);
> +		le_qwTSFOffset = cpu_to_le64(qwTSFOffset);
> +		qwTSFOffset = le64_to_cpu(le_qwTSFOffset);

Are you sure about this?  Please verify just what you are doing here
please...

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ