Skip to content

Commit 1241b38

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
6pack: propagage new tty types
In tty, u8 is now used for data, ssize_t for sizes (with possible negative error codes). Propagate these types to 6pack. Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Andreas Koensgen <[email protected]> Cc: David S. Miller <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Paolo Abeni <[email protected]> Cc: [email protected] Cc: [email protected] Reviewed-by: Jeremy Kerr <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4283232 commit 1241b38

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

drivers/net/hamradio/6pack.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ struct sixpack {
9191
unsigned char *xhead; /* next byte to XMIT */
9292
int xleft; /* bytes left in XMIT queue */
9393

94-
unsigned char raw_buf[4];
95-
unsigned char cooked_buf[400];
94+
u8 raw_buf[4];
95+
u8 cooked_buf[400];
9696

9797
unsigned int rx_count;
9898
unsigned int rx_count_cooked;
@@ -107,8 +107,8 @@ struct sixpack {
107107
unsigned char slottime;
108108
unsigned char duplex;
109109
unsigned char led_state;
110-
unsigned char status;
111-
unsigned char status1;
110+
u8 status;
111+
u8 status1;
112112
unsigned char status2;
113113
unsigned char tx_enable;
114114
unsigned char tnc_state;
@@ -122,7 +122,7 @@ struct sixpack {
122122

123123
#define AX25_6PACK_HEADER_LEN 0
124124

125-
static void sixpack_decode(struct sixpack *, const unsigned char[], int);
125+
static void sixpack_decode(struct sixpack *, const u8 *, size_t);
126126
static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char);
127127

128128
/*
@@ -327,7 +327,7 @@ static void sp_bump(struct sixpack *sp, char cmd)
327327
{
328328
struct sk_buff *skb;
329329
int count;
330-
unsigned char *ptr;
330+
u8 *ptr;
331331

332332
count = sp->rcount + 1;
333333

@@ -425,7 +425,7 @@ static void sixpack_receive_buf(struct tty_struct *tty, const u8 *cp,
425425
const u8 *fp, size_t count)
426426
{
427427
struct sixpack *sp;
428-
int count1;
428+
size_t count1;
429429

430430
if (!count)
431431
return;
@@ -800,9 +800,9 @@ static int encode_sixpack(unsigned char *tx_buf, unsigned char *tx_buf_raw,
800800

801801
/* decode 4 sixpack-encoded bytes into 3 data bytes */
802802

803-
static void decode_data(struct sixpack *sp, unsigned char inbyte)
803+
static void decode_data(struct sixpack *sp, u8 inbyte)
804804
{
805-
unsigned char *buf;
805+
u8 *buf;
806806

807807
if (sp->rx_count != 3) {
808808
sp->raw_buf[sp->rx_count++] = inbyte;
@@ -828,9 +828,9 @@ static void decode_data(struct sixpack *sp, unsigned char inbyte)
828828

829829
/* identify and execute a 6pack priority command byte */
830830

831-
static void decode_prio_command(struct sixpack *sp, unsigned char cmd)
831+
static void decode_prio_command(struct sixpack *sp, u8 cmd)
832832
{
833-
int actual;
833+
ssize_t actual;
834834

835835
if ((cmd & SIXP_PRIO_DATA_MASK) != 0) { /* idle ? */
836836

@@ -878,9 +878,9 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd)
878878

879879
/* identify and execute a standard 6pack command byte */
880880

881-
static void decode_std_command(struct sixpack *sp, unsigned char cmd)
881+
static void decode_std_command(struct sixpack *sp, u8 cmd)
882882
{
883-
unsigned char checksum = 0, rest = 0;
883+
u8 checksum = 0, rest = 0;
884884
short i;
885885

886886
switch (cmd & SIXP_CMD_MASK) { /* normal command */
@@ -928,10 +928,10 @@ static void decode_std_command(struct sixpack *sp, unsigned char cmd)
928928
/* decode a 6pack packet */
929929

930930
static void
931-
sixpack_decode(struct sixpack *sp, const unsigned char *pre_rbuff, int count)
931+
sixpack_decode(struct sixpack *sp, const u8 *pre_rbuff, size_t count)
932932
{
933-
unsigned char inbyte;
934-
int count1;
933+
size_t count1;
934+
u8 inbyte;
935935

936936
for (count1 = 0; count1 < count; count1++) {
937937
inbyte = pre_rbuff[count1];

0 commit comments

Comments
 (0)