ata_piix: minor typo and a printk fix
PATCH RESEND 1/1 ata_piix: minor typo and a printk fix
The patch fixes a printk() being cut in half, some typos and a change in comments to better reflect the specs.
Signed-off-by Levente Kurusa <[email protected]>
---
drivers/ata/ata_piix.c +27 -9
@@ -100,7 +100,7 @@enum {PIIX_IOCFG =0x54 ,/* IDE I/O configuration register */ -ICH5_PMR =0x90 ,/* port mapping register */ +ICH5_PMR =0x90 ,/* address map register */ ICH5_PCS =0x92 ,/* port control and status */ PIIX_SIDPR_BAR =5 ,PIIX_SIDPR_LEN =16 ,
@@ -233,7 +233,7 @@ static const struct pci_device_id piix_pci_tbl[] = { PCI_CLASS_STORAGE_IDE << 8, 0xffff00, ich6m_sata },/* 82801GB/GR/GH (ICH7, identical to ICH6) */ { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata }, -/* 2801GBM/GHM (ICH7M, identical to ICH6M) */ +/* 82801GBM/GHM (ICH7M, identical to ICH6M) */ { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata },/* Enterprise Southbridge 2 (631xESB/632xESB) */ { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata },
@@ -515,7 +515,7 @@ static int ich_pata_cable_detect(struct ata_port *ap)const struct ich_laptop *lap = &ich_laptop[0 ];u8 mask; -/* Check for specials - Acer Aspire 5602WLMi */ +/* Check for specials */ while (lap->device) { if (lap->device == pdev->device && lap->subvendor == pdev->subsystem_vendor &&
@@ -1364,38 +1364,56 @@ static const int *piix_init_sata_map(struct pci_dev *pdev,const int *map;int i, invalid_map =0 ;u8 map_value; +char *mapdata[4 ];pci_read_config_byte (pdev,ICH5_PMR , &map_value); map = map_db->map[map_value & map_db->mask]; -dev_info (&pdev->dev,"MAP [" );for (i =0 ; i <4 ; i++) {switch (map[i]) {case RV : invalid_map =1 ; -pr_cont (" XX" ); + mapdata[i] =" XX" ;break ;case NA : -pr_cont (" --" ); + mapdata[i] =" --" ;break ;case IDE :WARN_ON ((i &1 ) || map[i +1 ] !=IDE ); pinfo[i /2 ] = piix_port_info[ich_pata_100]; i++; -pr_cont (" IDE IDE" ); + mapdata[i] =" IDE IDE" ;break ; +case P0 : + mapdata[i] =" P0" ; + goto flag; + +case P1 : + mapdata[i] =" P1" ; + goto flag; + +case P2 : + mapdata[i] =" P2" ; + goto flag; + +case P3 : + mapdata[i] =" P3" ; + goto flag; +default : -pr_cont (" P%d" , map[i]); + mapdata[i] =" INV" ; +flag:if (i &1 ) pinfo[i /2 ].flags |=ATA_FLAG_SLAVE_POSS ;break ; } } -pr_cont (" ]\n" ); +dev_info (&pdev->dev,"MAP [%s%s%s%s ]\n" , mapdata[0 ], mapdata[1 ], + mapdata[2 ], mapdata[3 ]);if (invalid_map)dev_err (&pdev->dev,"invalid MAP value %u\n" , map_value);
Hello,
drivers/ata/ata_piix.c static const int *piix_init_sata_map(struct · line 1368
Quoted 6 lines · Levente Kurusa
drivers/ata/ata_piix.c +1
-0@@ -1364,38 +1364,56 @@ static const int *piix_init_sata_map(structpci_dev *pdev, const int *map;int i, invalid_map =0 ;u8 map_value; +char *mapdata[4 ];
char buf[32]; char *p = buf, *end = buf + sizeof(buf);
Quoted 33 lines
drivers/ata/ata_piix.c +9
-4pci_read_config_byte (pdev,ICH5_PMR , &map_value); map = map_db->map[map_value & map_db->mask]; -dev_info (&pdev->dev,"MAP [" );for (i =0 ; i <4 ; i++) {switch (map[i]) {case RV : invalid_map =1 ; -pr_cont (" XX" ); + mapdata[i] =" XX" ;break ;case NA : -pr_cont (" --" ); + mapdata[i] =" --" ;break ;case IDE :WARN_ON ((i &1 ) || map[i +1 ] !=IDE ); pinfo[i /2 ] = piix_port_info[ich_pata_100]; i++; -pr_cont (" IDE IDE" ); + mapdata[i] =" IDE IDE" ;break ; +case P0 : + mapdata[i] =" P0" ; + goto flag; + +case P1 : + mapdata[i] =" P1" ;
drivers/ata/ata_piix.c static const int *piix_init_sata_map(struct pci_dev *pdev, · line 1406
Quoted 10 lines
drivers/ata/ata_piix.c +10
-0+ goto flag; + +case P2 : + mapdata[i] =" P2" ; + goto flag; + +case P3 : + mapdata[i] =" P3" ; + goto flag; +
p += scnprintf(p, end - p, " P%d", map[i]);
Thanks.
Signature · 1 line
tejun
2013-09-27 15:53 keltezéssel, Tejun Heo írta:
Quoted 2 lines
char buf[32]; char *p = buf, *end = buf + sizeof(buf);
Sorry, I am not that familiar with kernel API (yet), I will resend in a minute.
Signature · 2 lines
Regards, Levente Kurusa