Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys avoid uninitialized use of defattr
details: https://anonhg.NetBSD.org/src/rev/3ef035d24c7b
branches: trunk
changeset: 788953:3ef035d24c7b
user: macallan <macallan%NetBSD.org@localhost>
date: Tue Jul 30 19:16:50 2013 +0000
description:
avoid uninitialized use of defattr
diffstat:
sys/arch/sparc64/dev/ffb.c | 9 +++++----
sys/dev/ic/ct65550.c | 8 +++++---
sys/dev/pci/machfb.c | 7 ++++---
sys/dev/pci/pm2fb.c | 14 +++++++++++---
sys/dev/pci/r128fb.c | 7 ++++---
sys/dev/pci/tdvfb.c | 13 ++++++++-----
sys/dev/pci/voodoofb.c | 15 ++++++++-------
sys/dev/pci/voyager/voyagerfb.c | 7 ++++---
sys/dev/sbus/agten.c | 8 +++++---
sys/dev/sun/cgsix.c | 7 ++++---
10 files changed, 58 insertions(+), 37 deletions(-)
diffs (truncated from 323 to 300 lines):
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/arch/sparc64/dev/ffb.c
--- a/sys/arch/sparc64/dev/ffb.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/arch/sparc64/dev/ffb.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffb.c,v 1.52 2012/08/09 00:48:06 macallan Exp $ */
+/* $NetBSD: ffb.c,v 1.53 2013/07/30 19:16:50 macallan Exp $ */
/* $OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.52 2012/08/09 00:48:06 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.53 2013/07/30 19:16:50 macallan Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -339,6 +339,7 @@
vcons_init(&sc->vd, sc, &ffb_stdscreen, &ffb_accessops);
sc->vd.init_screen = ffb_init_screen;
+ ri = &ffb_console_screen.scr_ri;
/* we mess with ffb_console_screen only once */
if (sc->sc_console) {
@@ -354,9 +355,9 @@
if (ffb_console_screen.scr_ri.ri_rows == 0) {
/* do some minimal setup to avoid weirdnesses later */
vcons_init_screen(&sc->vd, &ffb_console_screen, 1, &defattr);
- }
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
}
- ri = &ffb_console_screen.scr_ri;
ffb_stdscreen.nrows = ri->ri_rows;
ffb_stdscreen.ncols = ri->ri_cols;
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/ic/ct65550.c
--- a/sys/dev/ic/ct65550.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/ic/ct65550.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ct65550.c,v 1.6 2012/08/22 21:17:58 macallan Exp $ */
+/* $NetBSD: ct65550.c,v 1.7 2013/07/30 19:24:26 macallan Exp $ */
/*
* Copyright (c) 2006 Michael Lorenz
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ct65550.c,v 1.6 2012/08/22 21:17:58 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ct65550.c,v 1.7 2013/07/30 19:24:26 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -259,7 +259,9 @@
/* do some minimal setup to avoid weirdnesses later */
vcons_init_screen(&sc->vd, &chipsfb_console_screen, 1,
&defattr);
- }
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+
}
rasops_unpack_attr(defattr, &fg, &bg, &ul);
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/pci/machfb.c
--- a/sys/dev/pci/machfb.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/pci/machfb.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machfb.c,v 1.87 2013/05/28 10:55:34 macallan Exp $ */
+/* $NetBSD: machfb.c,v 1.88 2013/07/30 19:21:50 macallan Exp $ */
/*
* Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0,
- "$NetBSD: machfb.c,v 1.87 2013/05/28 10:55:34 macallan Exp $");
+ "$NetBSD: machfb.c,v 1.88 2013/07/30 19:21:50 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -796,7 +796,8 @@
/* do some minimal setup to avoid weirdnesses later */
vcons_init_screen(&sc->vd, &mach64_console_screen, 1,
&defattr);
- }
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
glyphcache_init(&sc->sc_gc, sc->sc_my_mode->vdisplay + 5,
((sc->memsize * 1024) / sc->sc_my_mode->hdisplay) -
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/pci/pm2fb.c
--- a/sys/dev/pci/pm2fb.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/pci/pm2fb.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pm2fb.c,v 1.22 2013/06/28 15:26:57 christos Exp $ */
+/* $NetBSD: pm2fb.c,v 1.23 2013/07/30 19:21:50 macallan Exp $ */
/*
* Copyright (c) 2009, 2012 Michael Lorenz
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.22 2013/06/28 15:26:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.23 2013/07/30 19:21:50 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -405,7 +405,8 @@
/* do some minimal setup to avoid weirdnesses later */
vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
&defattr);
- }
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
min(2047, (sc->sc_fbsize / sc->sc_stride))
- sc->sc_height - 5,
@@ -502,9 +503,16 @@
if (new_mode != sc->sc_mode) {
sc->sc_mode = new_mode;
if(new_mode == WSDISPLAYIO_MODE_EMUL) {
+ /* first set the video mode */
+ if (sc->sc_videomode != NULL) {
+ pm2fb_set_mode(sc, sc->sc_videomode);
+ }
+ /* then initialize the drawing engine */
pm2fb_init(sc);
pm2fb_restore_palette(sc);
+ /* clean out the glyph cache */
glyphcache_wipe(&sc->sc_gc);
+ /* and redraw everything */
vcons_redraw_screen(ms);
} else
pm2fb_flush_engine(sc);
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/pci/r128fb.c
--- a/sys/dev/pci/r128fb.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/pci/r128fb.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: r128fb.c,v 1.36 2012/10/04 10:22:45 macallan Exp $ */
+/* $NetBSD: r128fb.c,v 1.37 2013/07/30 19:21:50 macallan Exp $ */
/*
* Copyright (c) 2007, 2012 Michael Lorenz
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.36 2012/10/04 10:22:45 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.37 2013/07/30 19:21:50 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -311,7 +311,8 @@
/* do some minimal setup to avoid weirdnesses later */
vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
&defattr);
- }
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
(0x800000 / sc->sc_stride) - sc->sc_height - 5,
sc->sc_width,
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/pci/tdvfb.c
--- a/sys/dev/pci/tdvfb.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/pci/tdvfb.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tdvfb.c,v 1.5 2013/01/31 11:57:07 rkujawa Exp $ */
+/* $NetBSD: tdvfb.c,v 1.6 2013/07/30 19:21:50 macallan Exp $ */
/*
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tdvfb.c,v 1.5 2013/01/31 11:57:07 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tdvfb.c,v 1.6 2013/07/30 19:21:50 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -266,9 +266,12 @@
wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
defattr);
vcons_replay_msgbuf(&sc->sc_console_screen);
- } else if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
- vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
- &defattr);
+ } else {
+ if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
+ vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
+ &defattr);
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
}
ws_aa.console = console;
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/pci/voodoofb.c
--- a/sys/dev/pci/voodoofb.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/pci/voodoofb.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: voodoofb.c,v 1.44 2013/07/02 00:18:24 joerg Exp $ */
+/* $NetBSD: voodoofb.c,v 1.45 2013/07/30 19:21:50 macallan Exp $ */
/*
* Copyright (c) 2005, 2006, 2012 Michael Lorenz
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.44 2013/07/02 00:18:24 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.45 2013/07/30 19:21:50 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -463,11 +463,12 @@
voodoofb_defaultscreen.ncols = ri->ri_cols;
wsdisplay_cnattach(&voodoofb_defaultscreen, ri, 0, 0, defattr);
} else {
- /*
- * since we're not the console we can postpone the rest
- * until someone actually allocates a screen for us
- */
- voodoofb_set_videomode(sc, sc->sc_videomode);
+ if (voodoofb_console_screen.scr_ri.ri_rows == 0) {
+ /* do some minimal setup to avoid weirdnesses later */
+ vcons_init_screen(&sc->vd, &voodoofb_console_screen,
+ 1, &defattr);
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
}
printf("%s: %d MB aperture at 0x%08x, %d MB registers at 0x%08x\n",
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/pci/voyager/voyagerfb.c
--- a/sys/dev/pci/voyager/voyagerfb.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/pci/voyager/voyagerfb.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: voyagerfb.c,v 1.25 2013/03/19 16:49:56 macallan Exp $ */
+/* $NetBSD: voyagerfb.c,v 1.26 2013/07/30 19:21:50 macallan Exp $ */
/*
* Copyright (c) 2009, 2011 Michael Lorenz
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.25 2013/03/19 16:49:56 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.26 2013/07/30 19:21:50 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -321,7 +321,8 @@
/* do some minimal setup to avoid weirdness later */
vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
&defattr);
- }
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
}
glyphcache_init(&sc->sc_gc, sc->sc_height,
(sc->sc_fbsize / sc->sc_stride) - sc->sc_height,
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/sbus/agten.c
--- a/sys/dev/sbus/agten.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/sbus/agten.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: agten.c,v 1.30 2012/10/23 11:53:18 macallan Exp $ */
+/* $NetBSD: agten.c,v 1.31 2013/07/30 19:24:26 macallan Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.30 2012/10/23 11:53:18 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.31 2013/07/30 19:24:26 macallan Exp $");
/*
* a driver for the Fujitsu AG-10e SBus framebuffer
@@ -350,7 +350,9 @@
/* do some minimal setup to avoid weirdnesses later */
vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
&defattr);
- }
+ } else
+ (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+
glyphcache_init(&sc->sc_gc,
sc->sc_height + 5,
(0x400000 / sc->sc_stride) - sc->sc_height - 5,
diff -r 2fbb8a07d0ff -r 3ef035d24c7b sys/dev/sun/cgsix.c
--- a/sys/dev/sun/cgsix.c Tue Jul 30 19:09:57 2013 +0000
+++ b/sys/dev/sun/cgsix.c Tue Jul 30 19:16:50 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgsix.c,v 1.60 2012/11/13 20:47:58 macallan Exp $ */
Home |
Main Index |
Thread Index |
Old Index