aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/cistpl.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2005-12-23 15:51:08 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 18:28:10 -0500
commit3cf89b185971bf186cec657911f08354e7701635 (patch)
tree8d4f1ff08106b64bd03beb7081d442e06a9d2103 /drivers/pcmcia/cistpl.c
parent8084b372adac9c24ff7abdd939b2e8816e7b88a3 (diff)
[PATCH] drivers/pcmcia/cistpl.c: fix endian warnings
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/cistpl.c')
-rw-r--r--drivers/pcmcia/cistpl.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index 55d7247b58e7..120fa8da6392 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -463,7 +463,7 @@ static int follow_link(struct pcmcia_socket *s, tuple_t *tuple)
463 /* Get indirect link from the MFC tuple */ 463 /* Get indirect link from the MFC tuple */
464 read_cis_cache(s, LINK_SPACE(tuple->Flags), 464 read_cis_cache(s, LINK_SPACE(tuple->Flags),
465 tuple->LinkOffset, 5, link); 465 tuple->LinkOffset, 5, link);
466 ofs = le32_to_cpu(*(u_int *)(link+1)); 466 ofs = le32_to_cpu(*(__le32 *)(link+1));
467 SPACE(tuple->Flags) = (link[0] == CISTPL_MFC_ATTR); 467 SPACE(tuple->Flags) = (link[0] == CISTPL_MFC_ATTR);
468 /* Move to the next indirect link */ 468 /* Move to the next indirect link */
469 tuple->LinkOffset += 5; 469 tuple->LinkOffset += 5;
@@ -671,8 +671,8 @@ static int parse_checksum(tuple_t *tuple, cistpl_checksum_t *csum)
671 if (tuple->TupleDataLen < 5) 671 if (tuple->TupleDataLen < 5)
672 return CS_BAD_TUPLE; 672 return CS_BAD_TUPLE;
673 p = (u_char *)tuple->TupleData; 673 p = (u_char *)tuple->TupleData;
674 csum->addr = tuple->CISOffset+(short)le16_to_cpu(*(u_short *)p)-2; 674 csum->addr = tuple->CISOffset+(short)le16_to_cpu(*(__le16 *)p)-2;
675 csum->len = le16_to_cpu(*(u_short *)(p + 2)); 675 csum->len = le16_to_cpu(*(__le16 *)(p + 2));
676 csum->sum = *(p+4); 676 csum->sum = *(p+4);
677 return CS_SUCCESS; 677 return CS_SUCCESS;
678} 678}
@@ -683,7 +683,7 @@ static int parse_longlink(tuple_t *tuple, cistpl_longlink_t *link)
683{ 683{
684 if (tuple->TupleDataLen < 4) 684 if (tuple->TupleDataLen < 4)
685 return CS_BAD_TUPLE; 685 return CS_BAD_TUPLE;
686 link->addr = le32_to_cpu(*(u_int *)tuple->TupleData); 686 link->addr = le32_to_cpu(*(__le32 *)tuple->TupleData);
687 return CS_SUCCESS; 687 return CS_SUCCESS;
688} 688}
689 689
@@ -702,7 +702,7 @@ static int parse_longlink_mfc(tuple_t *tuple,
702 return CS_BAD_TUPLE; 702 return CS_BAD_TUPLE;
703 for (i = 0; i < link->nfn; i++) { 703 for (i = 0; i < link->nfn; i++) {
704 link->fn[i].space = *p; p++; 704 link->fn[i].space = *p; p++;
705 link->fn[i].addr = le32_to_cpu(*(u_int *)p); p += 4; 705 link->fn[i].addr = le32_to_cpu(*(__le32 *)p); p += 4;
706 } 706 }
707 return CS_SUCCESS; 707 return CS_SUCCESS;
708} 708}
@@ -789,10 +789,10 @@ static int parse_jedec(tuple_t *tuple, cistpl_jedec_t *jedec)
789 789
790static int parse_manfid(tuple_t *tuple, cistpl_manfid_t *m) 790static int parse_manfid(tuple_t *tuple, cistpl_manfid_t *m)
791{ 791{
792 u_short *p; 792 __le16 *p;
793 if (tuple->TupleDataLen < 4) 793 if (tuple->TupleDataLen < 4)
794 return CS_BAD_TUPLE; 794 return CS_BAD_TUPLE;
795 p = (u_short *)tuple->TupleData; 795 p = (__le16 *)tuple->TupleData;
796 m->manf = le16_to_cpu(p[0]); 796 m->manf = le16_to_cpu(p[0]);
797 m->card = le16_to_cpu(p[1]); 797 m->card = le16_to_cpu(p[1]);
798 return CS_SUCCESS; 798 return CS_SUCCESS;
@@ -1093,7 +1093,7 @@ static int parse_cftable_entry(tuple_t *tuple,
1093 break; 1093 break;
1094 case 0x20: 1094 case 0x20:
1095 entry->mem.nwin = 1; 1095 entry->mem.nwin = 1;
1096 entry->mem.win[0].len = le16_to_cpu(*(u_short *)p) << 8; 1096 entry->mem.win[0].len = le16_to_cpu(*(__le16 *)p) << 8;
1097 entry->mem.win[0].card_addr = 0; 1097 entry->mem.win[0].card_addr = 0;
1098 entry->mem.win[0].host_addr = 0; 1098 entry->mem.win[0].host_addr = 0;
1099 p += 2; 1099 p += 2;
@@ -1101,9 +1101,9 @@ static int parse_cftable_entry(tuple_t *tuple,
1101 break; 1101 break;
1102 case 0x40: 1102 case 0x40:
1103 entry->mem.nwin = 1; 1103 entry->mem.nwin = 1;
1104 entry->mem.win[0].len = le16_to_cpu(*(u_short *)p) << 8; 1104 entry->mem.win[0].len = le16_to_cpu(*(__le16 *)p) << 8;
1105 entry->mem.win[0].card_addr = 1105 entry->mem.win[0].card_addr =
1106 le16_to_cpu(*(u_short *)(p+2)) << 8; 1106 le16_to_cpu(*(__le16 *)(p+2)) << 8;
1107 entry->mem.win[0].host_addr = 0; 1107 entry->mem.win[0].host_addr = 0;
1108 p += 4; 1108 p += 4;
1109 if (p > q) return CS_BAD_TUPLE; 1109 if (p > q) return CS_BAD_TUPLE;
@@ -1140,7 +1140,7 @@ static int parse_bar(tuple_t *tuple, cistpl_bar_t *bar)
1140 p = (u_char *)tuple->TupleData; 1140 p = (u_char *)tuple->TupleData;
1141 bar->attr = *p; 1141 bar->attr = *p;
1142 p += 2; 1142 p += 2;
1143 bar->size = le32_to_cpu(*(u_int *)p); 1143 bar->size = le32_to_cpu(*(__le32 *)p);
1144 return CS_SUCCESS; 1144 return CS_SUCCESS;
1145} 1145}
1146 1146
@@ -1153,7 +1153,7 @@ static int parse_config_cb(tuple_t *tuple, cistpl_config_t *config)
1153 return CS_BAD_TUPLE; 1153 return CS_BAD_TUPLE;
1154 config->last_idx = *(++p); 1154 config->last_idx = *(++p);
1155 p++; 1155 p++;
1156 config->base = le32_to_cpu(*(u_int *)p); 1156 config->base = le32_to_cpu(*(__le32 *)p);
1157 config->subtuples = tuple->TupleDataLen - 6; 1157 config->subtuples = tuple->TupleDataLen - 6;
1158 return CS_SUCCESS; 1158 return CS_SUCCESS;
1159} 1159}
@@ -1269,7 +1269,7 @@ static int parse_vers_2(tuple_t *tuple, cistpl_vers_2_t *v2)
1269 1269
1270 v2->vers = p[0]; 1270 v2->vers = p[0];
1271 v2->comply = p[1]; 1271 v2->comply = p[1];
1272 v2->dindex = le16_to_cpu(*(u_short *)(p+2)); 1272 v2->dindex = le16_to_cpu(*(__le16 *)(p+2));
1273 v2->vspec8 = p[6]; 1273 v2->vspec8 = p[6];
1274 v2->vspec9 = p[7]; 1274 v2->vspec9 = p[7];
1275 v2->nhdr = p[8]; 1275 v2->nhdr = p[8];
@@ -1310,8 +1310,8 @@ static int parse_format(tuple_t *tuple, cistpl_format_t *fmt)
1310 1310
1311 fmt->type = p[0]; 1311 fmt->type = p[0];
1312 fmt->edc = p[1]; 1312 fmt->edc = p[1];
1313 fmt->offset = le32_to_cpu(*(u_int *)(p+2)); 1313 fmt->offset = le32_to_cpu(*(__le32 *)(p+2));
1314 fmt->length = le32_to_cpu(*(u_int *)(p+6)); 1314 fmt->length = le32_to_cpu(*(__le32 *)(p+6));
1315 1315
1316 return CS_SUCCESS; 1316 return CS_SUCCESS;
1317} 1317}