Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/xbox ioctl: KNF switch-case



details:   https://anonhg.NetBSD.org/src/rev/c8dfb18fca00
branches:  trunk
changeset: 759756:c8dfb18fca00
user:      cegger <cegger%NetBSD.org@localhost>
date:      Thu Dec 16 07:59:10 2010 +0000

description:
ioctl: KNF switch-case

diffstat:

 sys/arch/i386/xbox/xboxfb.c |  57 ++++++++++++++++++++++----------------------
 1 files changed, 28 insertions(+), 29 deletions(-)

diffs (85 lines):

diff -r 1ef391048f23 -r c8dfb18fca00 sys/arch/i386/xbox/xboxfb.c
--- a/sys/arch/i386/xbox/xboxfb.c       Thu Dec 16 07:51:21 2010 +0000
+++ b/sys/arch/i386/xbox/xboxfb.c       Thu Dec 16 07:59:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xboxfb.c,v 1.13 2010/04/28 19:17:04 dyoung Exp $       */
+/*     $NetBSD: xboxfb.c,v 1.14 2010/12/16 07:59:10 cegger Exp $       */
 
 /*
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xboxfb.c,v 1.13 2010/04/28 19:17:04 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xboxfb.c,v 1.14 2010/12/16 07:59:10 cegger Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -244,40 +244,39 @@
        struct vcons_screen *ms = vd->active;
 
        switch (cmd) {
-               case WSDISPLAYIO_GTYPE:
-                       *(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
-                       return 0;
+       case WSDISPLAYIO_GTYPE:
+               *(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
+               return 0;
 
-               case WSDISPLAYIO_GINFO:
-                       wdf = (void *)data;
-                       wdf->height = xboxfb_console_height;
-                       wdf->width = xboxfb_console_width;
-                       wdf->depth = ms->scr_ri.ri_depth;
-                       wdf->cmsize = 256;
-                       return 0;
+       case WSDISPLAYIO_GINFO:
+               wdf = (void *)data;
+               wdf->height = xboxfb_console_height;
+               wdf->width = xboxfb_console_width;
+               wdf->depth = ms->scr_ri.ri_depth;
+               wdf->cmsize = 256;
+               return 0;
 
-               case WSDISPLAYIO_GETCMAP:
-                       return EINVAL;
+       case WSDISPLAYIO_GETCMAP:
+               return EINVAL;
 
-               case WSDISPLAYIO_PUTCMAP:
-                       return EINVAL;
+       case WSDISPLAYIO_PUTCMAP:
+               return EINVAL;
 
-               case WSDISPLAYIO_LINEBYTES:
-                       *(u_int *)data = ms->scr_ri.ri_stride;
-                       return 0;
+       case WSDISPLAYIO_LINEBYTES:
+               *(u_int *)data = ms->scr_ri.ri_stride;
+               return 0;
 
-               case WSDISPLAYIO_SMODE:
-                       {
-                               int new_mode = *(int *)data;
-                               if (new_mode != sc->sc_mode) {
-                                       sc->sc_mode = new_mode;
-                                       if (new_mode == WSDISPLAYIO_MODE_EMUL) {
-                                               xboxfb_clear_fb(sc);
-                                               vcons_redraw_screen(vd->active);
-                                       }
+       case WSDISPLAYIO_SMODE: {
+                       int new_mode = *(int *)data;
+                       if (new_mode != sc->sc_mode) {
+                               sc->sc_mode = new_mode;
+                               if (new_mode == WSDISPLAYIO_MODE_EMUL) {
+                                       xboxfb_clear_fb(sc);
+                                       vcons_redraw_screen(vd->active);
                                }
                        }
-                       return 0;
+               }
+               return 0;
        }
        return EPASSTHROUGH;
 }



Home | Main Index | Thread Index | Old Index