linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ata_piix: minor typo and a printk fix
@ 2013-09-27 14:15 Levente Kurusa
  2013-09-30 19:36 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Levente Kurusa @ 2013-09-27 14:15 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide@vger.kernel.org

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 <levex@linux.com>
---
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 93cb092..a535926 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -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,38 @@ static const int *piix_init_sata_map(struct 
pci_dev *pdev,
  	const int *map;
  	int i, invalid_map = 0;
  	u8 map_value;
+	char buf[32];
+	char *p = buf, *end = buf + sizeof(buf);

  	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");
+			p += scnprintf(p, end - p, " XX");
  			break;

  		case NA:
-			pr_cont(" --");
+			p += scnprintf(p, end - p, " --");
  			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");
+			p += scnprintf(p, end - p, " IDE IDE");
  			break;
-
  		default:
-			pr_cont(" P%d", map[i]);
+			p += scnprintf(p, end - p, " P%d", map[i]);
  			if (i & 1)
  				pinfo[i / 2].flags |= ATA_FLAG_SLAVE_POSS;
  			break;
  		}
  	}
-	pr_cont(" ]\n");
+	dev_info(&pdev->dev, "MAP [%s ]\n", buf);

  	if (invalid_map)
  		dev_err(&pdev->dev, "invalid MAP value %u\n", map_value);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ata_piix: minor typo and a printk fix
  2013-09-27 14:15 [PATCH v2] ata_piix: minor typo and a printk fix Levente Kurusa
@ 2013-09-30 19:36 ` Tejun Heo
  2013-10-01 17:39   ` Levente Kurusa
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2013-09-30 19:36 UTC (permalink / raw)
  To: Levente Kurusa; +Cc: linux-ide@vger.kernel.org

Hello,

Tried to apply it but patch seems whitespace damaged and doesn't
apply.  Please resend.  Also, one comment.

On Fri, Sep 27, 2013 at 04:15:36PM +0200, Levente Kurusa wrote:
> -	ICH5_PMR		= 0x90, /* port mapping register */
> +	ICH5_PMR		= 0x90, /* address map register */

I don't know whether the name has changed but PMR at least did stand
for Port Mapping Register.  I don't see much point in updating the
comment here.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ata_piix: minor typo and a printk fix
  2013-09-30 19:36 ` Tejun Heo
@ 2013-10-01 17:39   ` Levente Kurusa
  0 siblings, 0 replies; 3+ messages in thread
From: Levente Kurusa @ 2013-10-01 17:39 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide@vger.kernel.org

2013-09-30 21:36 keltezéssel, Tejun Heo írta:
> Hello,
> 
> Tried to apply it but patch seems whitespace damaged and doesn't
> apply.  Please resend.  Also, one comment.
> 
> On Fri, Sep 27, 2013 at 04:15:36PM +0200, Levente Kurusa wrote:
>> -	ICH5_PMR		= 0x90, /* port mapping register */
>> +	ICH5_PMR		= 0x90, /* address map register */
> 
> I don't know whether the name has changed but PMR at least did stand
> for Port Mapping Register.  I don't see much point in updating the
> comment here.
> 
> Thanks.
> 

According to the specifications of ICH5, it is called
Address Map Register. I didn't want to change the variable's name,
because I think it would cause some headaches for those wanting to find
information on google.
http://www.intel.com/content/dam/doc/datasheet/82801eb-82801er-io-controller-hub-datasheet.pdf
See Chapter 11.1.32

The patch gets whitespace damaged due to Thunderbird, I will experiment
before resending it again.

-- 
Regards,
Levente Kurusa

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-01 17:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 14:15 [PATCH v2] ata_piix: minor typo and a printk fix Levente Kurusa
2013-09-30 19:36 ` Tejun Heo
2013-10-01 17:39   ` Levente Kurusa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).