Can't get rid of sparse warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm getting the following warning from sparse on the line marked /* L523 */ down below. This is from an x86_64 installation of 2.6.19.rc6. I've included the relevant structs for reference.

I'd like to get the code fixed so sparse runs warning-free, but I'm having trouble understanding just what the warning tells me. (This is my first time using sparse.) Can you help by explaining it? Thanks.

Here's the sparse error:

drivers/net/atl1/atl1_main.c:523:25: warning: incorrect type in assignment (different base types) drivers/net/atl1/atl1_main.c:523:25: expected unsigned long long [unsigned] [usertype] buffer_addr drivers/net/atl1/atl1_main.c:523:25: got restricted unsigned long long [usertype] [force] <noident>
***********************************************

Here's the source code:
/* .h snippet */
typedef struct rx_free_desc {
	u64 buffer_addr;
	u16 buf_len;
	u16 coalese;
} _AT_ATTRIB_PACK_ rx_free_desc_t;

struct at_buffer {
	struct sk_buff *skb;
	u16 length;
	u16 alloced;
	dma_addr_t dma;  /*dma_addr_t is u64 on my system*/
};

/* .c snippet */
	struct at_buffer *buffer_info;
	rx_free_desc_t *rfd_desc;

And this is the line that generates the sparse warning:
/* L523 */ rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma);

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux