Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: fwserial: (coding style) Turning every "unsigned" into "unsigned int"

Coding-style-only modifications to remove every warning saying:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Compiled against revision "next-20160327".

(checkpatch.pl was updated to treat "UNSPECIFIED_INT" warnings
as of commit a1ce18e4f941d20 )

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dominique van den Broeck and committed by
Greg Kroah-Hartman
eeb6f1ba b2073dcb

+53 -51
+4 -4
drivers/staging/fwserial/dma_fifo.c
··· 35 35 /* 36 36 * private helper fn to determine if check is in open interval (lo,hi) 37 37 */ 38 - static bool addr_check(unsigned check, unsigned lo, unsigned hi) 38 + static bool addr_check(unsigned int check, unsigned int lo, unsigned int hi) 39 39 { 40 40 return check - (lo + 1) < (hi - 1) - lo; 41 41 } ··· 64 64 * The 'apparent' size will be rounded up to next greater aligned size. 65 65 * Returns 0 if no error, otherwise an error code 66 66 */ 67 - int dma_fifo_alloc(struct dma_fifo *fifo, int size, unsigned align, 67 + int dma_fifo_alloc(struct dma_fifo *fifo, int size, unsigned int align, 68 68 int tx_limit, int open_limit, gfp_t gfp_mask) 69 69 { 70 70 int capacity; ··· 190 190 */ 191 191 int dma_fifo_out_pend(struct dma_fifo *fifo, struct dma_pending *pended) 192 192 { 193 - unsigned len, n, ofs, l, limit; 193 + unsigned int len, n, ofs, l, limit; 194 194 195 195 if (!fifo->data) 196 196 return -ENOENT; ··· 210 210 n = len; 211 211 ofs = fifo->out % fifo->capacity; 212 212 l = fifo->capacity - ofs; 213 - limit = min_t(unsigned, l, fifo->tx_limit); 213 + limit = min_t(unsigned int, l, fifo->tx_limit); 214 214 if (n > limit) { 215 215 n = limit; 216 216 fifo->out += limit;
+8 -8
drivers/staging/fwserial/dma_fifo.h
··· 45 45 #define DMA_FIFO_GUARD 3 /* # of cache lines to reserve for the guard area */ 46 46 47 47 struct dma_fifo { 48 - unsigned in; 49 - unsigned out; /* updated when dma is pended */ 50 - unsigned done; /* updated upon dma completion */ 48 + unsigned int in; 49 + unsigned int out; /* updated when dma is pended */ 50 + unsigned int done; /* updated upon dma completion */ 51 51 struct { 52 52 unsigned corrupt:1; 53 53 }; ··· 55 55 int guard; /* ofs of guard area */ 56 56 int capacity; /* size + reserved */ 57 57 int avail; /* # of unused bytes in fifo */ 58 - unsigned align; /* must be power of 2 */ 58 + unsigned int align; /* must be power of 2 */ 59 59 int tx_limit; /* max # of bytes per dma transaction */ 60 60 int open_limit; /* max # of outstanding allowed */ 61 61 int open; /* # of outstanding dma transactions */ ··· 66 66 struct dma_pending { 67 67 struct list_head link; 68 68 void *data; 69 - unsigned len; 70 - unsigned next; 71 - unsigned out; 69 + unsigned int len; 70 + unsigned int next; 71 + unsigned int out; 72 72 }; 73 73 74 74 static inline void dp_mark_completed(struct dma_pending *dp) ··· 82 82 } 83 83 84 84 void dma_fifo_init(struct dma_fifo *fifo); 85 - int dma_fifo_alloc(struct dma_fifo *fifo, int size, unsigned align, 85 + int dma_fifo_alloc(struct dma_fifo *fifo, int size, unsigned int align, 86 86 int tx_limit, int open_limit, gfp_t gfp_mask); 87 87 void dma_fifo_free(struct dma_fifo *fifo); 88 88 void dma_fifo_reset(struct dma_fifo *fifo);
+20 -18
drivers/staging/fwserial/fwserial.c
··· 132 132 133 133 #ifdef FWTTY_PROFILING 134 134 135 - static void fwtty_profile_fifo(struct fwtty_port *port, unsigned *stat) 135 + static void fwtty_profile_fifo(struct fwtty_port *port, unsigned int *stat) 136 136 { 137 137 spin_lock_bh(&port->lock); 138 138 fwtty_profile_data(stat, dma_fifo_avail(&port->tx_fifo)); ··· 143 143 { 144 144 /* for each stat, print sum of 0 to 2^k, then individually */ 145 145 int k = 4; 146 - unsigned sum; 146 + unsigned int sum; 147 147 int j; 148 148 char t[10]; 149 149 ··· 303 303 * Note: in loopback, the port->lock is being held. Only use functions that 304 304 * don't attempt to reclaim the port->lock. 305 305 */ 306 - static void fwtty_update_port_status(struct fwtty_port *port, unsigned status) 306 + static void fwtty_update_port_status(struct fwtty_port *port, 307 + unsigned int status) 307 308 { 308 - unsigned delta; 309 + unsigned int delta; 309 310 struct tty_struct *tty; 310 311 311 312 /* simulated LSR/MSR status from remote */ ··· 397 396 * 398 397 * Note: caller must be holding port lock 399 398 */ 400 - static unsigned __fwtty_port_line_status(struct fwtty_port *port) 399 + static unsigned int __fwtty_port_line_status(struct fwtty_port *port) 401 400 { 402 - unsigned status = 0; 401 + unsigned int status = 0; 403 402 404 403 /* TODO: add module param to tie RNG to DTR as well */ 405 404 ··· 425 424 { 426 425 struct fwtty_peer *peer; 427 426 int err = -ENOENT; 428 - unsigned status = __fwtty_port_line_status(port); 427 + unsigned int status = __fwtty_port_line_status(port); 429 428 430 429 rcu_read_lock(); 431 430 peer = rcu_dereference(port->peer); ··· 455 454 static void fwtty_throttle_port(struct fwtty_port *port) 456 455 { 457 456 struct tty_struct *tty; 458 - unsigned old; 457 + unsigned int old; 459 458 460 459 tty = tty_port_tty_get(&port->port); 461 460 if (!tty) ··· 541 540 static int fwtty_rx(struct fwtty_port *port, unsigned char *data, size_t len) 542 541 { 543 542 int c, n = len; 544 - unsigned lsr; 543 + unsigned int lsr; 545 544 int err = 0; 546 545 547 546 fwtty_dbg(port, "%d\n", n); ··· 636 635 if (addr != port->rx_handler.offset || len != 4) { 637 636 rcode = RCODE_ADDRESS_ERROR; 638 637 } else { 639 - fwtty_update_port_status(port, *(unsigned *)data); 638 + fwtty_update_port_status(port, *(unsigned int *)data); 640 639 rcode = RCODE_COMPLETE; 641 640 } 642 641 break; ··· 829 828 rcu_read_unlock(); 830 829 } 831 830 832 - static struct fwtty_port *fwtty_port_get(unsigned index) 831 + static struct fwtty_port *fwtty_port_get(unsigned int index) 833 832 { 834 833 struct fwtty_port *port; 835 834 ··· 935 934 return rc; 936 935 } 937 936 938 - static unsigned set_termios(struct fwtty_port *port, struct tty_struct *tty) 937 + static unsigned int set_termios(struct fwtty_port *port, struct tty_struct *tty) 939 938 { 940 - unsigned baud, frame; 939 + unsigned int baud, frame; 941 940 942 941 baud = tty_termios_baud_rate(&tty->termios); 943 942 tty_termios_encode_baud_rate(&tty->termios, baud, baud); ··· 989 988 struct tty_struct *tty) 990 989 { 991 990 struct fwtty_port *port = to_port(tty_port, port); 992 - unsigned baud; 991 + unsigned int baud; 993 992 int err; 994 993 995 994 set_bit(TTY_IO_ERROR, &tty->flags); ··· 1265 1264 return 0; 1266 1265 } 1267 1266 1268 - static int fwtty_ioctl(struct tty_struct *tty, unsigned cmd, 1267 + static int fwtty_ioctl(struct tty_struct *tty, unsigned int cmd, 1269 1268 unsigned long arg) 1270 1269 { 1271 1270 struct fwtty_port *port = tty->driver_data; ··· 1298 1297 static void fwtty_set_termios(struct tty_struct *tty, struct ktermios *old) 1299 1298 { 1300 1299 struct fwtty_port *port = tty->driver_data; 1301 - unsigned baud; 1300 + unsigned int baud; 1302 1301 1303 1302 spin_lock_bh(&port->lock); 1304 1303 baud = set_termios(port, tty); ··· 1370 1369 static int fwtty_tiocmget(struct tty_struct *tty) 1371 1370 { 1372 1371 struct fwtty_port *port = tty->driver_data; 1373 - unsigned tiocm; 1372 + unsigned int tiocm; 1374 1373 1375 1374 spin_lock_bh(&port->lock); 1376 1375 tiocm = (port->mctrl & MCTRL_MASK) | (port->mstatus & ~MCTRL_MASK); ··· 1381 1380 return tiocm; 1382 1381 } 1383 1382 1384 - static int fwtty_tiocmset(struct tty_struct *tty, unsigned set, unsigned clear) 1383 + static int fwtty_tiocmset(struct tty_struct *tty, 1384 + unsigned int set, unsigned int clear) 1385 1385 { 1386 1386 struct fwtty_port *port = tty->driver_data; 1387 1387
+21 -21
drivers/staging/fwserial/fwserial.h
··· 22 22 #ifdef FWTTY_PROFILING 23 23 #define DISTRIBUTION_MAX_SIZE 8192 24 24 #define DISTRIBUTION_MAX_INDEX (ilog2(DISTRIBUTION_MAX_SIZE) + 1) 25 - static inline void fwtty_profile_data(unsigned stat[], unsigned val) 25 + static inline void fwtty_profile_data(unsigned int stat[], unsigned int val) 26 26 { 27 27 int n = (val) ? min(ilog2(val) + 1, DISTRIBUTION_MAX_INDEX) : 0; 28 28 ++stat[n]; ··· 78 78 u64 guid; 79 79 int generation; 80 80 int node_id; 81 - unsigned speed; 81 + unsigned int speed; 82 82 int max_payload; 83 83 u64 mgmt_addr; 84 84 ··· 160 160 #define VIRT_CABLE_PLUG_TIMEOUT (60 * HZ) 161 161 162 162 struct stats { 163 - unsigned xchars; 164 - unsigned dropped; 165 - unsigned tx_stall; 166 - unsigned fifo_errs; 167 - unsigned sent; 168 - unsigned lost; 169 - unsigned throttled; 170 - unsigned reads[DISTRIBUTION_MAX_INDEX + 1]; 171 - unsigned writes[DISTRIBUTION_MAX_INDEX + 1]; 172 - unsigned txns[DISTRIBUTION_MAX_INDEX + 1]; 173 - unsigned unthrottle[DISTRIBUTION_MAX_INDEX + 1]; 163 + unsigned int xchars; 164 + unsigned int dropped; 165 + unsigned int tx_stall; 166 + unsigned int fifo_errs; 167 + unsigned int sent; 168 + unsigned int lost; 169 + unsigned int throttled; 170 + unsigned int reads[DISTRIBUTION_MAX_INDEX + 1]; 171 + unsigned int writes[DISTRIBUTION_MAX_INDEX + 1]; 172 + unsigned int txns[DISTRIBUTION_MAX_INDEX + 1]; 173 + unsigned int unthrottle[DISTRIBUTION_MAX_INDEX + 1]; 174 174 }; 175 175 176 176 struct fwconsole_ops { ··· 237 237 struct fwtty_port { 238 238 struct tty_port port; 239 239 struct device *device; 240 - unsigned index; 240 + unsigned int index; 241 241 struct fw_serial *serial; 242 242 struct fw_address_handler rx_handler; 243 243 ··· 246 246 247 247 wait_queue_head_t wait_tx; 248 248 struct delayed_work emit_breaks; 249 - unsigned cps; 249 + unsigned int cps; 250 250 unsigned long break_last; 251 251 252 252 struct work_struct hangup; 253 253 254 - unsigned mstatus; 254 + unsigned int mstatus; 255 255 256 256 spinlock_t lock; 257 - unsigned mctrl; 257 + unsigned int mctrl; 258 258 struct delayed_work drain; 259 259 struct dma_fifo tx_fifo; 260 260 int max_payload; 261 - unsigned status_mask; 262 - unsigned ignore_mask; 263 - unsigned break_ctl:1, 261 + unsigned int status_mask; 262 + unsigned int ignore_mask; 263 + unsigned int break_ctl:1, 264 264 write_only:1, 265 265 overrun:1, 266 266 loopback:1; ··· 349 349 * being used for isochronous traffic) 350 350 * 2) isochronous arbitration always wins. 351 351 */ 352 - static inline int link_speed_to_max_payload(unsigned speed) 352 + static inline int link_speed_to_max_payload(unsigned int speed) 353 353 { 354 354 /* Max async payload is 4096 - see IEEE 1394-2008 tables 6-4, 16-18 */ 355 355 return min(512 << speed, 4096);