[staging:staging-next 494/499] drivers/staging/fwserial/fwserial.c:581:3: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t'

kbuild test robot fengguang.wu at intel.com
Wed Jan 30 20:03:24 UTC 2013


tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next
head:   0d145a501778042d0411c843ed5b468b41f8a171
commit: ef34dd184d58824f1cde7402afa8ba2a957029d9 [494/499] staging/fwserial: add diagnostic for buffer overflow
config: make ARCH=i386 allmodconfig

All warnings:

   drivers/staging/fwserial/fwserial.c:430:16: sparse: incompatible types in comparison expression (different address spaces)
   drivers/staging/fwserial/fwserial.c:699:30: sparse: incompatible types in comparison expression (different address spaces)
   drivers/staging/fwserial/fwserial.c:802:16: sparse: incompatible types in comparison expression (different address spaces)
   drivers/staging/fwserial/fwserial.c:898:16: sparse: incompatible types in comparison expression (different address spaces)
   drivers/staging/fwserial/fwserial.c:1842:14: sparse: incompatible types in comparison expression (different address spaces)
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_buffer_rx':
>> drivers/staging/fwserial/fwserial.c:581:3: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' [-Wformat]

vim +581 drivers/staging/fwserial/fwserial.c

   565		if (c > 0)
   566			tty_flip_buffer_push(tty);
   567	
   568		if (list_empty(&port->buf_list))
   569			clear_bit(BUFFERING_RX, &port->flags);
   570		spin_unlock_bh(&port->lock);
   571	
   572		tty_kref_put(tty);
   573	}
   574	
   575	static int fwtty_buffer_rx(struct fwtty_port *port, unsigned char *d, size_t n)
   576	{
   577		struct buffered_rx *buf;
   578		size_t size = (n + sizeof(struct buffered_rx) + 0xFF) & ~0xFF;
   579	
   580		if (port->buffered + n > HIGH_WATERMARK) {
 > 581			fwtty_err_ratelimited(port, "overflowed rx buffer: buffered: %d new: %ld wtrmk: %d",
   582					      port->buffered, n, HIGH_WATERMARK);
   583			return 0;
   584		}
   585		buf = kmalloc(size, GFP_ATOMIC);
   586		if (!buf)
   587			return 0;
   588		INIT_LIST_HEAD(&buf->list);
   589		buf->n = n;

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation



More information about the devel mailing list