Skip to content

Commit b259695

Browse files
committed
Add a few casts to int, for clarity. Fix indentation while there.
1 parent a5edde0 commit b259695

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

sys/uvm/uvm_pdaemon.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ uvmpd_scan_inactive(struct pglist *pglst)
382382
* update our copy of "free" and see if we've met
383383
* our target
384384
*/
385-
free = uvmexp.free - BUFPAGES_DEFICIT;
385+
free = (int)(uvmexp.free - BUFPAGES_DEFICIT);
386386

387387
if (free + uvmexp.paging >= uvmexp.freetarg << 2 ||
388388
dirtyreacts == UVMPD_NUMDIRTYREACTS) {
@@ -563,7 +563,7 @@ uvmpd_scan_inactive(struct pglist *pglst)
563563
}
564564
if (p->pg_flags & PQ_AOBJ) {
565565
uao_dropswap(p->uobject,
566-
p->offset >> PAGE_SHIFT);
566+
(int)(p->offset >> PAGE_SHIFT));
567567
}
568568
}
569569

@@ -596,7 +596,7 @@ uvmpd_scan_inactive(struct pglist *pglst)
596596
}
597597
} else {
598598
uao_dropswap(uobj,
599-
p->offset >> PAGE_SHIFT);
599+
(int)(p->offset >> PAGE_SHIFT));
600600
}
601601

602602
/* start new cluster (if necessary) */
@@ -627,7 +627,7 @@ uvmpd_scan_inactive(struct pglist *pglst)
627627
anon->an_swslot = swslot + swcpages;
628628
else
629629
uao_set_swslot(uobj,
630-
p->offset >> PAGE_SHIFT,
630+
(int)(p->offset >> PAGE_SHIFT),
631631
swslot + swcpages);
632632
swcpages++;
633633
}
@@ -877,7 +877,7 @@ uvmpd_scan(void)
877877
/*
878878
* get current "free" page count
879879
*/
880-
free = uvmexp.free - BUFPAGES_DEFICIT;
880+
free = (int)(uvmexp.free - BUFPAGES_DEFICIT);
881881

882882
#ifndef __SWAP_BROKEN
883883
/*
@@ -917,7 +917,8 @@ uvmpd_scan(void)
917917
* we have done the scan to get free pages. now we work on meeting
918918
* our inactive target.
919919
*/
920-
inactive_shortage = uvmexp.inactarg - uvmexp.inactive - BUFPAGES_INACT;
920+
inactive_shortage = (int)(uvmexp.inactarg - uvmexp.inactive -
921+
BUFPAGES_INACT);
921922

922923
/*
923924
* detect if we're not going to be able to page anything out
@@ -980,7 +981,7 @@ uvmpd_scan(void)
980981
}
981982
if (p->pg_flags & PQ_AOBJ) {
982983
int slot = uao_set_swslot(p->uobject,
983-
p->offset >> PAGE_SHIFT, 0);
984+
(int)(p->offset >> PAGE_SHIFT), 0);
984985
if (slot) {
985986
uvm_swap_free(slot, 1);
986987
atomic_clearbits_int(&p->pg_flags,

0 commit comments

Comments
 (0)