Clean-up (remove redundant declarations, concentrate checks).

This commit is contained in:
flxd 2016-12-12 17:03:40 +00:00
parent a07ee70f52
commit 41d99bfb78
3 changed files with 17 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcasic.c,v 1.44 2012/02/06 02:14:16 matt Exp $ */
/* $NetBSD: tcasic.c,v 1.45 2016/12/12 17:03:40 flxd Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.44 2012/02/06 02:14:16 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.45 2016/12/12 17:03:40 flxd Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -179,7 +179,6 @@ extern void mfb_cnattach(tc_addr_t);
extern void tfb_cnattach(tc_addr_t);
extern void px_cnattach(tc_addr_t);
extern void pxg_cnattach(tc_addr_t);
extern int tc_checkslot(tc_addr_t, char *);
struct cnboards {
const char *cb_tcname;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcbus.c,v 1.31 2016/11/16 19:37:06 macallan Exp $ */
/* $NetBSD: tcbus.c,v 1.32 2016/12/12 17:03:41 flxd Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.31 2016/11/16 19:37:06 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.32 2016/12/12 17:03:41 flxd Exp $");
#define _PMAX_BUS_DMA_PRIVATE
/*
@ -179,8 +179,6 @@ tc_ds_get_dma_tag(int slot)
#include <pmax/pmax/cons.h>
#include <pmax/dec_prom.h>
int tc_checkslot(tc_addr_t, char *);
struct cnboards {
const char *cb_tcname;
void (*cb_cnattach)(tc_addr_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: tc.c,v 1.53 2016/07/19 18:27:27 christos Exp $ */
/* $NetBSD: tc.c,v 1.54 2016/12/12 17:03:41 flxd Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.53 2016/07/19 18:27:27 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.54 2016/12/12 17:03:41 flxd Exp $");
#include "opt_tcverbose.h"
@ -209,6 +209,17 @@ static const tc_offset_t tc_slot_romoffs[] = {
static int
tc_check_romp(const struct tc_rommap *romp)
{
switch (romp->tcr_width.v) {
case 1:
case 2:
case 4:
break;
default:
return 0;
}
if (romp->tcr_stride.v != 4)
return 0;
@ -232,16 +243,6 @@ tc_checkslot(tc_addr_t slotbase, char *namep)
romp = (struct tc_rommap *)
(slotbase + tc_slot_romoffs[i]);
switch (romp->tcr_width.v) {
case 1:
case 2:
case 4:
break;
default:
continue;
}
if (!tc_check_romp(romp))
continue;