Commit e1328c62 authored by Ondrej Zary's avatar Ondrej Zary Committed by Greg Kroah-Hartman

staging: ft1000-pcmcia: remove PSEUDOSZ, use sizeof(struct pseudo_hdr) instead

PSEUDOSZ seems to define struct pseudo_hdr size.
Remove it and use sizeof(struct pseudo_hdr) directly.
Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 45c4cf1c
...@@ -202,8 +202,6 @@ struct pseudo_hdr { ...@@ -202,8 +202,6 @@ struct pseudo_hdr {
#define MAX_DSP_SESS_REC 1024 #define MAX_DSP_SESS_REC 1024
#define DSP_QID_OFFSET 4 #define DSP_QID_OFFSET 4
#define PSEUDOSZ 16
#define PSEUDOSZWRD 8
/* Maximum number of occurrence of pseudo header errors before resetting PC Card. */ /* Maximum number of occurrence of pseudo header errors before resetting PC Card. */
#define MAX_PH_ERR 300 #define MAX_PH_ERR 300
......
...@@ -795,7 +795,7 @@ void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qt ...@@ -795,7 +795,7 @@ void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qt
u16 tempword; u16 tempword;
unsigned long flags; unsigned long flags;
size += PSEUDOSZ; size += sizeof(struct pseudo_hdr);
// check for odd byte and increment to 16-bit word align value // check for odd byte and increment to 16-bit word align value
if ((size & 0x0001)) { if ((size & 0x0001)) {
size++; size++;
...@@ -883,12 +883,12 @@ bool ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *p ...@@ -883,12 +883,12 @@ bool ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *p
unsigned long flags; unsigned long flags;
if (info->AsicID == ELECTRABUZZ_ID) { if (info->AsicID == ELECTRABUZZ_ID) {
size = ( ft1000_read_dpram(dev, *pnxtph) ) + PSEUDOSZ; size = ( ft1000_read_dpram(dev, *pnxtph) ) + sizeof(struct pseudo_hdr);
} else { } else {
size = size =
ntohs(ft1000_read_dpram_mag_16 ntohs(ft1000_read_dpram_mag_16
(dev, FT1000_MAG_PH_LEN, (dev, FT1000_MAG_PH_LEN,
FT1000_MAG_PH_LEN_INDX)) + PSEUDOSZ; FT1000_MAG_PH_LEN_INDX)) + sizeof(struct pseudo_hdr);
} }
if (size > maxsz) { if (size > maxsz) {
DEBUG(1, DEBUG(1,
...@@ -1317,7 +1317,7 @@ int ft1000_parse_dpram_msg(struct net_device *dev) ...@@ -1317,7 +1317,7 @@ int ft1000_parse_dpram_msg(struct net_device *dev)
} }
DEBUG(1, "FT1000:ft1000_parse_dpram_msg:total length = %d\n", DEBUG(1, "FT1000:ft1000_parse_dpram_msg:total length = %d\n",
total_len); total_len);
if ((total_len < MAX_CMD_SQSIZE) && (total_len > PSEUDOSZ)) { if ((total_len < MAX_CMD_SQSIZE) && (total_len > sizeof(struct pseudo_hdr))) {
total_len += nxtph; total_len += nxtph;
cnt = 0; cnt = 0;
// ft1000_read_reg will return a value that needs to be byteswap // ft1000_read_reg will return a value that needs to be byteswap
......
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