Commit 56052d52 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

[PATCH] cdrom: add endianness annotations

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 70f38912
...@@ -703,7 +703,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) ...@@ -703,7 +703,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
{ {
struct packet_command cgc; struct packet_command cgc;
char buffer[16]; char buffer[16];
__u16 *feature_code; __be16 *feature_code;
int ret; int ret;
init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
...@@ -716,7 +716,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) ...@@ -716,7 +716,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
if ((ret = cdi->ops->generic_packet(cdi, &cgc))) if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
return ret; return ret;
feature_code = (__u16 *) &buffer[sizeof(struct feature_header)]; feature_code = (__be16 *) &buffer[sizeof(struct feature_header)];
if (be16_to_cpu(*feature_code) == CDF_HWDM) if (be16_to_cpu(*feature_code) == CDF_HWDM)
return 0; return 0;
...@@ -2963,7 +2963,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, ...@@ -2963,7 +2963,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
how much data is available for transfer. buffer[1] is how much data is available for transfer. buffer[1] is
unfortunately ambigious and the only reliable way seem unfortunately ambigious and the only reliable way seem
to be to simply skip over the block descriptor... */ to be to simply skip over the block descriptor... */
offset = 8 + be16_to_cpu(*(unsigned short *)(buffer+6)); offset = 8 + be16_to_cpu(*(__be16 *)(buffer+6));
if (offset + 16 > sizeof(buffer)) if (offset + 16 > sizeof(buffer))
return -E2BIG; return -E2BIG;
......
...@@ -749,7 +749,7 @@ struct request_sense { ...@@ -749,7 +749,7 @@ struct request_sense {
#define MRW_MODE_PC 0x03 #define MRW_MODE_PC 0x03
struct mrw_feature_desc { struct mrw_feature_desc {
__u16 feature_code; __be16 feature_code;
#if defined(__BIG_ENDIAN_BITFIELD) #if defined(__BIG_ENDIAN_BITFIELD)
__u8 reserved1 : 2; __u8 reserved1 : 2;
__u8 feature_version : 4; __u8 feature_version : 4;
...@@ -776,7 +776,7 @@ struct mrw_feature_desc { ...@@ -776,7 +776,7 @@ struct mrw_feature_desc {
/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */ /* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
struct rwrt_feature_desc { struct rwrt_feature_desc {
__u16 feature_code; __be16 feature_code;
#if defined(__BIG_ENDIAN_BITFIELD) #if defined(__BIG_ENDIAN_BITFIELD)
__u8 reserved1 : 2; __u8 reserved1 : 2;
__u8 feature_version : 4; __u8 feature_version : 4;
...@@ -803,7 +803,7 @@ struct rwrt_feature_desc { ...@@ -803,7 +803,7 @@ struct rwrt_feature_desc {
}; };
typedef struct { typedef struct {
__u16 disc_information_length; __be16 disc_information_length;
#if defined(__BIG_ENDIAN_BITFIELD) #if defined(__BIG_ENDIAN_BITFIELD)
__u8 reserved1 : 3; __u8 reserved1 : 3;
__u8 erasable : 1; __u8 erasable : 1;
...@@ -849,7 +849,7 @@ typedef struct { ...@@ -849,7 +849,7 @@ typedef struct {
} disc_information; } disc_information;
typedef struct { typedef struct {
__u16 track_information_length; __be16 track_information_length;
__u8 track_lsb; __u8 track_lsb;
__u8 session_lsb; __u8 session_lsb;
__u8 reserved1; __u8 reserved1;
...@@ -880,12 +880,12 @@ typedef struct { ...@@ -880,12 +880,12 @@ typedef struct {
__u8 lra_v : 1; __u8 lra_v : 1;
__u8 reserved3 : 6; __u8 reserved3 : 6;
#endif #endif
__u32 track_start; __be32 track_start;
__u32 next_writable; __be32 next_writable;
__u32 free_blocks; __be32 free_blocks;
__u32 fixed_packet_size; __be32 fixed_packet_size;
__u32 track_size; __be32 track_size;
__u32 last_rec_address; __be32 last_rec_address;
} track_information; } track_information;
struct feature_header { struct feature_header {
...@@ -896,12 +896,12 @@ struct feature_header { ...@@ -896,12 +896,12 @@ struct feature_header {
}; };
struct mode_page_header { struct mode_page_header {
__u16 mode_data_length; __be16 mode_data_length;
__u8 medium_type; __u8 medium_type;
__u8 reserved1; __u8 reserved1;
__u8 reserved2; __u8 reserved2;
__u8 reserved3; __u8 reserved3;
__u16 desc_length; __be16 desc_length;
}; };
#ifdef __KERNEL__ #ifdef __KERNEL__
...@@ -1106,7 +1106,7 @@ typedef struct { ...@@ -1106,7 +1106,7 @@ typedef struct {
#endif #endif
__u8 session_format; __u8 session_format;
__u8 reserved6; __u8 reserved6;
__u32 packet_size; __be32 packet_size;
__u16 audio_pause; __u16 audio_pause;
__u8 mcn[16]; __u8 mcn[16];
__u8 isrc[16]; __u8 isrc[16];
...@@ -1151,7 +1151,7 @@ typedef struct { ...@@ -1151,7 +1151,7 @@ typedef struct {
} rpc_state_t; } rpc_state_t;
struct event_header { struct event_header {
__u16 data_len; __be16 data_len;
#if defined(__BIG_ENDIAN_BITFIELD) #if defined(__BIG_ENDIAN_BITFIELD)
__u8 nea : 1; __u8 nea : 1;
__u8 reserved1 : 4; __u8 reserved1 : 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment