Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1595530
| From | Matthew Wilcox <willy@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/5] sym53c8xx_2: Convert to use memset32() |
| Date | 2017-03-08 22:10 +0100 |
| Message-ID | <tiR0n-3EK-49@gated-at.bofh.it> (permalink) |
| References | <tiR0l-3EK-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Matthew Wilcox <mawilcox@microsoft.com>
memset32() can be used to initialise these three arrays. Minor code
footprint reduction.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
---
drivers/scsi/sym53c8xx_2/sym_hipd.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index 6b349e301869..b886b10e3499 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -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
--
2.11.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC 0/5] memset_l and memfill Matthew Wilcox <willy@infradead.org> - 2017-03-08 22:10 +0100 [PATCH 2/5] zram: Convert to using memset_l() Matthew Wilcox <willy@infradead.org> - 2017-03-08 22:10 +0100 [PATCH 3/5] sym53c8xx_2: Convert to use memset32() Matthew Wilcox <willy@infradead.org> - 2017-03-08 22:10 +0100 [PATCH 5/5] Hacky testsuite for memfill() and memset_l() Matthew Wilcox <willy@infradead.org> - 2017-03-08 22:10 +0100 [PATCH 1/5] Add memset_l(), memset32() and memset64() Matthew Wilcox <willy@infradead.org> - 2017-03-08 23:10 +0100
csiph-web