Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys set default WARNS for modules to 3 -- the only one that ...
details: https://anonhg.NetBSD.org/src/rev/d7676bacb92f
branches: trunk
changeset: 768883:d7676bacb92f
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Aug 28 15:40:49 2011 +0000
description:
set default WARNS for modules to 3 -- the only one that needs < 3 now is pf
diffstat:
sys/dev/pci/azalia.c | 72 ++++++------------------
sys/external/bsd/drm/dist/bsd-core/i915_drv.c | 59 +++++--------------
sys/external/bsd/drm/dist/bsd-core/radeon_drv.c | 62 +++++---------------
sys/modules/Makefile.inc | 4 +-
sys/modules/azalia/Makefile | 3 +-
sys/modules/azalia/azalia.ioconf | 10 +++
sys/modules/i915drm/Makefile | 3 +-
sys/modules/i915drm/i915drm.ioconf | 9 +++
sys/modules/pf/Makefile | 3 +-
sys/modules/radeondrm/Makefile | 3 +-
sys/modules/radeondrm/radeondrm.ioconf | 9 +++
11 files changed, 89 insertions(+), 148 deletions(-)
diffs (truncated from 392 to 300 lines):
diff -r a48bcceac599 -r d7676bacb92f sys/dev/pci/azalia.c
--- a/sys/dev/pci/azalia.c Sun Aug 28 11:36:17 2011 +0000
+++ b/sys/dev/pci/azalia.c Sun Aug 28 15:40:49 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: azalia.c,v 1.75 2010/05/25 08:37:10 pgoyette Exp $ */
+/* $NetBSD: azalia.c,v 1.76 2011/08/28 15:40:49 jmcneill Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.75 2010/05/25 08:37:10 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.76 2011/08/28 15:40:49 jmcneill Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -2406,69 +2406,33 @@
return 0;
}
-#ifdef _MODULE
-
MODULE(MODULE_CLASS_DRIVER, azalia, NULL);
-static const struct cfiattrdata audiobuscf_iattrdata = {
- "audiobus", 0, { { NULL, NULL, 0 }, }
-};
-static const struct cfiattrdata * const azalia_attrs[] = {
- &audiobuscf_iattrdata, NULL
-};
-CFDRIVER_DECL(azalia, DV_DULL, azalia_attrs);
-extern struct cfattach azalia_ca;
-static int azalialoc[] = { -1, -1 };
-static struct cfparent pciparent = {
- "pci", "pci", DVUNIT_ANY
-};
-static struct cfdata azalia_cfdata[] = {
- {
- .cf_name = "azalia",
- .cf_atname = "azalia",
- .cf_unit = 0,
- .cf_fstate = FSTATE_STAR,
- .cf_loc = azalialoc,
- .cf_flags = 0,
- .cf_pspec = &pciparent,
- },
- { NULL }
-};
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
static int
azalia_modcmd(modcmd_t cmd, void *arg)
{
- int err, s;
+ int error = 0;
switch (cmd) {
case MODULE_CMD_INIT:
- err = config_cfdriver_attach(&azalia_cd);
- if (err)
- return err;
- err = config_cfattach_attach("azalia", &azalia_ca);
- if (err) {
- config_cfdriver_detach(&azalia_cd);
- return err;
- }
- s = splaudio();
- err = config_cfdata_attach(azalia_cfdata, 1);
- splx(s);
- if (err) {
- config_cfattach_detach("azalia", &azalia_ca);
- config_cfdriver_detach(&azalia_cd);
- return err;
- }
- return 0;
+#ifdef _MODULE
+ error = config_init_component(cfdriver_ioconf_azalia,
+ cfattach_ioconf_azalia, cfdata_ioconf_azalia);
+#endif
+ break;
case MODULE_CMD_FINI:
- err = config_cfdata_detach(azalia_cfdata);
- if (err)
- return err;
- config_cfattach_detach("azalia", &azalia_ca);
- config_cfdriver_detach(&azalia_cd);
- return 0;
+#ifdef _MODULE
+ error = config_fini_component(cfdriver_ioconf_azalia,
+ cfattach_ioconf_azalia, cfdata_ioconf_azalia);
+#endif
+ break;
default:
return ENOTTY;
}
+
+ return error;
}
-
-#endif
diff -r a48bcceac599 -r d7676bacb92f sys/external/bsd/drm/dist/bsd-core/i915_drv.c
--- a/sys/external/bsd/drm/dist/bsd-core/i915_drv.c Sun Aug 28 11:36:17 2011 +0000
+++ b/sys/external/bsd/drm/dist/bsd-core/i915_drv.c Sun Aug 28 15:40:49 2011 +0000
@@ -214,62 +214,35 @@
CFATTACH_DECL_NEW(i915drm, sizeof(struct drm_device), i915drm_probe,
i915drm_attach, i915drm_detach, NULL);
-#ifdef _MODULE
-
MODULE(MODULE_CLASS_DRIVER, i915drm, "drm");
-CFDRIVER_DECL(i915drm, DV_DULL, NULL);
-extern struct cfattach i915drm_ca;
-static int drmloc[] = { -1 };
-static struct cfparent drmparent = {
- "drm", "vga", DVUNIT_ANY
-};
-static struct cfdata i915drm_cfdata[] = {
- {
- .cf_name = "i915drm",
- .cf_atname = "i915drm",
- .cf_unit = 0,
- .cf_fstate = FSTATE_STAR,
- .cf_loc = drmloc,
- .cf_flags = 0,
- .cf_pspec = &drmparent,
- },
- { NULL }
-};
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
static int
i915drm_modcmd(modcmd_t cmd, void *arg)
{
- int err;
+ int error = 0;
switch (cmd) {
case MODULE_CMD_INIT:
- err = config_cfdriver_attach(&i915drm_cd);
- if (err)
- return err;
- err = config_cfattach_attach("i915drm", &i915drm_ca);
- if (err) {
- config_cfdriver_detach(&i915drm_cd);
- return err;
- }
- err = config_cfdata_attach(i915drm_cfdata, 1);
- if (err) {
- config_cfattach_detach("i915drm", &i915drm_ca);
- config_cfdriver_detach(&i915drm_cd);
- return err;
- }
- return 0;
+#ifdef _MODULE
+ error = config_init_component(cfdriver_ioconf_i915drm,
+ cfattach_ioconf_i915drm, cfdata_ioconf_i915drm);
+#endif
+ break;
case MODULE_CMD_FINI:
- err = config_cfdata_detach(i915drm_cfdata);
- if (err)
- return err;
- config_cfattach_detach("i915drm", &i915drm_ca);
- config_cfdriver_detach(&i915drm_cd);
- return 0;
+#ifdef _MODULE
+ error = config_fini_component(cfdriver_ioconf_i915drm,
+ cfattach_ioconf_i915drm, cfdata_ioconf_i915drm);
+#endif
+ break;
default:
return ENOTTY;
}
+
+ return 0;
}
-#endif /* _MODULE */
#endif
diff -r a48bcceac599 -r d7676bacb92f sys/external/bsd/drm/dist/bsd-core/radeon_drv.c
--- a/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c Sun Aug 28 11:36:17 2011 +0000
+++ b/sys/external/bsd/drm/dist/bsd-core/radeon_drv.c Sun Aug 28 15:40:49 2011 +0000
@@ -201,64 +201,36 @@
CFATTACH_DECL_NEW(radeondrm, sizeof(struct drm_device),
radeondrm_probe, radeondrm_attach, radeondrm_detach, NULL);
-#ifdef _MODULE
-
-MODULE(MODULE_CLASS_DRIVER, radeondrm, NULL);
+MODULE(MODULE_CLASS_DRIVER, radeondrm, "drm");
-CFDRIVER_DECL(radeondrm, DV_DULL, NULL);
-extern struct cfattach radeondrm_ca;
-static int drmloc[] = { -1 };
-static struct cfparent drmparent = {
- "drm", "vga", DVUNIT_ANY
-};
-static struct cfdata radeondrm_cfdata[] = {
- {
- .cf_name = "radeondrm",
- .cf_atname = "radeondrm",
- .cf_unit = 0,
- .cf_fstate = FSTATE_STAR,
- .cf_loc = drmloc,
- .cf_flags = 0,
- .cf_pspec = &drmparent,
- },
- { NULL }
-};
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
static int
radeondrm_modcmd(modcmd_t cmd, void *arg)
{
- int err;
+ int error = 0;
switch (cmd) {
case MODULE_CMD_INIT:
- err = config_cfdriver_attach(&radeondrm_cd);
- if (err)
- return err;
- err = config_cfattach_attach("radeondrm", &radeondrm_ca);
- if (err) {
- config_cfdriver_detach(&radeondrm_cd);
- return err;
- }
- err = config_cfdata_attach(radeondrm_cfdata, 1);
- if (err) {
- config_cfattach_detach("radeondrm", &radeondrm_ca);
- config_cfdriver_detach(&radeondrm_cd);
- return err;
- }
- return 0;
+#ifdef _MODULE
+ error = config_init_component(cfdriver_ioconf_radeondrm,
+ cfattach_ioconf_radeondrm, cfdata_ioconf_radeondrm);
+#endif
+ break;
case MODULE_CMD_FINI:
- err = config_cfdata_detach(radeondrm_cfdata);
- if (err)
- return err;
- config_cfattach_detach("radeondrm", &radeondrm_ca);
- config_cfdriver_detach(&radeondrm_cd);
- return 0;
+#ifdef _MODULE
+ error = config_fini_component(cfdriver_ioconf_radeondrm,
+ cfattach_ioconf_radeondrm, cfdata_ioconf_radeondrm);
+#endif
+ break;
default:
return ENOTTY;
}
+
+ return error;
}
-#endif /* _MODULE */
-
#include <dev/firmload.h>
diff -r a48bcceac599 -r d7676bacb92f sys/modules/Makefile.inc
--- a/sys/modules/Makefile.inc Sun Aug 28 11:36:17 2011 +0000
+++ b/sys/modules/Makefile.inc Sun Aug 28 15:40:49 2011 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile.inc,v 1.3 2010/03/21 06:56:52 pooka Exp $
+# $NetBSD: Makefile.inc,v 1.4 2011/08/28 15:40:50 jmcneill Exp $
S!= cd ${.PARSEDIR}/..;pwd
CPPFLAGS+= -I${NETBSDSRCDIR}/common/include
USE_FORT= no
-WARNS?= 1
+WARNS?= 3
.if !empty(IOCONF)
_BSD_IOCONF_MK_USER_=1
diff -r a48bcceac599 -r d7676bacb92f sys/modules/azalia/Makefile
--- a/sys/modules/azalia/Makefile Sun Aug 28 11:36:17 2011 +0000
+++ b/sys/modules/azalia/Makefile Sun Aug 28 15:40:49 2011 +0000
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.1 2008/06/02 11:34:07 jmcneill Exp $
+# $NetBSD: Makefile,v 1.2 2011/08/28 15:40:50 jmcneill Exp $
.include "../Makefile.inc"
.PATH: ${S}/dev/pci
KMOD= azalia
+IOCONF= azalia.ioconf
Home |
Main Index |
Thread Index |
Old Index