All of lore.kernel.org
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Michael Schmitz <schmitzmic@gmail.com>,
	Sam Creasey <sammy@sammy.net>,
	linux-scsi@vger.kernel.org, linux-m68k@vger.kernel.org
Subject: [PATCH 06/29] ncr5380: Remove more useless prototypes
Date: Thu, 02 Oct 2014 16:56:34 +1000	[thread overview]
Message-ID: <20141002065629.696175008@telegraphics.com.au> (raw)
In-Reply-To: 20141002065628.256592712@telegraphics.com.au

[-- Attachment #1: ncr5380-remove-more-useless-prototypes --]
[-- Type: text/plain, Size: 8672 bytes --]

Make use of the host template static initializer instead of assigning
handlers at run-time. Move __maybe_unused qualifiers from declarations
to definitions. Move the atari_scsi_bus_reset() wrapper after the
definition of NCR5380_bus_reset(). All of the host template handler
prototypes are now redundant so remove them.

The write_info() handler is only relevant to drivers using PSEUDO_DMA so
this patch fixes the compiler warning in atari_NCR5380.c and sun3_NCR5380.c:

  CC      drivers/scsi/atari_scsi.o
  drivers/scsi/NCR5380.h:329: warning: 'NCR5380_write_info' declared 'static' but never defined

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

---
 drivers/scsi/NCR5380.h       |    8 ----
 drivers/scsi/atari_NCR5380.c |    3 +
 drivers/scsi/atari_scsi.c    |   76 ++++++++++++++++++++-----------------------
 drivers/scsi/dtc.c           |    7 +--
 drivers/scsi/pas16.c         |    7 +--
 drivers/scsi/sun3_NCR5380.c  |    3 +
 drivers/scsi/t128.c          |    7 +--
 7 files changed, 50 insertions(+), 61 deletions(-)

Index: linux/drivers/scsi/NCR5380.h
===================================================================
--- linux.orig/drivers/scsi/NCR5380.h	2014-10-02 16:55:49.000000000 +1000
+++ linux/drivers/scsi/NCR5380.h	2014-10-02 16:55:55.000000000 +1000
@@ -322,14 +322,6 @@ static irqreturn_t NCR5380_intr(int irq,
 #endif
 static void NCR5380_main(struct work_struct *work);
 static void __maybe_unused NCR5380_print_options(struct Scsi_Host *instance);
-static int NCR5380_abort(Scsi_Cmnd * cmd);
-static int NCR5380_bus_reset(Scsi_Cmnd * cmd);
-static int NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *);
-static int __maybe_unused NCR5380_show_info(struct seq_file *,
-	struct Scsi_Host *);
-static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance,
-	char *buffer, int length);
-
 static void NCR5380_reselect(struct Scsi_Host *instance);
 static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag);
 #if defined(PSEUDO_DMA) || defined(REAL_DMA) || defined(REAL_DMA_POLL)
Index: linux/drivers/scsi/dtc.c
===================================================================
--- linux.orig/drivers/scsi/dtc.c	2014-10-02 16:55:51.000000000 +1000
+++ linux/drivers/scsi/dtc.c	2014-10-02 16:55:55.000000000 +1000
@@ -219,10 +219,6 @@ static int __init dtc_detect(struct scsi
 	void __iomem *base;
 	int sig, count;
 
-	tpnt->proc_name = "dtc3x80";
-	tpnt->show_info = dtc_show_info;
-	tpnt->write_info = dtc_write_info;
-
 	for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
 		addr = 0;
 		base = NULL;
@@ -477,6 +473,9 @@ static struct scsi_host_template driver_
 	.name				= "DTC 3180/3280 ",
 	.detect				= dtc_detect,
 	.release			= dtc_release,
+	.proc_name			= "dtc3x80",
+	.show_info			= dtc_show_info,
+	.write_info			= dtc_write_info,
 	.queuecommand			= dtc_queue_command,
 	.eh_abort_handler		= dtc_abort,
 	.eh_bus_reset_handler		= dtc_bus_reset,
Index: linux/drivers/scsi/pas16.c
===================================================================
--- linux.orig/drivers/scsi/pas16.c	2014-10-02 16:55:53.000000000 +1000
+++ linux/drivers/scsi/pas16.c	2014-10-02 16:55:55.000000000 +1000
@@ -390,10 +390,6 @@ static int __init pas16_detect(struct sc
     unsigned short io_port;
     int  count;
 
-    tpnt->proc_name = "pas16";
-    tpnt->show_info = pas16_show_info;
-    tpnt->write_info = pas16_write_info;
-
     if (pas16_addr != 0) {
 	overrides[0].io_port = pas16_addr;
 	/*
@@ -622,6 +618,9 @@ static struct scsi_host_template driver_
 	.name           = "Pro Audio Spectrum-16 SCSI",
 	.detect         = pas16_detect,
 	.release        = pas16_release,
+	.proc_name      = "pas16",
+	.show_info      = pas16_show_info,
+	.write_info     = pas16_write_info,
 	.queuecommand   = pas16_queue_command,
 	.eh_abort_handler = pas16_abort,
 	.eh_bus_reset_handler = pas16_bus_reset,
Index: linux/drivers/scsi/t128.c
===================================================================
--- linux.orig/drivers/scsi/t128.c	2014-10-02 16:55:53.000000000 +1000
+++ linux/drivers/scsi/t128.c	2014-10-02 16:55:55.000000000 +1000
@@ -201,10 +201,6 @@ static int __init t128_detect(struct scs
     void __iomem *p;
     int sig, count;
 
-    tpnt->proc_name = "t128";
-    tpnt->show_info = t128_show_info;
-    tpnt->write_info = t128_write_info;
-
     for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
 	base = 0;
 	p = NULL;
@@ -435,6 +431,9 @@ static struct scsi_host_template driver_
 	.name           = "Trantor T128/T128F/T228",
 	.detect         = t128_detect,
 	.release        = t128_release,
+	.proc_name      = "t128",
+	.show_info      = t128_show_info,
+	.write_info     = t128_write_info,
 	.queuecommand   = t128_queue_command,
 	.eh_abort_handler = t128_abort,
 	.eh_bus_reset_handler    = t128_bus_reset,
Index: linux/drivers/scsi/atari_NCR5380.c
===================================================================
--- linux.orig/drivers/scsi/atari_NCR5380.c	2014-10-02 16:55:28.000000000 +1000
+++ linux/drivers/scsi/atari_NCR5380.c	2014-10-02 16:55:55.000000000 +1000
@@ -769,7 +769,8 @@ static void show_Scsi_Cmnd(Scsi_Cmnd *cm
 	seq_printf(m, "\n");
 }
 
-static int NCR5380_show_info(struct seq_file *m, struct Scsi_Host *instance)
+static int __maybe_unused NCR5380_show_info(struct seq_file *m,
+                                            struct Scsi_Host *instance)
 {
 	struct NCR5380_hostdata *hostdata;
 	Scsi_Cmnd *ptr;
Index: linux/drivers/scsi/sun3_NCR5380.c
===================================================================
--- linux.orig/drivers/scsi/sun3_NCR5380.c	2014-10-02 16:55:28.000000000 +1000
+++ linux/drivers/scsi/sun3_NCR5380.c	2014-10-02 16:55:55.000000000 +1000
@@ -715,7 +715,8 @@ static void show_Scsi_Cmnd(Scsi_Cmnd *cm
 	seq_printf(m, "\n");
 }
 
-static int NCR5380_show_info(struct seq_file *m, struct Scsi_Host *instance)
+static int __maybe_unused NCR5380_show_info(struct seq_file *m,
+                                            struct Scsi_Host *instance)
 {
 	struct NCR5380_hostdata *hostdata;
 	Scsi_Cmnd *ptr;
Index: linux/drivers/scsi/atari_scsi.c
===================================================================
--- linux.orig/drivers/scsi/atari_scsi.c	2014-10-02 16:55:53.000000000 +1000
+++ linux/drivers/scsi/atari_scsi.c	2014-10-02 16:55:55.000000000 +1000
@@ -783,45 +783,6 @@ static int __init atari_scsi_setup(char
 __setup("atascsi=", atari_scsi_setup);
 #endif /* !MODULE */
 
-static int atari_scsi_bus_reset(Scsi_Cmnd *cmd)
-{
-	int rv;
-	struct NCR5380_hostdata *hostdata =
-		(struct NCR5380_hostdata *)cmd->device->host->hostdata;
-
-	/* For doing the reset, SCSI interrupts must be disabled first,
-	 * since the 5380 raises its IRQ line while _RST is active and we
-	 * can't disable interrupts completely, since we need the timer.
-	 */
-	/* And abort a maybe active DMA transfer */
-	if (IS_A_TT()) {
-		atari_turnoff_irq(IRQ_TT_MFP_SCSI);
-#ifdef REAL_DMA
-		tt_scsi_dma.dma_ctrl = 0;
-#endif /* REAL_DMA */
-	} else {
-		atari_turnoff_irq(IRQ_MFP_FSCSI);
-#ifdef REAL_DMA
-		st_dma.dma_mode_status = 0x90;
-		atari_dma_active = 0;
-		atari_dma_orig_addr = NULL;
-#endif /* REAL_DMA */
-	}
-
-	rv = NCR5380_bus_reset(cmd);
-
-	/* Re-enable ints */
-	if (IS_A_TT()) {
-		atari_turnon_irq(IRQ_TT_MFP_SCSI);
-	} else {
-		atari_turnon_irq(IRQ_MFP_FSCSI);
-	}
-	if (rv == SUCCESS)
-		falcon_release_lock_if_possible(hostdata);
-
-	return rv;
-}
-
 
 #ifdef CONFIG_ATARI_SCSI_RESET_BOOT
 static void __init atari_scsi_reset_boot(void)
@@ -1094,6 +1055,43 @@ static void atari_scsi_falcon_reg_write(
 
 #include "atari_NCR5380.c"
 
+static int atari_scsi_bus_reset(struct scsi_cmnd *cmd)
+{
+	int rv;
+	struct NCR5380_hostdata *hostdata = shost_priv(cmd->device->host);
+
+	/* For doing the reset, SCSI interrupts must be disabled first,
+	 * since the 5380 raises its IRQ line while _RST is active and we
+	 * can't disable interrupts completely, since we need the timer.
+	 */
+	/* And abort a maybe active DMA transfer */
+	if (IS_A_TT()) {
+		atari_turnoff_irq(IRQ_TT_MFP_SCSI);
+#ifdef REAL_DMA
+		tt_scsi_dma.dma_ctrl = 0;
+#endif
+	} else {
+		atari_turnoff_irq(IRQ_MFP_FSCSI);
+#ifdef REAL_DMA
+		st_dma.dma_mode_status = 0x90;
+		atari_dma_active = 0;
+		atari_dma_orig_addr = NULL;
+#endif
+	}
+
+	rv = NCR5380_bus_reset(cmd);
+
+	if (IS_A_TT())
+		atari_turnon_irq(IRQ_TT_MFP_SCSI);
+	else
+		atari_turnon_irq(IRQ_MFP_FSCSI);
+
+	if (rv == SUCCESS)
+		falcon_release_lock_if_possible(hostdata);
+
+	return rv;
+}
+
 static struct scsi_host_template driver_template = {
 	.show_info		= atari_scsi_show_info,
 	.name			= "Atari native SCSI",



  parent reply	other threads:[~2014-10-02  6:56 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02  6:56 [PATCH 00/29] Fixes, cleanups and modernization for NCR5380 drivers Finn Thain
2014-10-02  6:56 ` [PATCH 01/29] ncr5380: Use printk() not pr_debug() Finn Thain
2014-10-06  9:11   ` Hannes Reinecke
2014-10-02  6:56 ` [PATCH 02/29] ncr5380: Remove unused hostdata fields Finn Thain
2014-10-06  9:12   ` Hannes Reinecke
2014-10-02  6:56 ` [PATCH 03/29] ncr5380: Fix compiler warnings and __setup options Finn Thain
2014-10-06  9:19   ` Hannes Reinecke
2014-10-02  6:56 ` [PATCH 04/29] ncr5380: Remove unused macros Finn Thain
2014-10-02  6:56   ` Finn Thain
2014-10-06  9:21   ` Hannes Reinecke
2014-10-06  9:21     ` Hannes Reinecke
2014-10-02  6:56 ` [PATCH 05/29] ncr5380: Remove useless prototypes Finn Thain
2014-10-02  6:56 ` Finn Thain [this message]
2014-10-02  6:56 ` [PATCH 07/29] ncr5380: Cleanup TAG_NEXT and TAG_NONE macros Finn Thain
2014-10-03  8:09   ` Geert Uytterhoeven
2014-10-03 10:12     ` Finn Thain
2014-10-06  9:19   ` Hannes Reinecke
2014-10-06 12:26     ` Finn Thain
2014-10-02  6:56 ` [PATCH 08/29] ncr5380: Remove redundant AUTOSENSE macro Finn Thain
2014-10-02  6:56   ` Finn Thain
2014-10-02  6:56 ` [PATCH 09/29] ncr5380: Remove duplicate comments Finn Thain
2014-10-02  6:56 ` [PATCH 10/29] ncr5380: Fix SCSI_IRQ_NONE bugs Finn Thain
2014-10-03  8:22   ` Geert Uytterhoeven
2014-10-03 10:42     ` Finn Thain
2014-10-02  6:56 ` [PATCH 11/29] ncr5380: Remove NCR5380_STATS Finn Thain
2014-10-02  6:56 ` [PATCH 12/29] ncr5380: Cleanup host info() methods Finn Thain
2014-10-02  6:56   ` Finn Thain
2014-10-03  8:32   ` Geert Uytterhoeven
2014-10-03  8:32     ` Geert Uytterhoeven
2014-10-02  6:56 ` [PATCH 13/29] ncr5380: Move static PDMA spin counters to host data Finn Thain
2014-10-02  6:56   ` Finn Thain
2014-10-02  6:56 ` [PATCH 14/29] ncr5380: Remove pointless compiler command line override macros Finn Thain
2014-10-02  6:56 ` [PATCH 15/29] ncr5380: Remove *_RELEASE macros Finn Thain
2014-10-02  6:56   ` Finn Thain
2014-10-02  6:56 ` [PATCH 16/29] ncr5380: Drop legacy scsi.h include Finn Thain
2014-10-02  6:56   ` Finn Thain
2014-10-02  6:56 ` [PATCH 17/29] dmx3191d: Use IRQ_NONE Finn Thain
2014-10-03  8:41   ` Geert Uytterhoeven
2014-10-02  6:56 ` [PATCH 18/29] mac_scsi: Remove header Finn Thain
2014-10-02  6:56 ` [PATCH 19/29] mac_scsi: Add module option to Kconfig Finn Thain
2014-10-03  8:44   ` Geert Uytterhoeven
2014-10-03 10:49     ` Finn Thain
2014-10-03 11:31       ` Geert Uytterhoeven
2014-10-02  6:56 ` [PATCH 20/29] mac_scsi: Cleanup PDMA code Finn Thain
2014-10-02  6:56 ` [PATCH 21/29] mac_scsi: Convert to platform device Finn Thain
2014-10-03  9:08   ` Geert Uytterhoeven
2014-10-02  6:56 ` [PATCH 22/29] atari_scsi: Fix atari_scsi deadlocks on Falcon Finn Thain
2014-10-03  9:19   ` Geert Uytterhoeven
2014-10-02  6:56 ` [PATCH 23/29] atari_scsi: Convert to platform device Finn Thain
2014-10-03  9:34   ` Geert Uytterhoeven
2014-10-03 11:10     ` Finn Thain
2014-10-04 23:43       ` Michael Schmitz
2014-10-06  7:05         ` Finn Thain
2014-10-06  8:14           ` Michael Schmitz
2014-10-08 11:59             ` Finn Thain
2014-10-06  8:36           ` Geert Uytterhoeven
2014-10-20  7:33   ` Michael Schmitz
2014-10-20 11:22     ` Finn Thain
2014-10-20 18:34       ` Michael Schmitz
2014-10-26  7:37       ` Michael Schmitz
2014-10-27  0:15         ` Finn Thain
2014-10-02  6:56 ` [PATCH 24/29] atari_scsi: Remove header Finn Thain
2014-10-02  6:56 ` [PATCH 25/29] sun3_scsi: Convert to platform device Finn Thain
2014-10-02  6:56 ` [PATCH 26/29] sun3_scsi: Move macro definitions Finn Thain
2014-10-02  6:56 ` [PATCH 27/29] ncr5380: Remove ENABLE_IRQ/DISABLE_IRQ macros Finn Thain
2014-10-02  6:56 ` [PATCH 28/29] atari_NCR5380: Refactor Falcon special cases Finn Thain
2014-10-06  9:28   ` Hannes Reinecke
2014-10-06 11:34     ` Finn Thain
2014-10-06 13:41       ` Ondrej Zary
2014-10-02  6:56 ` [PATCH 29/29] atari_NCR5380: Refactor Falcon locking Finn Thain

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=20141002065629.696175008@telegraphics.com.au \
    --to=fthain@telegraphics.com.au \
    --cc=JBottomley@parallels.com \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sammy@sammy.net \
    --cc=schmitzmic@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.