diff options
Diffstat (limited to 'drivers/char/ipmi/ipmi_bt_sm.c')
| -rw-r--r-- | drivers/char/ipmi/ipmi_bt_sm.c | 16 | 
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c index 3ed20e8abc0..61e71616689 100644 --- a/drivers/char/ipmi/ipmi_bt_sm.c +++ b/drivers/char/ipmi/ipmi_bt_sm.c @@ -95,9 +95,9 @@ struct si_sm_data {  	enum bt_states	state;  	unsigned char	seq;		/* BT sequence number */  	struct si_sm_io	*io; -	unsigned char	write_data[IPMI_MAX_MSG_LENGTH]; +	unsigned char	write_data[IPMI_MAX_MSG_LENGTH + 2]; /* +2 for memcpy */  	int		write_count; -	unsigned char	read_data[IPMI_MAX_MSG_LENGTH]; +	unsigned char	read_data[IPMI_MAX_MSG_LENGTH + 2]; /* +2 for memcpy */  	int		read_count;  	int		truncated;  	long		timeout;	/* microseconds countdown */ @@ -201,7 +201,7 @@ static unsigned int bt_init_data(struct si_sm_data *bt, struct si_sm_io *io)  	}  	bt->state = BT_STATE_IDLE;	/* start here */  	bt->complete = BT_STATE_IDLE;	/* end here */ -	bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * 1000000; +	bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * USEC_PER_SEC;  	bt->BT_CAP_retries = BT_NORMAL_RETRY_LIMIT;  	/* BT_CAP_outreqs == zero is a flag to read BT Capabilities */  	return 3; /* We claim 3 bytes of space; ought to check SPMI table */ @@ -352,7 +352,7 @@ static inline void write_all_bytes(struct si_sm_data *bt)  static inline int read_all_bytes(struct si_sm_data *bt)  { -	unsigned char i; +	unsigned int i;  	/*  	 * length is "framing info", minimum = 4: NetFn, Seq, Cmd, cCode. @@ -560,7 +560,7 @@ static enum si_sm_result bt_event(struct si_sm_data *bt, long time)  		BT_CONTROL(BT_H_BUSY);		/* set */  		/* -		 * Uncached, ordered writes should just proceeed serially but +		 * Uncached, ordered writes should just proceed serially but  		 * some BMCs don't clear B2H_ATN with one hit.  Fast-path a  		 * workaround without too much penalty to the general case.  		 */ @@ -613,7 +613,7 @@ static enum si_sm_result bt_event(struct si_sm_data *bt, long time)  		HOST2BMC(42);		/* Sequence number */  		HOST2BMC(3);		/* Cmd == Soft reset */  		BT_CONTROL(BT_H2B_ATN); -		bt->timeout = BT_RESET_DELAY * 1000000; +		bt->timeout = BT_RESET_DELAY * USEC_PER_SEC;  		BT_STATE_CHANGE(BT_STATE_RESET3,  				SI_SM_CALL_WITH_DELAY); @@ -651,14 +651,14 @@ static enum si_sm_result bt_event(struct si_sm_data *bt, long time)  		bt_init_data(bt, bt->io);  		if ((i == 8) && !BT_CAP[2]) {  			bt->BT_CAP_outreqs = BT_CAP[3]; -			bt->BT_CAP_req2rsp = BT_CAP[6] * 1000000; +			bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC;  			bt->BT_CAP_retries = BT_CAP[7];  		} else  			printk(KERN_WARNING "IPMI BT: using default values\n");  		if (!bt->BT_CAP_outreqs)  			bt->BT_CAP_outreqs = 1;  		printk(KERN_WARNING "IPMI BT: req2rsp=%ld secs retries=%d\n", -			bt->BT_CAP_req2rsp / 1000000L, bt->BT_CAP_retries); +			bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries);  		bt->timeout = bt->BT_CAP_req2rsp;  		return SI_SM_CALL_WITHOUT_DELAY;  | 
