All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jules Irenge <jbi.octave@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] staging: wfx: replace u32 by __le32
Date: Mon, 11 Nov 2019 15:12:30 +0100	[thread overview]
Message-ID: <20191111141230.GA585609@kroah.com> (raw)
In-Reply-To: <20191111133055.214410-3-jbi.octave@gmail.com>

On Mon, Nov 11, 2019 at 01:30:55PM +0000, Jules Irenge wrote:
> Replace u32 by __le32 to fix warning of cast from restricted __le32.
> Issue detected by sparse tool.
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> ---
> v1 uses casting to fix the warnings
> v2 replace the declaration type of the variables
> 
>  drivers/staging/wfx/hif_api_mib.h | 48 +++++++++++++++----------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h
> index 94b789ceb4ff..e0a67410add2 100644
> --- a/drivers/staging/wfx/hif_api_mib.h
> +++ b/drivers/staging/wfx/hif_api_mib.h
> @@ -295,31 +295,31 @@ struct hif_mib_stats_table {
>  } __packed;
>  
>  struct hif_mib_extended_count_table {
> -	u32   count_plcp_errors;
> -	u32   count_fcs_errors;
> -	u32   count_tx_packets;
> -	u32   count_rx_packets;
> -	u32   count_rx_packet_errors;
> -	u32   count_rx_decryption_failures;
> -	u32   count_rx_mic_failures;
> -	u32   count_rx_no_key_failures;
> -	u32   count_tx_multicast_frames;
> -	u32   count_tx_frames_success;
> -	u32   count_tx_frame_failures;
> -	u32   count_tx_frames_retried;
> -	u32   count_tx_frames_multi_retried;
> -	u32   count_rx_frame_duplicates;
> -	u32   count_rts_success;
> -	u32   count_rts_failures;
> -	u32   count_ack_failures;
> -	u32   count_rx_multicast_frames;
> -	u32   count_rx_frames_success;
> -	u32   count_rx_cmacicv_errors;
> -	u32   count_rx_cmac_replays;
> -	u32   count_rx_mgmt_ccmp_replays;
> +	__le32   count_plcp_errors;
> +	__le32   count_fcs_errors;
> +	__le32   count_tx_packets;
> +	__le32   count_rx_packets;
> +	__le32   count_rx_packet_errors;
> +	__le32   count_rx_decryption_failures;
> +	__le32   count_rx_mic_failures;
> +	__le32   count_rx_no_key_failures;
> +	__le32   count_tx_multicast_frames;
> +	__le32   count_tx_frames_success;
> +	__le32   count_tx_frame_failures;
> +	__le32   count_tx_frames_retried;
> +	__le32   count_tx_frames_multi_retried;
> +	__le32   count_rx_frame_duplicates;
> +	__le32   count_rts_success;
> +	__le32   count_rts_failures;
> +	__le32   count_rx_multicast_frames;
> +	__le32   count_rx_cmacicv_errors;
> +	__le32   count_rx_cmac_replays;
> +	__le32   count_rx_mgmt_ccmp_replays;
> +	__le32   count_rx_beacon;
> +	__le32   count_miss_beacon;
> +	__le32   count_ack_failures;
> +	__le32   count_rx_frames_success;
>  	u32   count_rx_bipmic_errors;
> -	u32   count_rx_beacon;
> -	u32   count_miss_beacon;
>  	u32   reserved[15];
>  } __packed;

Is this structure coming from the hardware directly?  If so, you just
messed up the layout by moving things around, which will break the
driver :(

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh@linuxfoundation.org>
To: Jules Irenge <jbi.octave@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] staging: wfx: replace u32 by __le32
Date: Mon, 11 Nov 2019 15:12:30 +0100	[thread overview]
Message-ID: <20191111141230.GA585609@kroah.com> (raw)
In-Reply-To: <20191111133055.214410-3-jbi.octave@gmail.com>

On Mon, Nov 11, 2019 at 01:30:55PM +0000, Jules Irenge wrote:
> Replace u32 by __le32 to fix warning of cast from restricted __le32.
> Issue detected by sparse tool.
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> ---
> v1 uses casting to fix the warnings
> v2 replace the declaration type of the variables
> 
>  drivers/staging/wfx/hif_api_mib.h | 48 +++++++++++++++----------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h
> index 94b789ceb4ff..e0a67410add2 100644
> --- a/drivers/staging/wfx/hif_api_mib.h
> +++ b/drivers/staging/wfx/hif_api_mib.h
> @@ -295,31 +295,31 @@ struct hif_mib_stats_table {
>  } __packed;
>  
>  struct hif_mib_extended_count_table {
> -	u32   count_plcp_errors;
> -	u32   count_fcs_errors;
> -	u32   count_tx_packets;
> -	u32   count_rx_packets;
> -	u32   count_rx_packet_errors;
> -	u32   count_rx_decryption_failures;
> -	u32   count_rx_mic_failures;
> -	u32   count_rx_no_key_failures;
> -	u32   count_tx_multicast_frames;
> -	u32   count_tx_frames_success;
> -	u32   count_tx_frame_failures;
> -	u32   count_tx_frames_retried;
> -	u32   count_tx_frames_multi_retried;
> -	u32   count_rx_frame_duplicates;
> -	u32   count_rts_success;
> -	u32   count_rts_failures;
> -	u32   count_ack_failures;
> -	u32   count_rx_multicast_frames;
> -	u32   count_rx_frames_success;
> -	u32   count_rx_cmacicv_errors;
> -	u32   count_rx_cmac_replays;
> -	u32   count_rx_mgmt_ccmp_replays;
> +	__le32   count_plcp_errors;
> +	__le32   count_fcs_errors;
> +	__le32   count_tx_packets;
> +	__le32   count_rx_packets;
> +	__le32   count_rx_packet_errors;
> +	__le32   count_rx_decryption_failures;
> +	__le32   count_rx_mic_failures;
> +	__le32   count_rx_no_key_failures;
> +	__le32   count_tx_multicast_frames;
> +	__le32   count_tx_frames_success;
> +	__le32   count_tx_frame_failures;
> +	__le32   count_tx_frames_retried;
> +	__le32   count_tx_frames_multi_retried;
> +	__le32   count_rx_frame_duplicates;
> +	__le32   count_rts_success;
> +	__le32   count_rts_failures;
> +	__le32   count_rx_multicast_frames;
> +	__le32   count_rx_cmacicv_errors;
> +	__le32   count_rx_cmac_replays;
> +	__le32   count_rx_mgmt_ccmp_replays;
> +	__le32   count_rx_beacon;
> +	__le32   count_miss_beacon;
> +	__le32   count_ack_failures;
> +	__le32   count_rx_frames_success;
>  	u32   count_rx_bipmic_errors;
> -	u32   count_rx_beacon;
> -	u32   count_miss_beacon;
>  	u32   reserved[15];
>  } __packed;

Is this structure coming from the hardware directly?  If so, you just
messed up the layout by moving things around, which will break the
driver :(

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2019-11-11 14:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 13:30 [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jules Irenge
2019-11-11 13:30 ` Jules Irenge
2019-11-11 13:30 ` [PATCH v2 2/3] staging: wfx: wrap characters Jules Irenge
2019-11-11 13:30   ` Jules Irenge
2019-11-11 15:34   ` Greg KH
2019-11-11 15:34     ` Greg KH
2019-11-11 13:30 ` [PATCH v2 3/3] staging: wfx: replace u32 by __le32 Jules Irenge
2019-11-11 13:30   ` Jules Irenge
2019-11-11 14:12   ` Greg KH [this message]
2019-11-11 14:12     ` Greg KH
2019-11-11 16:58   ` Jerome Pouiller
2019-11-11 16:58     ` Jerome Pouiller
2019-11-11 23:15     ` Joe Perches
2019-11-11 23:15       ` Joe Perches
2019-11-11 17:04 ` [PATCH v2 1/3] staging: wfx: replace uintXX_t to uXX and intXX_t to sXX Jerome Pouiller
2019-11-11 17:04   ` Jerome Pouiller
2019-11-11 17:48   ` gregkh
2019-11-11 17:48     ` gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191111141230.GA585609@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=jbi.octave@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.