diff mbox series

[next] scsi: qla2xxx: make 1 bit bit-fields unsigned int

Message ID 20200428102013.1040598-1-colin.king@canonical.com (mailing list archive)
State Mainlined
Commit 78b874b7cbf09fbfadfa5f18a347ebef7bbb49fe
Headers show
Series [next] scsi: qla2xxx: make 1 bit bit-fields unsigned int | expand

Commit Message

Colin King April 28, 2020, 10:20 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The bitfields mpi_fw_dump_reading and mpi_fw_dumped are currently signed
which is not recommended as the representation is an implementation defined
behaviour.  Fix this by making the bit-fields unsigned ints.

Fixes: cbb01c2f2f63 ("scsi: qla2xxx: Fix MPI failure AEN (8200) handling")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_def.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bart Van Assche April 28, 2020, 2:26 p.m. UTC | #1
On 2020-04-28 03:20, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The bitfields mpi_fw_dump_reading and mpi_fw_dumped are currently signed
> which is not recommended as the representation is an implementation defined
> behaviour.  Fix this by making the bit-fields unsigned ints.
> 
> Fixes: cbb01c2f2f63 ("scsi: qla2xxx: Fix MPI failure AEN (8200) handling")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/scsi/qla2xxx/qla_def.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
> index daa9e936887b..172ea4e5887d 100644
> --- a/drivers/scsi/qla2xxx/qla_def.h
> +++ b/drivers/scsi/qla2xxx/qla_def.h
> @@ -4248,8 +4248,8 @@ struct qla_hw_data {
>  	int		fw_dump_reading;
>  	void		*mpi_fw_dump;
>  	u32		mpi_fw_dump_len;
> -	int		mpi_fw_dump_reading:1;
> -	int		mpi_fw_dumped:1;
> +	unsigned int	mpi_fw_dump_reading:1;
> +	unsigned int	mpi_fw_dumped:1;
>  	int		prev_minidump_failed;
>  	dma_addr_t	eft_dma;
>  	void		*eft;

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Himanshu Madhani April 28, 2020, 2:50 p.m. UTC | #2
On 4/28/20 5:20 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The bitfields mpi_fw_dump_reading and mpi_fw_dumped are currently signed
> which is not recommended as the representation is an implementation defined
> behaviour.  Fix this by making the bit-fields unsigned ints.
> 
> Fixes: cbb01c2f2f63 ("scsi: qla2xxx: Fix MPI failure AEN (8200) handling")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/scsi/qla2xxx/qla_def.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
> index daa9e936887b..172ea4e5887d 100644
> --- a/drivers/scsi/qla2xxx/qla_def.h
> +++ b/drivers/scsi/qla2xxx/qla_def.h
> @@ -4248,8 +4248,8 @@ struct qla_hw_data {
>   	int		fw_dump_reading;
>   	void		*mpi_fw_dump;
>   	u32		mpi_fw_dump_len;
> -	int		mpi_fw_dump_reading:1;
> -	int		mpi_fw_dumped:1;
> +	unsigned int	mpi_fw_dump_reading:1;
> +	unsigned int	mpi_fw_dumped:1;
>   	int		prev_minidump_failed;
>   	dma_addr_t	eft_dma;
>   	void		*eft;
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Martin K. Petersen April 30, 2020, 2:18 a.m. UTC | #3
On Tue, 28 Apr 2020 11:20:13 +0100, Colin King wrote:

> The bitfields mpi_fw_dump_reading and mpi_fw_dumped are currently signed
> which is not recommended as the representation is an implementation defined
> behaviour.  Fix this by making the bit-fields unsigned ints.

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: qla2xxx: make 1-bit bit-fields unsigned int
      https://git.kernel.org/mkp/scsi/c/78b874b7cbf0
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index daa9e936887b..172ea4e5887d 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -4248,8 +4248,8 @@  struct qla_hw_data {
 	int		fw_dump_reading;
 	void		*mpi_fw_dump;
 	u32		mpi_fw_dump_len;
-	int		mpi_fw_dump_reading:1;
-	int		mpi_fw_dumped:1;
+	unsigned int	mpi_fw_dump_reading:1;
+	unsigned int	mpi_fw_dumped:1;
 	int		prev_minidump_failed;
 	dma_addr_t	eft_dma;
 	void		*eft;