linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hdparm: Fix error in sector offset reporting
@ 2010-01-23 19:18 Martin K. Petersen
  2010-01-24  6:16 ` Mark Lord
  0 siblings, 1 reply; 2+ messages in thread
From: Martin K. Petersen @ 2010-01-23 19:18 UTC (permalink / raw)
  To: Mark Lord; +Cc: linux-ide


The sector offset reporting is off by a factor of two...

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

diff -urN -X /home/mkp/bin/dontdiff hdparm-9.27.orig/identify.c hdparm-9.27/identify.c
--- hdparm-9.27.orig/identify.c	2009-08-20 10:31:01.000000000 -0400
+++ hdparm-9.27/identify.c	2010-01-23 14:07:43.000000000 -0500
@@ -938,7 +938,7 @@
 			printf("\t%-31s %11u bytes\n","Physical Sector size:", sector_bytes * pfactor);
 			if ((val[209] & 0xc000) == 0x4000) {
 				unsigned int offset = val[209] & 0x1fff;
-				printf("\t%-31s %11u bytes\n", "Logical Sector-0 offset:", offset * lsize);
+				printf("\t%-31s %11u bytes\n", "Logical Sector-0 offset:", offset * sector_bytes);
 			}
 		}
 		if (!bbbig) bbbig = (__u64)(ll>mm ? ll : mm); /* # 512 byte blocks */

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

* Re: [PATCH] hdparm: Fix error in sector offset reporting
  2010-01-23 19:18 [PATCH] hdparm: Fix error in sector offset reporting Martin K. Petersen
@ 2010-01-24  6:16 ` Mark Lord
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Lord @ 2010-01-24  6:16 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-ide

Martin K. Petersen wrote:
> The sector offset reporting is off by a factor of two...
> 
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> 
> diff -urN -X /home/mkp/bin/dontdiff hdparm-9.27.orig/identify.c hdparm-9.27/identify.c
> --- hdparm-9.27.orig/identify.c	2009-08-20 10:31:01.000000000 -0400
> +++ hdparm-9.27/identify.c	2010-01-23 14:07:43.000000000 -0500
> @@ -938,7 +938,7 @@
>  			printf("\t%-31s %11u bytes\n","Physical Sector size:", sector_bytes * pfactor);
>  			if ((val[209] & 0xc000) == 0x4000) {
>  				unsigned int offset = val[209] & 0x1fff;
> -				printf("\t%-31s %11u bytes\n", "Logical Sector-0 offset:", offset * lsize);
> +				printf("\t%-31s %11u bytes\n", "Logical Sector-0 offset:", offset * sector_bytes);
..

Thanks, applied.   I *like* easy fixes like that!

-ml

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

end of thread, other threads:[~2010-01-24  6:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-23 19:18 [PATCH] hdparm: Fix error in sector offset reporting Martin K. Petersen
2010-01-24  6:16 ` Mark Lord

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).