drivers/scsi/sym53c8xx_2/sym_hipd.c: convert to use memset32
authorMatthew Wilcox <[email protected]>
Fri, 8 Sep 2017 23:14:11 +0000 (16:14 -0700)
committerLinus Torvalds <[email protected]>
Sat, 9 Sep 2017 01:26:48 +0000 (18:26 -0700)
memset32() can be used to initialise these three arrays.  Minor code
footprint reduction.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: David Miller <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: Matt Turner <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Russell King <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/scsi/sym53c8xx_2/sym_hipd.c

index 15ff285a9f8f746ee7946e65f4f6264a5a524f67..ca360daa6a253c7a9a0f4f29eaeaf5a49a1a8c98 100644 (file)
@@ -4985,13 +4985,10 @@ struct sym_lcb *sym_alloc_lcb (struct sym_hcb *np, u_char tn, u_char ln)
         *  Compute the bus address of this table.
         */
        if (ln && !tp->luntbl) {
-               int i;
-
                tp->luntbl = sym_calloc_dma(256, "LUNTBL");
                if (!tp->luntbl)
                        goto fail;
-               for (i = 0 ; i < 64 ; i++)
-                       tp->luntbl[i] = cpu_to_scr(vtobus(&np->badlun_sa));
+               memset32(tp->luntbl, cpu_to_scr(vtobus(&np->badlun_sa)), 64);
                tp->head.luntbl_sa = cpu_to_scr(vtobus(tp->luntbl));
        }
 
@@ -5077,8 +5074,7 @@ static void sym_alloc_lcb_tags (struct sym_hcb *np, u_char tn, u_char ln)
        /*
         *  Initialize the task table with invalid entries.
         */
-       for (i = 0 ; i < SYM_CONF_MAX_TASK ; i++)
-               lp->itlq_tbl[i] = cpu_to_scr(np->notask_ba);
+       memset32(lp->itlq_tbl, cpu_to_scr(np->notask_ba), SYM_CONF_MAX_TASK);
 
        /*
         *  Fill up the tag buffer with tag numbers.
@@ -5764,8 +5760,7 @@ int sym_hcb_attach(struct Scsi_Host *shost, struct sym_fw *fw, struct sym_nvram
                goto attach_failed;
 
        np->badlun_sa = cpu_to_scr(SCRIPTB_BA(np, resel_bad_lun));
-       for (i = 0 ; i < 64 ; i++)      /* 64 luns/target, no less */
-               np->badluntbl[i] = cpu_to_scr(vtobus(&np->badlun_sa));
+       memset32(np->badluntbl, cpu_to_scr(vtobus(&np->badlun_sa)), 64);
 
        /*
         *  Prepare the bus address array that contains the bus