From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 10/10] ide-disk: use ata_id_hpa_enabled()
Date: Tue, 22 Jul 2008 23:13:11 +0200 [thread overview]
Message-ID: <20080722211311.20478.47051.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080722211159.20478.74184.sendpatchset@localhost.localdomain>
idedisk_supports_hpa() -> ata_id_hpa_enabled().
The latter one also checks validity of words 82 & 85.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-disk.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
Index: b/drivers/ide/ide-disk.c
===================================================================
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -379,17 +379,6 @@ static unsigned long long sectors_to_MB(
}
/*
- * Bits 10 of command_set_1 and cfs_enable_1 must be equal,
- * so on non-buggy drives we need test only one.
- * However, we should also check whether these fields are valid.
- */
-static inline int idedisk_supports_hpa(const u16 *id)
-{
- return (id[ATA_ID_COMMAND_SET_1] & 0x0400) &&
- (id[ATA_ID_CFS_ENABLE_1] & 0x0400);
-}
-
-/*
* The same here.
*/
static inline int idedisk_supports_lba48(const u16 *id)
@@ -468,7 +457,7 @@ static void init_idedisk_capacity(ide_dr
* If this drive supports the Host Protected Area feature set,
* then we may need to change our opinion about the drive's capacity.
*/
- int hpa = idedisk_supports_hpa(id);
+ int hpa = ata_id_hpa_enabled(id);
if (idedisk_supports_lba48(id)) {
/* drive speaks 48-bit LBA */
@@ -946,7 +935,7 @@ static int ide_disk_probe(ide_drive_t *d
*/
static void ide_disk_resume(ide_drive_t *drive)
{
- if (idedisk_supports_hpa(drive->id))
+ if (ata_id_hpa_enabled(drive->id))
init_idedisk_capacity(drive);
}
prev parent reply other threads:[~2008-07-22 21:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-22 21:11 [PATCH 00/10] ide: make ide 'struct hd_driveid'-free Bartlomiej Zolnierkiewicz
2008-07-22 21:12 ` [PATCH 01/10] ide: fix pre-EIDE SWDMA support on big-endian Bartlomiej Zolnierkiewicz
2008-07-22 21:12 ` [PATCH 02/10] ide: fix ide_fix_driveid() Bartlomiej Zolnierkiewicz
2008-07-22 21:12 ` [PATCH 03/10] ide: remove superfluous check from ide_disk_special() Bartlomiej Zolnierkiewicz
2008-07-22 21:12 ` [PATCH 04/10] ide: cleanup ide_disk_init_mult_count() Bartlomiej Zolnierkiewicz
2008-07-22 21:12 ` [PATCH 05/10] ide: cleanup ide_fix_driveid() Bartlomiej Zolnierkiewicz
2008-07-22 21:12 ` [PATCH 06/10] ide: make drive->id an union Bartlomiej Zolnierkiewicz
2008-07-22 21:12 ` [PATCH 07/10] ide: remove drive->driveid Bartlomiej Zolnierkiewicz
2008-07-22 21:12 ` [PATCH 08/10] ide: use ata_id_current_chs_valid() Bartlomiej Zolnierkiewicz
2008-07-22 21:13 ` [PATCH 09/10] ide-disk: use ata_id_wcache_enabled() Bartlomiej Zolnierkiewicz
2008-07-22 21:13 ` Bartlomiej Zolnierkiewicz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080722211311.20478.47051.sendpatchset@localhost.localdomain \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox