aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2005-12-01 17:10:40 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-10 19:15:33 -0400
commit56052d525a05ba9e53d4f11be2d5deee64924514 (patch)
tree798503b2208b232fe1525ac3beea173643b72b6d
parent70f38912935fd4aa3fea1ddf87ed1cee63109cc5 (diff)
[PATCH] cdrom: add endianness annotations
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/cdrom/cdrom.c6
-rw-r--r--include/linux/cdrom.h28
2 files changed, 17 insertions, 17 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 2a0c50d84fc5..7ea0f48f8fa6 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -703,7 +703,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
703{ 703{
704 struct packet_command cgc; 704 struct packet_command cgc;
705 char buffer[16]; 705 char buffer[16];
706 __u16 *feature_code; 706 __be16 *feature_code;
707 int ret; 707 int ret;
708 708
709 init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); 709 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 if ((ret = cdi->ops->generic_packet(cdi, &cgc))) 716 if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
717 return ret; 717 return ret;
718 718
719 feature_code = (__u16 *) &buffer[sizeof(struct feature_header)]; 719 feature_code = (__be16 *) &buffer[sizeof(struct feature_header)];
720 if (be16_to_cpu(*feature_code) == CDF_HWDM) 720 if (be16_to_cpu(*feature_code) == CDF_HWDM)
721 return 0; 721 return 0;
722 722
@@ -2963,7 +2963,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
2963 how much data is available for transfer. buffer[1] is 2963 how much data is available for transfer. buffer[1] is
2964 unfortunately ambigious and the only reliable way seem 2964 unfortunately ambigious and the only reliable way seem
2965 to be to simply skip over the block descriptor... */ 2965 to be to simply skip over the block descriptor... */
2966 offset = 8 + be16_to_cpu(*(unsigned short *)(buffer+6)); 2966 offset = 8 + be16_to_cpu(*(__be16 *)(buffer+6));
2967 2967
2968 if (offset + 16 > sizeof(buffer)) 2968 if (offset + 16 > sizeof(buffer))
2969 return -E2BIG; 2969 return -E2BIG;
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index 3c9b0bc05123..bbbe7b4da0bb 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -749,7 +749,7 @@ struct request_sense {
749#define MRW_MODE_PC 0x03 749#define MRW_MODE_PC 0x03
750 750
751struct mrw_feature_desc { 751struct mrw_feature_desc {
752 __u16 feature_code; 752 __be16 feature_code;
753#if defined(__BIG_ENDIAN_BITFIELD) 753#if defined(__BIG_ENDIAN_BITFIELD)
754 __u8 reserved1 : 2; 754 __u8 reserved1 : 2;
755 __u8 feature_version : 4; 755 __u8 feature_version : 4;
@@ -776,7 +776,7 @@ struct mrw_feature_desc {
776 776
777/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */ 777/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
778struct rwrt_feature_desc { 778struct rwrt_feature_desc {
779 __u16 feature_code; 779 __be16 feature_code;
780#if defined(__BIG_ENDIAN_BITFIELD) 780#if defined(__BIG_ENDIAN_BITFIELD)
781 __u8 reserved1 : 2; 781 __u8 reserved1 : 2;
782 __u8 feature_version : 4; 782 __u8 feature_version : 4;
@@ -803,7 +803,7 @@ struct rwrt_feature_desc {
803}; 803};
804 804
805typedef struct { 805typedef struct {
806 __u16 disc_information_length; 806 __be16 disc_information_length;
807#if defined(__BIG_ENDIAN_BITFIELD) 807#if defined(__BIG_ENDIAN_BITFIELD)
808 __u8 reserved1 : 3; 808 __u8 reserved1 : 3;
809 __u8 erasable : 1; 809 __u8 erasable : 1;
@@ -849,7 +849,7 @@ typedef struct {
849} disc_information; 849} disc_information;
850 850
851typedef struct { 851typedef struct {
852 __u16 track_information_length; 852 __be16 track_information_length;
853 __u8 track_lsb; 853 __u8 track_lsb;
854 __u8 session_lsb; 854 __u8 session_lsb;
855 __u8 reserved1; 855 __u8 reserved1;
@@ -880,12 +880,12 @@ typedef struct {
880 __u8 lra_v : 1; 880 __u8 lra_v : 1;
881 __u8 reserved3 : 6; 881 __u8 reserved3 : 6;
882#endif 882#endif
883 __u32 track_start; 883 __be32 track_start;
884 __u32 next_writable; 884 __be32 next_writable;
885 __u32 free_blocks; 885 __be32 free_blocks;
886 __u32 fixed_packet_size; 886 __be32 fixed_packet_size;
887 __u32 track_size; 887 __be32 track_size;
888 __u32 last_rec_address; 888 __be32 last_rec_address;
889} track_information; 889} track_information;
890 890
891struct feature_header { 891struct feature_header {
@@ -896,12 +896,12 @@ struct feature_header {
896}; 896};
897 897
898struct mode_page_header { 898struct mode_page_header {
899 __u16 mode_data_length; 899 __be16 mode_data_length;
900 __u8 medium_type; 900 __u8 medium_type;
901 __u8 reserved1; 901 __u8 reserved1;
902 __u8 reserved2; 902 __u8 reserved2;
903 __u8 reserved3; 903 __u8 reserved3;
904 __u16 desc_length; 904 __be16 desc_length;
905}; 905};
906 906
907#ifdef __KERNEL__ 907#ifdef __KERNEL__
@@ -1106,7 +1106,7 @@ typedef struct {
1106#endif 1106#endif
1107 __u8 session_format; 1107 __u8 session_format;
1108 __u8 reserved6; 1108 __u8 reserved6;
1109 __u32 packet_size; 1109 __be32 packet_size;
1110 __u16 audio_pause; 1110 __u16 audio_pause;
1111 __u8 mcn[16]; 1111 __u8 mcn[16];
1112 __u8 isrc[16]; 1112 __u8 isrc[16];
@@ -1151,7 +1151,7 @@ typedef struct {
1151} rpc_state_t; 1151} rpc_state_t;
1152 1152
1153struct event_header { 1153struct event_header {
1154 __u16 data_len; 1154 __be16 data_len;
1155#if defined(__BIG_ENDIAN_BITFIELD) 1155#if defined(__BIG_ENDIAN_BITFIELD)
1156 __u8 nea : 1; 1156 __u8 nea : 1;
1157 __u8 reserved1 : 4; 1157 __u8 reserved1 : 4;