Skip to contentSkip to conversation

libata: be less verbose about hpa

PATCH Applied Tejun Heo 3 participants 4 messages Jun 25, 2007 – Jun 27, 2007 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: be less verbose about hpa

There's no reason to print out hpa related messages when HPA is not active. Kill the unconditional message and add a warning message which is printed if HPA size is smaller than the current size.

---
 drivers/ata/libata-core.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/ata/libata-core.c +5 -6
index adfae9d..deda684 100644
@@ -983,11 +983,6 @@ static u64 ata_hpa_resize(struct ata_device *dev)
 	else
 		hpa_sectors = ata_read_native_max_address(dev);
 
-	/* if no hpa, both should be equal */
-	ata_dev_printk(dev, KERN_INFO, "%s 1: sectors = %lld, "
-				"hpa_sectors = %lld\n",
-		__FUNCTION__, (long long)sectors, (long long)hpa_sectors);
-
 	if (hpa_sectors > sectors) {
 		ata_dev_printk(dev, KERN_INFO,
 			"Host Protected Area detected:\n"
@@ -1009,7 +1004,11 @@ static u64 ata_hpa_resize(struct ata_device *dev)
 				return hpa_sectors;
 			}
 		}
-	}
+	} else if (hpa_sectors < sectors)
+		ata_dev_printk(dev, KERN_WARNING, "%s 1: hpa sectors (%lld) "
+			       "is smaller than sectors (%lld)\n", __FUNCTION__,
+			       (long long)hpa_sectors, (long long)sectors);
+
 	return sectors;
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · On Mon, 25 Jun 2007 20:45:54 +0900 Tejun Heo <[email protected]> wrote:

There's no reason to print out hpa related messages when HPA is not active. Kill the unconditional message and add a warning message which is printed if HPA size is smaller than the current size.

(Should it be a dprintk instead of vanish though ?)

author
#2 lore raw
Quoted 7 lines · Alan Cox
Quoted 4 lines · On Mon, 25 Jun 2007 20:45:54 +0900 Tejun Heo <[email protected]> wrote:

There's no reason to print out hpa related messages when HPA is not active. Kill the unconditional message and add a warning message which is printed if HPA size is smaller than the current size.

Quoted 5 lines
Quoted 1 line

(Should it be a dprintk instead of vanish though ?)

I thought about doing KERN_DEBUG but we have printks for both hpa > current and hpa < current, so if no message is printed hpa == current and the current sectors is printed in the next line anyway, so I think we can just drop it.

Signature · 1 line
tejun
Applied
#3 lore raw
In reply to Tejun Heo
Quoted 26 lines · Tejun Heo

There's no reason to print out hpa related messages when HPA is not active. Kill the unconditional message and add a warning message which is printed if HPA size is smaller than the current size.

---
 drivers/ata/libata-core.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/ata/libata-core.c +0 -5
index adfae9d..deda684 100644
@@ -983,11 +983,6 @@ static u64 ata_hpa_resize(struct ata_device *dev)
 	else
 		hpa_sectors = ata_read_native_max_address(dev);
 
-	/* if no hpa, both should be equal */
-	ata_dev_printk(dev, KERN_INFO, "%s 1: sectors = %lld, "
-				"hpa_sectors = %lld\n",
-		__FUNCTION__, (long long)sectors, (long long)hpa_sectors);
-
 	if (hpa_sectors > sectors) {
 		ata_dev_printk(dev, KERN_INFO,
 			"Host Protected Area detected:\n"

drivers/ata/libata-core.c static u64 ata_hpa_resize(struct ata_device *dev) · line 1011

Quoted 9 lines
drivers/ata/libata-core.c +5 -1
@@ -1009,7 +1004,11 @@ static u64 ata_hpa_resize(struct ata_device *dev)
 				return hpa_sectors;
 			}
 		}
-	}
+	} else if (hpa_sectors < sectors)
+		ata_dev_printk(dev, KERN_WARNING, "%s 1: hpa sectors (%lld) "
+			       "is smaller than sectors (%lld)\n", __FUNCTION__,
+			       (long long)hpa_sectors, (long long)sectors);
+

applied