qla2xxx: ISP27xx fwdump template fix insertbuf() routine.
authorJoe Carnuccio <joe.carnuccio@qlogic.com>
Thu, 25 Sep 2014 09:16:35 +0000 (05:16 -0400)
committerChristoph Hellwig <hch@lst.de>
Thu, 25 Sep 2014 12:25:01 +0000 (14:25 +0200)
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/qla2xxx/qla_tmpl.c

index 6da9dd272eb316012249697349421d5e79731099..6f2f7b29607d6ac159c03adc80af40de0e72fa2b 100644 (file)
@@ -128,18 +128,10 @@ qla27xx_insert32(uint32_t value, void *buf, ulong *len)
 static inline void
 qla27xx_insertbuf(void *mem, ulong size, void *buf, ulong *len)
 {
-       ulong cnt = size;
 
-       if (buf && mem) {
+       if (buf && mem && size) {
                buf += *len;
-               while (cnt >= sizeof(uint32_t)) {
-                       *(__le32 *)buf = cpu_to_le32p(mem);
-                       buf += sizeof(uint32_t);
-                       mem += sizeof(uint32_t);
-                       cnt -= sizeof(uint32_t);
-               }
-               if (cnt)
-                       memcpy(buf, mem, cnt);
+               memcpy(buf, mem, size);
        }
        *len += size;
 }