public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH] driver/scsi/mpi3mr.h: Fix build warning for mpi3mr_start_watchdog
@ 2025-09-24 16:06 Bartlomiej Kubik
  2025-10-07 21:17 ` Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Kubik @ 2025-09-24 16:06 UTC (permalink / raw)
  To: sathya.prakash, kashyap.desai, sumit.saxena, sreekanth.reddy,
	James.Bottomley, martin.petersen
  Cc: mpi3mr-linuxdrv.pdl, linux-scsi, skhan, david.hunter.linux,
	linux-kernel-mentees, Bartlomiej Kubik

Fix watchdog name truncation.

In function mpi3mr_start_watchdog, watchdog_work_q_name is build
snprintf(mrioc->watchdog_work_q_name,
	sizeof(mrioc->watchdog_work_q_name), "watchdog_%s%d", mrioc->name,
	mrioc->id);

Signed-off-by: Bartlomiej Kubik <kubik.bartlomiej@gmail.com>
---
 drivers/scsi/mpi3mr/mpi3mr.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h
index 8d4ef49e04d1..5307fcdf216f 100644
--- a/drivers/scsi/mpi3mr/mpi3mr.h
+++ b/drivers/scsi/mpi3mr/mpi3mr.h
@@ -66,6 +66,7 @@ extern atomic64_t event_counter;

 #define MPI3MR_NAME_LENGTH	64
 #define IOCNAME			"%s: "
+#define MPI3MR_WATCHDOG_NAME_LENGTH	(MPI3MR_NAME_LENGTH + 15)

 #define MPI3MR_DEFAULT_MAX_IO_SIZE	(1 * 1024 * 1024)

@@ -1261,7 +1262,7 @@ struct mpi3mr_ioc {
 	spinlock_t fwevt_lock;
 	struct list_head fwevt_list;

-	char watchdog_work_q_name[50];
+	char watchdog_work_q_name[MPI3MR_WATCHDOG_NAME_LENGTH];
 	struct workqueue_struct *watchdog_work_q;
 	struct delayed_work watchdog_work;
 	spinlock_t watchdog_lock;
--
2.39.5


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

* Re: [PATCH] driver/scsi/mpi3mr.h: Fix build warning for mpi3mr_start_watchdog
  2025-09-24 16:06 [PATCH] driver/scsi/mpi3mr.h: Fix build warning for mpi3mr_start_watchdog Bartlomiej Kubik
@ 2025-10-07 21:17 ` Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2025-10-07 21:17 UTC (permalink / raw)
  To: Bartlomiej Kubik, sathya.prakash, kashyap.desai, sumit.saxena,
	sreekanth.reddy, James.Bottomley, martin.petersen
  Cc: mpi3mr-linuxdrv.pdl, linux-scsi, david.hunter.linux,
	linux-kernel-mentees, Shuah Khan

On 9/24/25 10:06, Bartlomiej Kubik wrote:
> Fix watchdog name truncation.
> 
> In function mpi3mr_start_watchdog, watchdog_work_q_name is build
> snprintf(mrioc->watchdog_work_q_name,
> 	sizeof(mrioc->watchdog_work_q_name), "watchdog_%s%d", mrioc->name,
> 	mrioc->id);

Include build warning in the commit message

> 
> Signed-off-by: Bartlomiej Kubik <kubik.bartlomiej@gmail.com>
> ---
>   drivers/scsi/mpi3mr/mpi3mr.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h
> index 8d4ef49e04d1..5307fcdf216f 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr.h
> +++ b/drivers/scsi/mpi3mr/mpi3mr.h
> @@ -66,6 +66,7 @@ extern atomic64_t event_counter;
> 
>   #define MPI3MR_NAME_LENGTH	64
>   #define IOCNAME			"%s: "
> +#define MPI3MR_WATCHDOG_NAME_LENGTH	(MPI3MR_NAME_LENGTH + 15)

This 15 looks random to me?

> 
>   #define MPI3MR_DEFAULT_MAX_IO_SIZE	(1 * 1024 * 1024)
> 
> @@ -1261,7 +1262,7 @@ struct mpi3mr_ioc {
>   	spinlock_t fwevt_lock;
>   	struct list_head fwevt_list;
> 
> -	char watchdog_work_q_name[50];
> +	char watchdog_work_q_name[MPI3MR_WATCHDOG_NAME_LENGTH];
>   	struct workqueue_struct *watchdog_work_q;
>   	struct delayed_work watchdog_work;
>   	spinlock_t watchdog_lock;
> --
> 2.39.5
> 

You are changing the structure size here? How did you test this
patch? DO you have this scsi card to test and make sure this
change doesn't introduce regressions?

thanks,
-- Shuah


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

end of thread, other threads:[~2025-10-07 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24 16:06 [PATCH] driver/scsi/mpi3mr.h: Fix build warning for mpi3mr_start_watchdog Bartlomiej Kubik
2025-10-07 21:17 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox