ref: 73c37d2db941b91006fb10b7bc76dfbbe1ad72ba
parent: 28a855094261138b64839e35348f30c75c29f233
author: cinap_lenrek <[email protected]>
date: Sun Sep 18 07:58:03 EDT 2022
sdnvme: avoid "empty if body" warning dmaflush() is a no-op macro on amd64, so wrap all calls into {} braces to avoid the compiler warning.
--- a/sys/src/9/port/sdnvme.c
+++ b/sys/src/9/port/sdnvme.c
@@ -211,7 +211,9 @@
SQ *sq = ws->queue;
Ctlr *ctlr = sq->ctlr;
- if(e != nil) dmaflush(1, e, 64);
+ if(e != nil) {
+ dmaflush(1, e, 64);
+ }
coherence();
ctlr->reg[DBell + ((sq-ctlr->sq)*2+0 << ctlr->dstrd)] = sq->tail & sq->mask;
if(sq > ctlr->sq) {
@@ -271,7 +273,9 @@
count -= n;
lba += n;
}
- if(!write) dmaflush(0, a, p - (uchar*)a);
+ if(!write) {
+ dmaflush(0, a, p - (uchar*)a);
+ }
return p - (uchar*)a;
}
@@ -460,9 +464,9 @@
e = qcmd(&ws, ctlr, 1, 0x06, 0, nil, ctlr->nsid, 0x1000);
e[10] = 2; // namespace list
- if(wcmd(&ws, e) == 0)
+ if(wcmd(&ws, e) == 0) {
dmaflush(0, ctlr->nsid, 0x1000);
- else
+ } else
ctlr->nsid[0] = 1; /* assume namespace #1 */
ctlr->nnsid = 0;