Skip to contentSkip to conversation

aacraid: Use kmemdup rather than duplicating its implementation

PATCH In review Thomas Meyer 3 participants 4 messages Nov 17, 2011 – Nov 22, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aacraid: Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci.

---

drivers/scsi/aacraid/commctrl.c 2011-11-08 10:53:23.848146953 +0100 renamed from drivers/scsi/aacraid/commctrl.c 2011-11-07 19:38:06.463566391 +0100 +3 -4
diff -u -p a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
@@ -631,15 +631,14 @@ static int aac_send_raw_srb(struct aac_d
 			}
 		} else {
 			struct user_sgmap* usg;
-			usg = kmalloc(actual_fibsize - sizeof(struct aac_srb)
-			  + sizeof(struct sgmap), GFP_KERNEL);
+			usg = kmemdup(upsg,
+				      actual_fibsize - sizeof(struct aac_srb) + sizeof(struct sgmap),
+				      GFP_KERNEL);
 			if (!usg) {
 				dprintk((KERN_DEBUG"aacraid: Allocation error in Raw SRB command\n"));
 				rcode = -ENOMEM;
 				goto cleanup;
 			}
-			memcpy (usg, upsg, actual_fibsize - sizeof(struct aac_srb)
-			  + sizeof(struct sgmap));
 			actual_fibsize = actual_fibsize64;
 
 			for (i = 0; i < usg->count; i++) {
#1 lore raw

Ack

This driver is maintained by Achim Leubner <[email protected]> and Mahesh Rajashekhara <[email protected]>. I have added them so that either one of them can have the opportunity to respond.

Sincerely -- Mark Salyzyn

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Thomas Meyer
Sent: Thursday, November 17, 2011 5:44 PM
To: [email protected]; [email protected]; [email protected]
Subject: [PATCH] [SCSI] aacraid: Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci.

---

diff -u -p a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
--- a/drivers/scsi/aacraid/commctrl.c 2011-11-07 19:38:06.463566391 +0100
+++ b/drivers/scsi/aacraid/commctrl.c 2011-11-08 10:53:23.848146953 +0100
@@ -631,15 +631,14 @@ static int aac_send_raw_srb(struct aac_d
}
} else {
struct user_sgmap* usg;
- usg = kmalloc(actual_fibsize - sizeof(struct
aac_srb)
- + sizeof(struct sgmap), GFP_KERNEL);
+ usg = kmemdup(upsg,
+ actual_fibsize - sizeof(struct
aac_srb) + sizeof(struct sgmap),
+ GFP_KERNEL);
if (!usg) {
dprintk((KERN_DEBUG"aacraid: Allocation
error in Raw SRB command\n"));
rcode = -ENOMEM;
goto cleanup;
}
- memcpy (usg, upsg, actual_fibsize -
sizeof(struct aac_srb)
- + sizeof(struct sgmap));
actual_fibsize = actual_fibsize64;

for (i = 0; i < usg->count; i++) {

#2 lore raw
Quoted 8 lines

-----Original Message-----
The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci.

---

diff -u -p a/drivers/scsi/aacraid/commctrl.c

Quoted 4 lines · Mark Salyzyn

This driver is maintained by Achim Leubner <[email protected]> and Mahesh Rajashekhara <[email protected]>. I have added them so that either one of them can have the opportunity to respond.

Really? MAINTAINERS has:

AACRAID SCSI RAID DRIVER
M: Adaptec OEM Raid Solutions <[email protected]>
L: [email protected]
W: http://www.adaptec.com/
S: Supported
F: Documentation/scsi/aacraid.txt
F: drivers/scsi/aacraid/

Should either or both Achim or Mahesh be added?

#3 lore raw

[email protected] goes to them, I may have done a boo-boo by exposing the current underlying addressees. As it stands the patch was not addressed to any of the aacraid maintainers. The correct answer would have been for me to Cc: [email protected].

The MAINTAINERS file is *correct*. It has dealt with the arbitrary transition of individual assigned maintainers within Adaptec (now PMC) for nearly a decade now.

Sincerely -- Mark Salyzyn (former maintainer, interested party now)

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Joe Perches
Sent: Tuesday, November 22, 2011 10:57 AM
To: Mark Salyzyn
Cc: Thomas Meyer; [email protected]; [email protected]; [email protected]; Achim Leubner; Mahesh Rajashekhara
Subject: RE: [PATCH] [SCSI] aacraid: Use kmemdup rather than duplicating its implementation

Quoted 8 lines

-----Original Message-----
The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci.

---

diff -u -p a/drivers/scsi/aacraid/commctrl.c

Quoted 4 lines · Mark Salyzyn

This driver is maintained by Achim Leubner <[email protected]> and Mahesh Rajashekhara <[email protected]>. I have added them so that either one of them can have the opportunity to respond.

Really? MAINTAINERS has:

AACRAID SCSI RAID DRIVER
M: Adaptec OEM Raid Solutions <[email protected]>
L: [email protected]
W: http://www.adaptec.com/
S: Supported
F: Documentation/scsi/aacraid.txt
F: drivers/scsi/aacraid/

Should either or both Achim or Mahesh be added?