diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-26 15:03:15 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-26 15:03:15 +0000 |
commit | 96555d383362c30d444593333d60a4588416db62 (patch) | |
tree | df1bb710ebf946f1a7c1b38464ef836fddfee71c /sys/dev/fb | |
parent | 8f98488963488a3a64220dd06361d0286c15cdb4 (diff) | |
download | FreeBSD-src-96555d383362c30d444593333d60a4588416db62.zip FreeBSD-src-96555d383362c30d444593333d60a4588416db62.tar.gz |
sys/dev: extend use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
Diffstat (limited to 'sys/dev/fb')
-rw-r--r-- | sys/dev/fb/vga.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c index 365fca4..d0239b3 100644 --- a/sys/dev/fb/vga.c +++ b/sys/dev/fb/vga.c @@ -1247,8 +1247,8 @@ set_line_length(video_adapter_t *adp, int pixel) switch (adp->va_info.vi_mem_model) { case V_INFO_MM_PLANAR: ppw = 16/(adp->va_info.vi_depth/adp->va_info.vi_planes); - count = (pixel + ppw - 1)/ppw/2; - bpl = ((pixel + ppw - 1)/ppw/2)*4; + count = howmany(pixel, ppw)/2; + bpl = (howmany(pixel, ppw)/2)*4; break; case V_INFO_MM_PACKED: count = (pixel + 7)/8; |