aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAl Viro <viro@www.linux.org.uk>2005-05-04 00:40:22 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-04 10:33:15 -0400
commit1b75d8ba5ea96e174dc2674e01d87ce0d382ee44 (patch)
tree2c6a81321aff578d78a70373e1e192fb203a710b /drivers/char
parentb1ecb4c3a9e33cc8b93ac9cb046b535b72a15f68 (diff)
[PATCH] ipmi iomem annotations and fixes
annotated, a bunch of direct dereferencing replaced with readb(). Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c32
-rw-r--r--drivers/char/ipmi/ipmi_si_sm.h2
2 files changed, 17 insertions, 17 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 5419440087fd..298574e16061 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1617,15 +1617,15 @@ typedef struct dmi_header
1617 u16 handle; 1617 u16 handle;
1618} dmi_header_t; 1618} dmi_header_t;
1619 1619
1620static int decode_dmi(dmi_header_t *dm, int intf_num) 1620static int decode_dmi(dmi_header_t __iomem *dm, int intf_num)
1621{ 1621{
1622 u8 *data = (u8 *)dm; 1622 u8 __iomem *data = (u8 __iomem *)dm;
1623 unsigned long base_addr; 1623 unsigned long base_addr;
1624 u8 reg_spacing; 1624 u8 reg_spacing;
1625 u8 len = dm->length; 1625 u8 len = readb(&dm->length);
1626 dmi_ipmi_data_t *ipmi_data = dmi_data+intf_num; 1626 dmi_ipmi_data_t *ipmi_data = dmi_data+intf_num;
1627 1627
1628 ipmi_data->type = data[4]; 1628 ipmi_data->type = readb(&data[4]);
1629 1629
1630 memcpy(&base_addr, data+8, sizeof(unsigned long)); 1630 memcpy(&base_addr, data+8, sizeof(unsigned long));
1631 if (len >= 0x11) { 1631 if (len >= 0x11) {
@@ -1640,12 +1640,12 @@ static int decode_dmi(dmi_header_t *dm, int intf_num)
1640 } 1640 }
1641 /* If bit 4 of byte 0x10 is set, then the lsb for the address 1641 /* If bit 4 of byte 0x10 is set, then the lsb for the address
1642 is odd. */ 1642 is odd. */
1643 ipmi_data->base_addr = base_addr | ((data[0x10] & 0x10) >> 4); 1643 ipmi_data->base_addr = base_addr | ((readb(&data[0x10]) & 0x10) >> 4);
1644 1644
1645 ipmi_data->irq = data[0x11]; 1645 ipmi_data->irq = readb(&data[0x11]);
1646 1646
1647 /* The top two bits of byte 0x10 hold the register spacing. */ 1647 /* The top two bits of byte 0x10 hold the register spacing. */
1648 reg_spacing = (data[0x10] & 0xC0) >> 6; 1648 reg_spacing = (readb(&data[0x10]) & 0xC0) >> 6;
1649 switch(reg_spacing){ 1649 switch(reg_spacing){
1650 case 0x00: /* Byte boundaries */ 1650 case 0x00: /* Byte boundaries */
1651 ipmi_data->offset = 1; 1651 ipmi_data->offset = 1;
@@ -1673,7 +1673,7 @@ static int decode_dmi(dmi_header_t *dm, int intf_num)
1673 ipmi_data->offset = 1; 1673 ipmi_data->offset = 1;
1674 } 1674 }
1675 1675
1676 ipmi_data->slave_addr = data[6]; 1676 ipmi_data->slave_addr = readb(&data[6]);
1677 1677
1678 if (is_new_interface(-1, ipmi_data->addr_space,ipmi_data->base_addr)) { 1678 if (is_new_interface(-1, ipmi_data->addr_space,ipmi_data->base_addr)) {
1679 dmi_data_entries++; 1679 dmi_data_entries++;
@@ -1687,9 +1687,9 @@ static int decode_dmi(dmi_header_t *dm, int intf_num)
1687 1687
1688static int dmi_table(u32 base, int len, int num) 1688static int dmi_table(u32 base, int len, int num)
1689{ 1689{
1690 u8 *buf; 1690 u8 __iomem *buf;
1691 struct dmi_header *dm; 1691 struct dmi_header __iomem *dm;
1692 u8 *data; 1692 u8 __iomem *data;
1693 int i=1; 1693 int i=1;
1694 int status=-1; 1694 int status=-1;
1695 int intf_num = 0; 1695 int intf_num = 0;
@@ -1702,12 +1702,12 @@ static int dmi_table(u32 base, int len, int num)
1702 1702
1703 while(i<num && (data - buf) < len) 1703 while(i<num && (data - buf) < len)
1704 { 1704 {
1705 dm=(dmi_header_t *)data; 1705 dm=(dmi_header_t __iomem *)data;
1706 1706
1707 if((data-buf+dm->length) >= len) 1707 if((data-buf+readb(&dm->length)) >= len)
1708 break; 1708 break;
1709 1709
1710 if (dm->type == 38) { 1710 if (readb(&dm->type) == 38) {
1711 if (decode_dmi(dm, intf_num) == 0) { 1711 if (decode_dmi(dm, intf_num) == 0) {
1712 intf_num++; 1712 intf_num++;
1713 if (intf_num >= SI_MAX_DRIVERS) 1713 if (intf_num >= SI_MAX_DRIVERS)
@@ -1715,8 +1715,8 @@ static int dmi_table(u32 base, int len, int num)
1715 } 1715 }
1716 } 1716 }
1717 1717
1718 data+=dm->length; 1718 data+=readb(&dm->length);
1719 while((data-buf) < len && (*data || data[1])) 1719 while((data-buf) < len && (readb(data)||readb(data+1)))
1720 data++; 1720 data++;
1721 data+=2; 1721 data+=2;
1722 i++; 1722 i++;
diff --git a/drivers/char/ipmi/ipmi_si_sm.h b/drivers/char/ipmi/ipmi_si_sm.h
index a0212b004016..62791dd42985 100644
--- a/drivers/char/ipmi/ipmi_si_sm.h
+++ b/drivers/char/ipmi/ipmi_si_sm.h
@@ -51,7 +51,7 @@ struct si_sm_io
51 /* Generic info used by the actual handling routines, the 51 /* Generic info used by the actual handling routines, the
52 state machine shouldn't touch these. */ 52 state machine shouldn't touch these. */
53 void *info; 53 void *info;
54 void *addr; 54 void __iomem *addr;
55 int regspacing; 55 int regspacing;
56 int regsize; 56 int regsize;
57 int regshift; 57 int regshift;