Commit 0053fe0e authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman

staging: dgnc: remove struct member magic numbers

Driver uses magic number members within structs, this is an antiquated
method of catching data errors. We don't do things that way any more.

Remove magic number struct members. Remove all checks to magic
numbers.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 51061652
...@@ -282,7 +282,7 @@ static inline void cls_clear_break(struct channel_t *ch, int force) ...@@ -282,7 +282,7 @@ static inline void cls_clear_break(struct channel_t *ch, int force)
{ {
unsigned long flags; unsigned long flags;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
spin_lock_irqsave(&ch->ch_lock, flags); spin_lock_irqsave(&ch->ch_lock, flags);
...@@ -314,7 +314,7 @@ static void cls_copy_data_from_uart_to_queue(struct channel_t *ch) ...@@ -314,7 +314,7 @@ static void cls_copy_data_from_uart_to_queue(struct channel_t *ch)
ushort tail; ushort tail;
unsigned long flags; unsigned long flags;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
spin_lock_irqsave(&ch->ch_lock, flags); spin_lock_irqsave(&ch->ch_lock, flags);
...@@ -386,7 +386,7 @@ static void cls_assert_modem_signals(struct channel_t *ch) ...@@ -386,7 +386,7 @@ static void cls_assert_modem_signals(struct channel_t *ch)
{ {
unsigned char out; unsigned char out;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
out = ch->ch_mostat; out = ch->ch_mostat;
...@@ -409,7 +409,7 @@ static void cls_copy_data_from_queue_to_uart(struct channel_t *ch) ...@@ -409,7 +409,7 @@ static void cls_copy_data_from_queue_to_uart(struct channel_t *ch)
uint len_written = 0; uint len_written = 0;
unsigned long flags; unsigned long flags;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
spin_lock_irqsave(&ch->ch_lock, flags); spin_lock_irqsave(&ch->ch_lock, flags);
...@@ -479,7 +479,7 @@ static void cls_parse_modem(struct channel_t *ch, unsigned char signals) ...@@ -479,7 +479,7 @@ static void cls_parse_modem(struct channel_t *ch, unsigned char signals)
unsigned char msignals = signals; unsigned char msignals = signals;
unsigned long flags; unsigned long flags;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
/* /*
...@@ -551,8 +551,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) ...@@ -551,8 +551,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port)
return; return;
ch = brd->channels[port]; ch = brd->channels[port];
if (ch->magic != DGNC_CHANNEL_MAGIC)
return;
/* Here we try to figure out what caused the interrupt to happen */ /* Here we try to figure out what caused the interrupt to happen */
while (1) { while (1) {
...@@ -582,7 +580,7 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) ...@@ -582,7 +580,7 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port)
/* Channel lock MUST be held before calling this function! */ /* Channel lock MUST be held before calling this function! */
static void cls_flush_uart_write(struct channel_t *ch) static void cls_flush_uart_write(struct channel_t *ch)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT), writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT),
...@@ -597,7 +595,7 @@ static void cls_flush_uart_write(struct channel_t *ch) ...@@ -597,7 +595,7 @@ static void cls_flush_uart_write(struct channel_t *ch)
/* Channel lock MUST be held before calling this function! */ /* Channel lock MUST be held before calling this function! */
static void cls_flush_uart_read(struct channel_t *ch) static void cls_flush_uart_read(struct channel_t *ch)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
/* /*
...@@ -627,19 +625,19 @@ static void cls_param(struct tty_struct *tty) ...@@ -627,19 +625,19 @@ static void cls_param(struct tty_struct *tty)
struct channel_t *ch; struct channel_t *ch;
struct un_t *un; struct un_t *un;
if (!tty || tty->magic != TTY_MAGIC) if (!tty)
return; return;
un = (struct un_t *)tty->driver_data; un = (struct un_t *)tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un)
return; return;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd)
return; return;
/* If baud rate is zero, flush queues, and set mval to drop DTR. */ /* If baud rate is zero, flush queues, and set mval to drop DTR. */
...@@ -858,7 +856,7 @@ static void cls_tasklet(unsigned long data) ...@@ -858,7 +856,7 @@ static void cls_tasklet(unsigned long data)
int state = 0; int state = 0;
int ports = 0; int ports = 0;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd)
return; return;
spin_lock_irqsave(&bd->bd_lock, flags); spin_lock_irqsave(&bd->bd_lock, flags);
...@@ -914,7 +912,7 @@ static irqreturn_t cls_intr(int irq, void *voidbrd) ...@@ -914,7 +912,7 @@ static irqreturn_t cls_intr(int irq, void *voidbrd)
unsigned char poll_reg; unsigned char poll_reg;
unsigned long flags; unsigned long flags;
if (!brd || brd->magic != DGNC_BOARD_MAGIC) if (!brd)
return IRQ_NONE; return IRQ_NONE;
spin_lock_irqsave(&brd->bd_intr_lock, flags); spin_lock_irqsave(&brd->bd_intr_lock, flags);
...@@ -961,15 +959,15 @@ static int cls_drain(struct tty_struct *tty, uint seconds) ...@@ -961,15 +959,15 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
struct channel_t *ch; struct channel_t *ch;
struct un_t *un; struct un_t *un;
if (!tty || tty->magic != TTY_MAGIC) if (!tty)
return -ENXIO; return -ENXIO;
un = (struct un_t *)tty->driver_data; un = (struct un_t *)tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un)
return -ENXIO; return -ENXIO;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return -ENXIO; return -ENXIO;
spin_lock_irqsave(&ch->ch_lock, flags); spin_lock_irqsave(&ch->ch_lock, flags);
...@@ -986,7 +984,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds) ...@@ -986,7 +984,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
static void cls_send_start_character(struct channel_t *ch) static void cls_send_start_character(struct channel_t *ch)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
if (ch->ch_startc != _POSIX_VDISABLE) { if (ch->ch_startc != _POSIX_VDISABLE) {
...@@ -997,7 +995,7 @@ static void cls_send_start_character(struct channel_t *ch) ...@@ -997,7 +995,7 @@ static void cls_send_start_character(struct channel_t *ch)
static void cls_send_stop_character(struct channel_t *ch) static void cls_send_stop_character(struct channel_t *ch)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
if (ch->ch_stopc != _POSIX_VDISABLE) { if (ch->ch_stopc != _POSIX_VDISABLE) {
...@@ -1056,7 +1054,7 @@ static uint cls_get_uart_bytes_left(struct channel_t *ch) ...@@ -1056,7 +1054,7 @@ static uint cls_get_uart_bytes_left(struct channel_t *ch)
unsigned char left = 0; unsigned char left = 0;
unsigned char lsr = 0; unsigned char lsr = 0;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return 0; return 0;
lsr = readb(&ch->ch_cls_uart->lsr); lsr = readb(&ch->ch_cls_uart->lsr);
...@@ -1080,7 +1078,7 @@ static uint cls_get_uart_bytes_left(struct channel_t *ch) ...@@ -1080,7 +1078,7 @@ static uint cls_get_uart_bytes_left(struct channel_t *ch)
*/ */
static void cls_send_break(struct channel_t *ch, int msecs) static void cls_send_break(struct channel_t *ch, int msecs)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
/* If we receive a time of 0, this means turn off the break. */ /* If we receive a time of 0, this means turn off the break. */
...@@ -1119,7 +1117,7 @@ static void cls_send_break(struct channel_t *ch, int msecs) ...@@ -1119,7 +1117,7 @@ static void cls_send_break(struct channel_t *ch, int msecs)
*/ */
static void cls_send_immediate_char(struct channel_t *ch, unsigned char c) static void cls_send_immediate_char(struct channel_t *ch, unsigned char c)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
writeb(c, &ch->ch_cls_uart->txrx); writeb(c, &ch->ch_cls_uart->txrx);
......
...@@ -110,7 +110,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -110,7 +110,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
/* store the info for the board we've found */ /* store the info for the board we've found */
brd->magic = DGNC_BOARD_MAGIC;
brd->boardnum = dgnc_num_boards; brd->boardnum = dgnc_num_boards;
brd->vendor = dgnc_pci_tbl[id].vendor; brd->vendor = dgnc_pci_tbl[id].vendor;
brd->device = dgnc_pci_tbl[id].device; brd->device = dgnc_pci_tbl[id].device;
...@@ -444,7 +443,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd) ...@@ -444,7 +443,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
{ {
int i = 0; int i = 0;
if (!brd || brd->magic != DGNC_BOARD_MAGIC) if (!brd)
return; return;
switch (brd->device) { switch (brd->device) {
......
...@@ -35,11 +35,6 @@ ...@@ -35,11 +35,6 @@
#define MAXPORTS 8 #define MAXPORTS 8
#define MAXTTYNAMELEN 200 #define MAXTTYNAMELEN 200
/* Our 3 magic numbers for our board, channel and unit structs */
#define DGNC_BOARD_MAGIC 0x5c6df104
#define DGNC_CHANNEL_MAGIC 0x6c6df104
#define DGNC_UNIT_MAGIC 0x7c6df104
/* Serial port types */ /* Serial port types */
#define DGNC_SERIAL 0 #define DGNC_SERIAL 0
#define DGNC_PRINT 1 #define DGNC_PRINT 1
...@@ -120,7 +115,6 @@ struct board_ops { ...@@ -120,7 +115,6 @@ struct board_ops {
/** /**
* struct dgnc_board - Per board information. * struct dgnc_board - Per board information.
* @magic: Board magic number.
* @boardnum: Board number (0 - 32). * @boardnum: Board number (0 - 32).
* *
* @type: Type of board. * @type: Type of board.
...@@ -163,7 +157,6 @@ struct board_ops { ...@@ -163,7 +157,6 @@ struct board_ops {
* @dgnc_board_table: Proc/<board> entry * @dgnc_board_table: Proc/<board> entry
*/ */
struct dgnc_board { struct dgnc_board {
int magic;
int boardnum; int boardnum;
int type; int type;
...@@ -245,7 +238,6 @@ struct device; ...@@ -245,7 +238,6 @@ struct device;
/** /**
* struct un_t - terminal or printer unit * struct un_t - terminal or printer unit
* @magic: Unit magic number.
* @un_open_count: Counter of opens to port. * @un_open_count: Counter of opens to port.
* @un_tty: Pointer to unit tty structure. * @un_tty: Pointer to unit tty structure.
* @un_flags: Unit flags. * @un_flags: Unit flags.
...@@ -253,7 +245,6 @@ struct device; ...@@ -253,7 +245,6 @@ struct device;
* @un_dev: Minor device number. * @un_dev: Minor device number.
*/ */
struct un_t { struct un_t {
int magic;
struct channel_t *un_ch; struct channel_t *un_ch;
ulong un_time; ulong un_time;
uint un_type; uint un_type;
...@@ -295,7 +286,6 @@ struct un_t { ...@@ -295,7 +286,6 @@ struct un_t {
/** /**
* struct channel_t - Channel information. * struct channel_t - Channel information.
* @magic: Channel magic number.
* @dgnc_board: Pointer to board structure. * @dgnc_board: Pointer to board structure.
* @ch_bd: Transparent print structure. * @ch_bd: Transparent print structure.
* @ch_tun: Terminal unit information. * @ch_tun: Terminal unit information.
...@@ -348,7 +338,6 @@ struct un_t { ...@@ -348,7 +338,6 @@ struct un_t {
* @dgnc_channel_table: Proc/<board>/<channel> entry. * @dgnc_channel_table: Proc/<board>/<channel> entry.
*/ */
struct channel_t { struct channel_t {
int magic;
struct dgnc_board *ch_bd; struct dgnc_board *ch_bd;
struct digi_t ch_digi; struct digi_t ch_digi;
struct un_t ch_tun; struct un_t ch_tun;
......
...@@ -175,7 +175,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -175,7 +175,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
ch = dgnc_board[board]->channels[channel]; ch = dgnc_board[board]->channels[channel];
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return -ENODEV; return -ENODEV;
memset(&ni, 0, sizeof(ni)); memset(&ni, 0, sizeof(ni));
......
...@@ -392,7 +392,7 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port) ...@@ -392,7 +392,7 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port)
unsigned long flags; unsigned long flags;
ch = brd->channels[port]; ch = brd->channels[port];
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
/* Here we try to figure out what caused the interrupt to happen */ /* Here we try to figure out what caused the interrupt to happen */
...@@ -505,14 +505,14 @@ static inline void neo_parse_lsr(struct dgnc_board *brd, uint port) ...@@ -505,14 +505,14 @@ static inline void neo_parse_lsr(struct dgnc_board *brd, uint port)
int linestatus; int linestatus;
unsigned long flags; unsigned long flags;
if (!brd || brd->magic != DGNC_BOARD_MAGIC) if (!brd)
return; return;
if (port >= brd->maxports) if (port >= brd->maxports)
return; return;
ch = brd->channels[port]; ch = brd->channels[port];
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
linestatus = readb(&ch->ch_neo_uart->lsr); linestatus = readb(&ch->ch_neo_uart->lsr);
...@@ -579,19 +579,19 @@ static void neo_param(struct tty_struct *tty) ...@@ -579,19 +579,19 @@ static void neo_param(struct tty_struct *tty)
struct channel_t *ch; struct channel_t *ch;
struct un_t *un; struct un_t *un;
if (!tty || tty->magic != TTY_MAGIC) if (!tty)
return; return;
un = (struct un_t *)tty->driver_data; un = (struct un_t *)tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un)
return; return;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd)
return; return;
/* If baud rate is zero, flush queues, and set mval to drop DTR. */ /* If baud rate is zero, flush queues, and set mval to drop DTR. */
...@@ -822,7 +822,7 @@ static void neo_tasklet(unsigned long data) ...@@ -822,7 +822,7 @@ static void neo_tasklet(unsigned long data)
int state = 0; int state = 0;
int ports = 0; int ports = 0;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd)
return; return;
spin_lock_irqsave(&bd->bd_lock, flags); spin_lock_irqsave(&bd->bd_lock, flags);
...@@ -839,9 +839,7 @@ static void neo_tasklet(unsigned long data) ...@@ -839,9 +839,7 @@ static void neo_tasklet(unsigned long data)
if ((state == BOARD_READY) && (ports > 0)) { if ((state == BOARD_READY) && (ports > 0)) {
for (i = 0; i < ports; i++) { for (i = 0; i < ports; i++) {
ch = bd->channels[i]; ch = bd->channels[i];
if (!ch)
/* Just being careful... */
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
continue; continue;
/* /*
...@@ -888,7 +886,7 @@ static irqreturn_t neo_intr(int irq, void *voidbrd) ...@@ -888,7 +886,7 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
unsigned long flags; unsigned long flags;
unsigned long flags2; unsigned long flags2;
if (!brd || brd->magic != DGNC_BOARD_MAGIC) if (!brd)
return IRQ_NONE; return IRQ_NONE;
/* Lock out the slow poller from running on this board. */ /* Lock out the slow poller from running on this board. */
...@@ -1023,7 +1021,7 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch) ...@@ -1023,7 +1021,7 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
ushort tail; ushort tail;
unsigned long flags; unsigned long flags;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
spin_lock_irqsave(&ch->ch_lock, flags); spin_lock_irqsave(&ch->ch_lock, flags);
...@@ -1195,15 +1193,15 @@ static int neo_drain(struct tty_struct *tty, uint seconds) ...@@ -1195,15 +1193,15 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
struct un_t *un; struct un_t *un;
int rc = 0; int rc = 0;
if (!tty || tty->magic != TTY_MAGIC) if (!tty)
return -ENXIO; return -ENXIO;
un = (struct un_t *)tty->driver_data; un = (struct un_t *)tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un)
return -ENXIO; return -ENXIO;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return -ENXIO; return -ENXIO;
spin_lock_irqsave(&ch->ch_lock, flags); spin_lock_irqsave(&ch->ch_lock, flags);
...@@ -1227,7 +1225,7 @@ static void neo_flush_uart_write(struct channel_t *ch) ...@@ -1227,7 +1225,7 @@ static void neo_flush_uart_write(struct channel_t *ch)
unsigned char tmp = 0; unsigned char tmp = 0;
int i = 0; int i = 0;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT), writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT),
...@@ -1258,7 +1256,7 @@ static void neo_flush_uart_read(struct channel_t *ch) ...@@ -1258,7 +1256,7 @@ static void neo_flush_uart_read(struct channel_t *ch)
unsigned char tmp = 0; unsigned char tmp = 0;
int i = 0; int i = 0;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR, writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR,
...@@ -1288,7 +1286,7 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) ...@@ -1288,7 +1286,7 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch)
uint len_written = 0; uint len_written = 0;
unsigned long flags; unsigned long flags;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
spin_lock_irqsave(&ch->ch_lock, flags); spin_lock_irqsave(&ch->ch_lock, flags);
...@@ -1425,7 +1423,7 @@ static void neo_parse_modem(struct channel_t *ch, unsigned char signals) ...@@ -1425,7 +1423,7 @@ static void neo_parse_modem(struct channel_t *ch, unsigned char signals)
{ {
unsigned char msignals = signals; unsigned char msignals = signals;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
/* /*
...@@ -1482,7 +1480,7 @@ static void neo_assert_modem_signals(struct channel_t *ch) ...@@ -1482,7 +1480,7 @@ static void neo_assert_modem_signals(struct channel_t *ch)
{ {
unsigned char out; unsigned char out;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
out = ch->ch_mostat; out = ch->ch_mostat;
...@@ -1499,7 +1497,7 @@ static void neo_assert_modem_signals(struct channel_t *ch) ...@@ -1499,7 +1497,7 @@ static void neo_assert_modem_signals(struct channel_t *ch)
static void neo_send_start_character(struct channel_t *ch) static void neo_send_start_character(struct channel_t *ch)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
if (ch->ch_startc != _POSIX_VDISABLE) { if (ch->ch_startc != _POSIX_VDISABLE) {
...@@ -1512,7 +1510,7 @@ static void neo_send_start_character(struct channel_t *ch) ...@@ -1512,7 +1510,7 @@ static void neo_send_start_character(struct channel_t *ch)
static void neo_send_stop_character(struct channel_t *ch) static void neo_send_stop_character(struct channel_t *ch)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
if (ch->ch_stopc != _POSIX_VDISABLE) { if (ch->ch_stopc != _POSIX_VDISABLE) {
...@@ -1619,7 +1617,7 @@ static void neo_send_break(struct channel_t *ch, int msecs) ...@@ -1619,7 +1617,7 @@ static void neo_send_break(struct channel_t *ch, int msecs)
*/ */
static void neo_send_immediate_char(struct channel_t *ch, unsigned char c) static void neo_send_immediate_char(struct channel_t *ch, unsigned char c)
{ {
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch)
return; return;
writeb(c, &ch->ch_neo_uart->txrx); writeb(c, &ch->ch_neo_uart->txrx);
...@@ -1672,7 +1670,7 @@ static void neo_vpd(struct dgnc_board *brd) ...@@ -1672,7 +1670,7 @@ static void neo_vpd(struct dgnc_board *brd)
unsigned int i = 0; unsigned int i = 0;
unsigned int a; unsigned int a;
if (!brd || brd->magic != DGNC_BOARD_MAGIC) if (!brd)
return; return;
if (!brd->re_map_membase) if (!brd->re_map_membase)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment