Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbppc/explora/dev Misc cleanup for clarity. No fun...



details:   https://anonhg.NetBSD.org/src/rev/1c55f87c8058
branches:  trunk
changeset: 960064:1c55f87c8058
user:      rin <rin%NetBSD.org@localhost>
date:      Sun Mar 07 10:01:03 2021 +0000

description:
Misc cleanup for clarity. No functional changes.

- Group function declarations, and reorder function bodies accordingly.
- Misc KNF.

diffstat:

 sys/arch/evbppc/explora/dev/fb_elb.c |  57 ++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 27 deletions(-)

diffs (145 lines):

diff -r 271896037441 -r 1c55f87c8058 sys/arch/evbppc/explora/dev/fb_elb.c
--- a/sys/arch/evbppc/explora/dev/fb_elb.c      Sun Mar 07 09:48:33 2021 +0000
+++ b/sys/arch/evbppc/explora/dev/fb_elb.c      Sun Mar 07 10:01:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fb_elb.c,v 1.16 2021/03/05 06:50:57 rin Exp $  */
+/*     $NetBSD: fb_elb.c,v 1.17 2021/03/07 10:01:03 rin Exp $  */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fb_elb.c,v 1.16 2021/03/05 06:50:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fb_elb.c,v 1.17 2021/03/07 10:01:03 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -49,6 +49,7 @@
 #include <evbppc/explora/dev/elbvar.h>
 
 #define FB_NPORTS              65536
+#define CMAP_SIZE              256
 
 struct fb_dev {
        void *fb_vram;
@@ -63,10 +64,13 @@
        int sc_nscreens;
 };
 
+void           fb_cnattach(bus_space_tag_t, bus_addr_t, void *);
+
 static int     fb_elb_probe(device_t, cfdata_t, void *);
 static void    fb_elb_attach(device_t, device_t, void *);
-void           fb_cnattach(bus_space_tag_t, bus_addr_t, void *);
+
 static void    fb_init(struct fb_dev *);
+
 static int     fb_ioctl(void *, void *, u_long, void *, int, struct lwp *);
 static paddr_t fb_mmap(void *, void *, off_t, int);
 static int     fb_alloc_screen(void *, const struct wsscreen_descr *, void **,
@@ -111,6 +115,23 @@
        __arraycount(scrlist), scrlist
 };
 
+void
+fb_cnattach(bus_space_tag_t iot, bus_addr_t iobase, void *vram)
+{
+       struct rasops_info *ri = &console_dev.fb_ri;
+       long defattr;
+
+       console_dev.fb_iot = iot;
+       console_dev.fb_ioh = iobase;
+       console_dev.fb_vram = vram;
+
+       fb_init(&console_dev);
+
+       (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+
+       wsdisplay_cnattach(&stdscreen, ri, 0, 0, defattr);
+}
+
 CFATTACH_DECL_NEW(fb_elb, sizeof(struct fb_elb_softc),
     fb_elb_probe, fb_elb_attach, NULL, NULL);
 
@@ -122,7 +143,7 @@
        if (strcmp(oaa->elb_name, cf->cf_name) != 0)
                return 0;
 
-       return (1);
+       return 1;
 }
 
 static void
@@ -206,7 +227,7 @@
        switch (cmd) {
        case WSDISPLAYIO_GTYPE:
                *(int *)data = WSDISPLAY_TYPE_UNKNOWN;  /* XXX */
-               return(0);
+               return 0;
 
        case WSDISPLAYIO_GINFO:
                wdf = (void *)data;
@@ -214,7 +235,7 @@
                wdf->width = ri->ri_width;
                wdf->depth = ri->ri_depth;
                wdf->cmsize = 16; /*XXX*/
-               return(0);
+               return 0;
 
        case WSDISPLAYIO_SVIDEO:
        case WSDISPLAYIO_GETCMAP:
@@ -222,7 +243,7 @@
                break;
        }
 
-       return(EPASSTHROUGH);
+       return EPASSTHROUGH;
 }
 
 static paddr_t
@@ -252,7 +273,7 @@
        (*ri->ri_ops.allocattr)(ri, 0, 0, 0, attrp);
        sc->sc_nscreens++;
 
-       return(0);
+       return 0;
 }
 
 static void
@@ -270,24 +291,8 @@
 fb_show_screen(void *v, void *cookie, int waitok, void (*cb)(void *, int, int),
     void *cbarg)
 {
-       return(0);
-}
 
-void
-fb_cnattach(bus_space_tag_t iot, bus_addr_t iobase, void *vram)
-{
-       struct rasops_info *ri = &console_dev.fb_ri;
-       long defattr;
-
-       console_dev.fb_iot = iot;
-       console_dev.fb_ioh = iobase;
-       console_dev.fb_vram = vram;
-
-       fb_init(&console_dev);
-
-       (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
-
-       wsdisplay_cnattach(&stdscreen, ri, 0, 0, defattr);
+       return 0;
 }
 
 static void
@@ -385,8 +390,6 @@
 #define S3_CSRC_DISPMEM                0x0060
 #define S3_MIX_NEW             0x0007
 
-#define CMAP_SIZE              256
-
 static u_int8_t default_cmap[] = {
        /* black */               0,   0,   0,
        /* red */               192,   0,   0,



Home | Main Index | Thread Index | Old Index