summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorreinoud <reinoud@NetBSD.org>2002-10-02 10:43:06 +0000
committerreinoud <reinoud@NetBSD.org>2002-10-02 10:43:06 +0000
commite46f039e1afbee53d159f972b5447a44e8dd6b5e (patch)
treef4141c319054011d9fc751297255b5ceee3a51a9 /sys/dev
parent772e37cacfcdc37b995f1dfe1da068b7284c07ef (diff)
G/c static pow() function that was used to calculate (2^x) only; replaced
the two instances with equivalent (1<<x).
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/hpc/hpcfb.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/dev/hpc/hpcfb.c b/sys/dev/hpc/hpcfb.c
index 5c6793d0cc6..60b2c7b51a8 100644
--- a/sys/dev/hpc/hpcfb.c
+++ b/sys/dev/hpc/hpcfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hpcfb.c,v 1.25 2002/09/30 21:09:35 thorpej Exp $ */
+/* $NetBSD: hpcfb.c,v 1.26 2002/10/02 10:43:06 reinoud Exp $ */
/*-
* Copyright (c) 1999
@@ -43,13 +43,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.25 2002/09/30 21:09:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.26 2002/10/02 10:43:06 reinoud Exp $");
#define FBDEBUG
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1999 Shin Takemura. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
- "$NetBSD: hpcfb.c,v 1.25 2002/09/30 21:09:35 thorpej Exp $";
+ "$NetBSD: hpcfb.c,v 1.26 2002/10/02 10:43:06 reinoud Exp $";
#include <sys/param.h>
#include <sys/systm.h>
@@ -204,8 +204,6 @@ static void hpcfb_power(int, void *);
static void hpcfb_cmap_reorder(struct hpcfb_fbconf *,
struct hpcfb_devconfig *);
-static int pow(int, int);
-
void hpcfb_cursor(void *, int, int, int);
int hpcfb_mapchar(void *, int, unsigned int *);
void hpcfb_putchar(void *, int, int, u_int, long);
@@ -284,15 +282,6 @@ struct hpcfb_tvrow hpcfb_console_tvram[HPCFB_MAX_ROW];
/*
* function bodies
*/
-static int
-pow(int x, int n)
-{
- int res = 1;
- while (0 < n--) {
- res *= x;
- }
- return (res);
-}
int
hpcfbmatch(struct device *parent, struct cfdata *match, void *aux)
@@ -317,7 +306,7 @@ hpcfbattach(struct device *parent, struct device *self, void *aux)
hpcfb_console_dc.dc_sc = sc;
printf(": %dx%d pixels, %d colors, %dx%d chars",
sc->sc_dc->dc_rinfo.ri_width,sc->sc_dc->dc_rinfo.ri_height,
- pow(2, sc->sc_dc->dc_rinfo.ri_depth),
+ (1 << sc->sc_dc->dc_rinfo.ri_depth),
sc->sc_dc->dc_rinfo.ri_cols,sc->sc_dc->dc_rinfo.ri_rows);
/* Set video chip dependent CLUT if any. */
if (sc->sc_accessops->setclut)
@@ -727,7 +716,7 @@ hpcfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep,
sc->sc_accessops->setclut(sc->sc_accessctx, &dc->dc_rinfo);
printf("hpcfb: %dx%d pixels, %d colors, %dx%d chars\n",
dc->dc_rinfo.ri_width, dc->dc_rinfo.ri_height,
- pow(2, dc->dc_rinfo.ri_depth),
+ (1 << dc->dc_rinfo.ri_depth),
dc->dc_rinfo.ri_cols, dc->dc_rinfo.ri_rows);
/*