@@ -64,18 +64,18 @@ struct mctp_serial {
64
64
u16 txfcs , rxfcs , rxfcs_rcvd ;
65
65
unsigned int txlen , rxlen ;
66
66
unsigned int txpos , rxpos ;
67
- unsigned char txbuf [BUFSIZE ],
67
+ u8 txbuf [BUFSIZE ],
68
68
rxbuf [BUFSIZE ];
69
69
};
70
70
71
- static bool needs_escape (unsigned char c )
71
+ static bool needs_escape (u8 c )
72
72
{
73
73
return c == BYTE_ESC || c == BYTE_FRAME ;
74
74
}
75
75
76
- static int next_chunk_len (struct mctp_serial * dev )
76
+ static unsigned int next_chunk_len (struct mctp_serial * dev )
77
77
{
78
- int i ;
78
+ unsigned int i ;
79
79
80
80
/* either we have no bytes to send ... */
81
81
if (dev -> txpos == dev -> txlen )
@@ -99,7 +99,7 @@ static int next_chunk_len(struct mctp_serial *dev)
99
99
return i ;
100
100
}
101
101
102
- static int write_chunk (struct mctp_serial * dev , unsigned char * buf , int len )
102
+ static ssize_t write_chunk (struct mctp_serial * dev , u8 * buf , size_t len )
103
103
{
104
104
return dev -> tty -> ops -> write (dev -> tty , buf , len );
105
105
}
@@ -108,9 +108,10 @@ static void mctp_serial_tx_work(struct work_struct *work)
108
108
{
109
109
struct mctp_serial * dev = container_of (work , struct mctp_serial ,
110
110
tx_work );
111
- unsigned char c , buf [3 ];
112
111
unsigned long flags ;
113
- int len , txlen ;
112
+ ssize_t txlen ;
113
+ unsigned int len ;
114
+ u8 c , buf [3 ];
114
115
115
116
spin_lock_irqsave (& dev -> lock , flags );
116
117
@@ -293,7 +294,7 @@ static void mctp_serial_rx(struct mctp_serial *dev)
293
294
dev -> netdev -> stats .rx_bytes += dev -> rxlen ;
294
295
}
295
296
296
- static void mctp_serial_push_header (struct mctp_serial * dev , unsigned char c )
297
+ static void mctp_serial_push_header (struct mctp_serial * dev , u8 c )
297
298
{
298
299
switch (dev -> rxpos ) {
299
300
case 0 :
@@ -323,7 +324,7 @@ static void mctp_serial_push_header(struct mctp_serial *dev, unsigned char c)
323
324
}
324
325
}
325
326
326
- static void mctp_serial_push_trailer (struct mctp_serial * dev , unsigned char c )
327
+ static void mctp_serial_push_trailer (struct mctp_serial * dev , u8 c )
327
328
{
328
329
switch (dev -> rxpos ) {
329
330
case 0 :
@@ -347,7 +348,7 @@ static void mctp_serial_push_trailer(struct mctp_serial *dev, unsigned char c)
347
348
}
348
349
}
349
350
350
- static void mctp_serial_push (struct mctp_serial * dev , unsigned char c )
351
+ static void mctp_serial_push (struct mctp_serial * dev , u8 c )
351
352
{
352
353
switch (dev -> rxstate ) {
353
354
case STATE_IDLE :
@@ -394,7 +395,7 @@ static void mctp_serial_tty_receive_buf(struct tty_struct *tty, const u8 *c,
394
395
const u8 * f , size_t len )
395
396
{
396
397
struct mctp_serial * dev = tty -> disc_data ;
397
- int i ;
398
+ size_t i ;
398
399
399
400
if (!netif_running (dev -> netdev ))
400
401
return ;
0 commit comments