diff options
author | Bart Van Assche <bvanassche@acm.org> | 2010-07-20 18:19:15 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:05:44 -0400 |
commit | d058fd31c7f44960b00566bda39c85377f461a7b (patch) | |
tree | faac866391ff5111538f41303139759b7c3f4ee1 /include/scsi/fc_frame.h | |
parent | ba402804ac2447ad41f4919603bf3e6f6db63110 (diff) |
[SCSI] fcoe: make it possible to verify fcoe with sparse
Analyzing fcoe with sparse currently fails. This is because struct
fcoe_rcv_info contains two enum members that have been declared with
__attribute__((packed)). Apparently gcc honors this attribute while sparse
ignores it. The result is that sizeof(struct fcoe_rcv_info)
== sizeof(struct sk_buff::cb) == 48 on a 64-bit system according to gcc, but
not according to sparse. The patch below modifies the definition of
struct fcoe_rcv_info such that gcc and sparse interpret this structure
definition in the same way. The current sparse output is as follows:
$ cd linux-2.6.34
$ make C=2 M=drivers/scsi/fcoe modules
CHECK drivers/scsi/fcoe/fcoe.c
include/scsi/fc_frame.h:81:9: error: invalid bitfield width, -1.
CC [M] drivers/scsi/fcoe/fcoe.o
CHECK drivers/scsi/fcoe/libfcoe.c
include/scsi/fc_frame.h:81:9: error: invalid bitfield width, -1.
drivers/scsi/fcoe/libfcoe.c:56:37: error: invalid initializer
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Cc: jeykholt@cisco.com
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi/fc_frame.h')
-rw-r--r-- | include/scsi/fc_frame.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h index 4d3e9c7b7c57..15427fab8a57 100644 --- a/include/scsi/fc_frame.h +++ b/include/scsi/fc_frame.h | |||
@@ -66,8 +66,8 @@ struct fcoe_rcv_info { | |||
66 | struct fc_fcp_pkt *fr_fsp; /* for the corresponding fcp I/O */ | 66 | struct fc_fcp_pkt *fr_fsp; /* for the corresponding fcp I/O */ |
67 | u32 fr_crc; | 67 | u32 fr_crc; |
68 | u16 fr_max_payload; /* max FC payload */ | 68 | u16 fr_max_payload; /* max FC payload */ |
69 | enum fc_sof fr_sof; /* start of frame delimiter */ | 69 | u8 fr_sof; /* start of frame delimiter */ |
70 | enum fc_eof fr_eof; /* end of frame delimiter */ | 70 | u8 fr_eof; /* end of frame delimiter */ |
71 | u8 fr_flags; /* flags - see below */ | 71 | u8 fr_flags; /* flags - see below */ |
72 | u8 granted_mac[ETH_ALEN]; /* FCoE MAC address */ | 72 | u8 granted_mac[ETH_ALEN]; /* FCoE MAC address */ |
73 | }; | 73 | }; |