aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2015-02-06 17:11:42 -0500
committerJames Bottomley <JBottomley@Odin.com>2015-04-09 21:08:10 -0400
commit17787a09fdfcb07ccc361758737af0dfa1ea4214 (patch)
treeb8e1f3d4a35800439aa1746b6eea2c111e1eb378
parentf71429ab535d90806a35bc346adcdebfc8996008 (diff)
aha1542: Simplify aha1542_biosparam
Simplify aha1542_biosparam, use sector_div, remove unused BIOS_TRANSLATION_1632. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r--drivers/scsi/aha1542.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index d15191324b06..161586545804 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -78,7 +78,6 @@ static int dma_speed[MAXBOARDS] = { -1, -1, -1, -1 };
78module_param_array(dma_speed, int, NULL, 0); 78module_param_array(dma_speed, int, NULL, 0);
79MODULE_PARM_DESC(dma_speed, "DMA speed [MB/s] (5,6,7,8,10, default=-1 [by jumper])"); 79MODULE_PARM_DESC(dma_speed, "DMA speed [MB/s] (5,6,7,8,10, default=-1 [by jumper])");
80 80
81#define BIOS_TRANSLATION_1632 0 /* Used by some old 1542A boards */
82#define BIOS_TRANSLATION_6432 1 /* Default case these days */ 81#define BIOS_TRANSLATION_6432 1 /* Default case these days */
83#define BIOS_TRANSLATION_25563 2 /* Big disk case */ 82#define BIOS_TRANSLATION_25563 2 /* Big disk case */
84 83
@@ -1048,24 +1047,20 @@ static int aha1542_host_reset(Scsi_Cmnd *SCpnt)
1048} 1047}
1049 1048
1050static int aha1542_biosparam(struct scsi_device *sdev, 1049static int aha1542_biosparam(struct scsi_device *sdev,
1051 struct block_device *bdev, sector_t capacity, int *ip) 1050 struct block_device *bdev, sector_t capacity, int geom[])
1052{ 1051{
1053 struct aha1542_hostdata *aha1542 = shost_priv(sdev->host); 1052 struct aha1542_hostdata *aha1542 = shost_priv(sdev->host);
1054 int translation_algorithm;
1055 int size = capacity;
1056 1053
1057 translation_algorithm = aha1542->bios_translation; 1054 if (capacity >= 0x200000 &&
1058 1055 aha1542->bios_translation == BIOS_TRANSLATION_25563) {
1059 if ((size >> 11) > 1024 && translation_algorithm == BIOS_TRANSLATION_25563) {
1060 /* Please verify that this is the same as what DOS returns */ 1056 /* Please verify that this is the same as what DOS returns */
1061 ip[0] = 255; 1057 geom[0] = 255; /* heads */
1062 ip[1] = 63; 1058 geom[1] = 63; /* sectors */
1063 ip[2] = size / 255 / 63;
1064 } else { 1059 } else {
1065 ip[0] = 64; 1060 geom[0] = 64; /* heads */
1066 ip[1] = 32; 1061 geom[1] = 32; /* sectors */
1067 ip[2] = size >> 11;
1068 } 1062 }
1063 geom[2] = sector_div(capacity, geom[0] * geom[1]); /* cylinders */
1069 1064
1070 return 0; 1065 return 0;
1071} 1066}