linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] driver: scsi: Fix warning using plain integer as NULL
@ 2023-11-09 21:50 Abhinav Singh
  2023-11-25 19:36 ` Abhinav Singh
  2023-12-06  3:16 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Abhinav Singh @ 2023-11-09 21:50 UTC (permalink / raw)
  To: oliver, aliakc, lenehan, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, linux-kernel-mentees, Abhinav Singh

Sparse static analysis tools generate a warning with this message
"Using plain integer as NULL pointer". In this case this warning is
being shown because we are trying to initialize  pointer to NULL using
integer value 0.

Signed-off-by: Abhinav Singh <singhabhinav9051571833@gmail.com>
---
 drivers/scsi/dc395x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index c8e86f8a631e..d108a86e196e 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -1366,7 +1366,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb,
 			"command while another command (0x%p) is active.",
 			srb->cmd,
 			acb->active_dcb->active_srb ?
-			    acb->active_dcb->active_srb->cmd : 0);
+			    acb->active_dcb->active_srb->cmd : NULL);
 		return 1;
 	}
 	if (DC395x_read16(acb, TRM_S1040_SCSI_STATUS) & SCSIINTERRUPT) {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] driver: scsi: Fix warning using plain integer as NULL
  2023-11-09 21:50 [PATCH] driver: scsi: Fix warning using plain integer as NULL Abhinav Singh
@ 2023-11-25 19:36 ` Abhinav Singh
  2023-12-06  3:16 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Abhinav Singh @ 2023-11-25 19:36 UTC (permalink / raw)
  To: oliver, aliakc, lenehan, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, linux-kernel-mentees

On 11/10/23 03:20, Abhinav Singh wrote:
> Sparse static analysis tools generate a warning with this message
> "Using plain integer as NULL pointer". In this case this warning is
> being shown because we are trying to initialize  pointer to NULL using
> integer value 0.
> 
> Signed-off-by: Abhinav Singh <singhabhinav9051571833@gmail.com>
> ---
>   drivers/scsi/dc395x.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
> index c8e86f8a631e..d108a86e196e 100644
> --- a/drivers/scsi/dc395x.c
> +++ b/drivers/scsi/dc395x.c
> @@ -1366,7 +1366,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb,
>   			"command while another command (0x%p) is active.",
>   			srb->cmd,
>   			acb->active_dcb->active_srb ?
> -			    acb->active_dcb->active_srb->cmd : 0);
> +			    acb->active_dcb->active_srb->cmd : NULL);
>   		return 1;
>   	}
>   	if (DC395x_read16(acb, TRM_S1040_SCSI_STATUS) & SCSIINTERRUPT) {
Hello maintainers, any reviews or comments on this.

Thank You,
Abhinav Singh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] driver: scsi: Fix warning using plain integer as NULL
  2023-11-09 21:50 [PATCH] driver: scsi: Fix warning using plain integer as NULL Abhinav Singh
  2023-11-25 19:36 ` Abhinav Singh
@ 2023-12-06  3:16 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-12-06  3:16 UTC (permalink / raw)
  To: oliver, aliakc, lenehan, jejb, Abhinav Singh
  Cc: Martin K . Petersen, linux-scsi, linux-kernel, linux-kernel-mentees

On Fri, 10 Nov 2023 03:20:49 +0530, Abhinav Singh wrote:

> Sparse static analysis tools generate a warning with this message
> "Using plain integer as NULL pointer". In this case this warning is
> being shown because we are trying to initialize  pointer to NULL using
> integer value 0.
> 
> 

Applied to 6.8/scsi-queue, thanks!

[1/1] driver: scsi: Fix warning using plain integer as NULL
      https://git.kernel.org/mkp/scsi/c/f38d4eda25e2

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-06  3:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-09 21:50 [PATCH] driver: scsi: Fix warning using plain integer as NULL Abhinav Singh
2023-11-25 19:36 ` Abhinav Singh
2023-12-06  3:16 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).