Re: [PATCH 04/71] ncr5380: Remove more pointless macros

2015-11-18 Thread Hannes Reinecke

On 11/18/2015 09:34 AM, Finn Thain wrote:

ASM macro is never defined. rtrc in pas16.c is not used.
NCR5380_map_config, do_NCR5380_intr, do_t128_intr and do_pas16_intr
are unused. NCR_NOT_SET harms readability. Remove them.

Signed-off-by: Finn Thain 

---
  drivers/scsi/NCR5380.h   |3 ---
  drivers/scsi/g_NCR5380.c |   29 ++---
  drivers/scsi/g_NCR5380.h |5 -
  drivers/scsi/pas16.c |   16 
  drivers/scsi/pas16.h |5 -
  drivers/scsi/t128.h  |4 
  6 files changed, 14 insertions(+), 48 deletions(-)


Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
--
Dr. Hannes ReineckezSeries & Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/71] ncr5380: Remove more pointless macros

2015-11-18 Thread Finn Thain
ASM macro is never defined. rtrc in pas16.c is not used.
NCR5380_map_config, do_NCR5380_intr, do_t128_intr and do_pas16_intr
are unused. NCR_NOT_SET harms readability. Remove them.

Signed-off-by: Finn Thain 

---
 drivers/scsi/NCR5380.h   |3 ---
 drivers/scsi/g_NCR5380.c |   29 ++---
 drivers/scsi/g_NCR5380.h |5 -
 drivers/scsi/pas16.c |   16 
 drivers/scsi/pas16.h |5 -
 drivers/scsi/t128.h  |4 
 6 files changed, 14 insertions(+), 48 deletions(-)

Index: linux/drivers/scsi/NCR5380.h
===
--- linux.orig/drivers/scsi/NCR5380.h   2015-11-18 19:25:56.0 +1100
+++ linux/drivers/scsi/NCR5380.h2015-11-18 19:33:04.0 +1100
@@ -244,8 +244,6 @@
 #define FLAG_LATE_DMA_SETUP32  /* Setup NCR before DMA H/W */
 #define FLAG_TAGGED_QUEUING64  /* as X3T9.2 spelled it */
 
-#ifndef ASM
-
 #ifdef SUPPORT_TAGS
 struct tag_alloc {
DECLARE_BITMAP(allocated, MAX_TAGS);
@@ -443,5 +441,4 @@ static __inline__ int NCR5380_pc_dma_res
 #endif /* defined(i386) || defined(__alpha__) */
 #endif /* defined(REAL_DMA)  */
 #endif /* __KERNEL__ */
-#endif /* ndef ASM */
 #endif /* NCR5380_H */
Index: linux/drivers/scsi/g_NCR5380.c
===
--- linux.orig/drivers/scsi/g_NCR5380.c 2015-11-18 19:32:59.0 +1100
+++ linux/drivers/scsi/g_NCR5380.c  2015-11-18 19:33:04.0 +1100
@@ -82,14 +82,13 @@
 #include 
 #include 
 
-#define NCR_NOT_SET 0
-static int ncr_irq = NCR_NOT_SET;
-static int ncr_dma = NCR_NOT_SET;
-static int ncr_addr = NCR_NOT_SET;
-static int ncr_5380 = NCR_NOT_SET;
-static int ncr_53c400 = NCR_NOT_SET;
-static int ncr_53c400a = NCR_NOT_SET;
-static int dtc_3181e = NCR_NOT_SET;
+static int ncr_irq;
+static int ncr_dma;
+static int ncr_addr;
+static int ncr_5380;
+static int ncr_53c400;
+static int ncr_53c400a;
+static int dtc_3181e;
 
 static struct override {
NCR5380_map_type NCR5380_map_name;
@@ -271,19 +270,19 @@ static int __init generic_NCR5380_detect
void __iomem *iomem;
 #endif
 
-   if (ncr_irq != NCR_NOT_SET)
+   if (ncr_irq)
overrides[0].irq = ncr_irq;
-   if (ncr_dma != NCR_NOT_SET)
+   if (ncr_dma)
overrides[0].dma = ncr_dma;
-   if (ncr_addr != NCR_NOT_SET)
+   if (ncr_addr)
overrides[0].NCR5380_map_name = (NCR5380_map_type) ncr_addr;
-   if (ncr_5380 != NCR_NOT_SET)
+   if (ncr_5380)
overrides[0].board = BOARD_NCR5380;
-   else if (ncr_53c400 != NCR_NOT_SET)
+   else if (ncr_53c400)
overrides[0].board = BOARD_NCR53C400;
-   else if (ncr_53c400a != NCR_NOT_SET)
+   else if (ncr_53c400a)
overrides[0].board = BOARD_NCR53C400A;
-   else if (dtc_3181e != NCR_NOT_SET)
+   else if (dtc_3181e)
overrides[0].board = BOARD_DTC3181E;
 #ifndef SCSI_G_NCR5380_MEM
if (!current_override && isapnp_present()) {
Index: linux/drivers/scsi/g_NCR5380.h
===
--- linux.orig/drivers/scsi/g_NCR5380.h 2015-11-18 19:25:56.0 +1100
+++ linux/drivers/scsi/g_NCR5380.h  2015-11-18 19:33:04.0 +1100
@@ -21,8 +21,6 @@
 #define NCR5380_BIOSPARAM NULL
 #endif
 
-#ifndef ASM
-
 #ifndef CMD_PER_LUN
 #define CMD_PER_LUN 2
 #endif
@@ -36,7 +34,6 @@
 
 #ifndef SCSI_G_NCR5380_MEM
 
-#define NCR5380_map_config port
 #define NCR5380_map_type int
 #define NCR5380_map_name port
 #define NCR5380_instance_name io_port
@@ -64,7 +61,6 @@
 #else 
 /* therefore SCSI_G_NCR5380_MEM */
 
-#define NCR5380_map_config memory
 #define NCR5380_map_type unsigned long
 #define NCR5380_map_name base
 #define NCR5380_instance_name base
@@ -103,6 +99,5 @@
 #define BOARD_NCR53C400A 2
 #define BOARD_DTC3181E 3
 
-#endif /* ndef ASM */
 #endif /* GENERIC_NCR5380_H */
 
Index: linux/drivers/scsi/pas16.c
===
--- linux.orig/drivers/scsi/pas16.c 2015-11-18 19:33:02.0 +1100
+++ linux/drivers/scsi/pas16.c  2015-11-18 19:33:04.0 +1100
@@ -145,22 +145,6 @@ static const unsigned short  pas16_offse
* START_DMA_INITIATOR_RECEIVE_REG wo
*/
 };
-/**/
-/* the following will set the monitor border color (useful to find
- where something crashed or gets stuck at */
-/* 1 = blue
- 2 = green
- 3 = cyan
- 4 = red
- 5 = magenta
- 6 = yellow
- 7 = white
-*/
-#if 1
-#define rtrc(i) {inb(0x3da); outb(0x31, 0x3c0); outb((i), 0x3c0);}
-#else
-#define rtrc(i) {}
-#endif
 
 
 /*
Index: linux/drivers/scsi/pas16.h
===