Skip to contentSkip to conversation

platform/surface: Replace deprecated strcpy + strcat in blogic_rdconfig

PATCH RESEND Applied Thorsten Blum 2 participants 4 messages Feb 24 – Feb 28

Subsystems (2)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 platform/surface: Replace deprecated strcpy + strcat in blogic_rdconfig

strcpy() is deprecated [1] and using strcat() is discouraged. Replace them with scnprintf(). No functional changes.

---
 drivers/scsi/BusLogic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/BusLogic.c +2 -2
index da6599ae3d0d..5304d2febd63 100644
@@ -1632,8 +1632,8 @@ static bool __init blogic_rdconfig(struct blogic_adapter *adapter)
 	/*
 	   Initialize the Host Adapter Full Model Name from the Model Name.
 	 */
-	strcpy(adapter->full_model, "BusLogic ");
-	strcat(adapter->full_model, adapter->model);
+	scnprintf(adapter->full_model, sizeof(adapter->full_model),
+		  "BusLogic %s", adapter->model);
 	/*
 	   Select an appropriate value for the Tagged Queue Depth either from a
 	   BusLogic Driver Options specification, or based on whether this Host
Signature · 2 lines
Thorsten Blum <[email protected]>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4
#1 lore raw

Thorsten,

drivers/scsi/BusLogic.c

Quoted 1 line
drivers/scsi/BusLogic.c +0 -0

...and yet tagged as "platform/surface:" in Subject. I fixed it up.

Signature · 1 line
Martin K. Petersen
#2 lore raw
Quoted 3 lines · Martin K. Petersen

drivers/scsi/BusLogic.c

Quoted 1 line
drivers/scsi/BusLogic.c +0 -0

...and yet tagged as "platform/surface:" in Subject. I fixed it up.

Sorry Martin, no idea how that happened. Thanks for fixing it.

Best,
Thorsten