Re: [PATCH] SCSI NCR53C9x.c: some cleanups

From: Geert Uytterhoeven
Date: Mon Jan 17 2005 - 14:51:26 EST


On Mon, 17 Jan 2005, Geert Uytterhoeven wrote:
> On Mon, 17 Jan 2005, Adrian Bunk wrote:
> > On Mon, Jan 17, 2005 at 01:41:29PM +0100, Geert Uytterhoeven wrote:
> > > On Tue, 21 Dec 2004, Linux Kernel Mailing List wrote:
> > > > ChangeSet 1.2034.61.36, 2004/12/21 09:41:18-06:00, bunk@xxxxxxxxx
> > > >
> > > > [PATCH] SCSI NCR53C9x.c: some cleanups
> > > >
> > > > Make two functions static
> > >
> > > > --- a/drivers/scsi/NCR53C9x.c 2004-12-28 23:32:55 -08:00
> > > > +++ b/drivers/scsi/NCR53C9x.c 2004-12-28 23:32:55 -08:00
> > > > @@ -505,7 +505,7 @@
> > > > }
> > > >
> > > > /* This places the ESP into a known state at boot time. */
> > > > -void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs)
> > > > +static void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs)
> > > > {
> > > > volatile unchar trash;
> > > >
> > >
> > > This change breaks the Amiga Oktagon SCSI driver (drivers/scsi/oktagon_esp.c),
> > > which calls esp_bootup_reset().
> >
> > My bad - I did grep for esp_bootup_reset, but I confused the function
> > prototype in oktagon_esp.c with a local function in this file.
> >
> > @Linus:
> > Please exclude my buggy patch.
>
> Or better: I'll move the prototype to drivers/scsi/NCR53C9x.h.

So here it is. I also stumbled upon esp_cmd(), which is a macro in the
common (non-debug) case and definitily not meant to be global.

Changelog:
- Make esp_bootup_reset() global again, since the Amiga Oktagon SCSI driver
needs it, and move its prototype from oktagon_esp.c to NCR53C9x.h
- Make esp_cmd() static in the debug case. It's already a local macro in the
non-debug case.

Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

--- linux-2.6.11-rc1/drivers/scsi/NCR53C9x.c 2005-01-12 10:29:30.000000000 +0100
+++ linux-m68k-2.6.11-rc1/drivers/scsi/NCR53C9x.c 2005-01-17 20:29:36.000000000 +0100
@@ -290,7 +290,7 @@
#endif

#ifdef DEBUG_ESP_CMDS
-inline void esp_cmd(struct NCR_ESP *esp, struct ESP_regs *eregs,
+static inline void esp_cmd(struct NCR_ESP *esp, struct ESP_regs *eregs,
unchar cmd)
{
esp->espcmdlog[esp->espcmdent] = cmd;
@@ -505,7 +505,7 @@
}

/* This places the ESP into a known state at boot time. */
-static void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs)
+void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs)
{
volatile unchar trash;

--- linux-2.6.11-rc1/drivers/scsi/NCR53C9x.h 2005-01-12 10:29:30.000000000 +0100
+++ linux-m68k-2.6.11-rc1/drivers/scsi/NCR53C9x.h 2005-01-17 14:30:46.000000000 +0100
@@ -652,7 +652,7 @@


/* External functions */
-extern void esp_cmd(struct NCR_ESP *esp, struct ESP_regs *eregs, unchar cmd);
+extern void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs);
extern struct NCR_ESP *esp_allocate(Scsi_Host_Template *, void *);
extern void esp_deallocate(struct NCR_ESP *);
extern void esp_release(void);
--- linux-2.6.11-rc1/drivers/scsi/oktagon_esp.c 2004-07-12 09:48:12.000000000 +0200
+++ linux-m68k-2.6.11-rc1/drivers/scsi/oktagon_esp.c 2005-01-17 14:28:33.000000000 +0100
@@ -72,8 +72,6 @@
static void dma_advance_sg(Scsi_Cmnd *);
static int oktagon_notify_reboot(struct notifier_block *this, unsigned long code, void *x);

-void esp_bootup_reset(struct NCR_ESP *esp,struct ESP_regs *eregs);
-
#ifdef USE_BOTTOM_HALF
static void dma_commit(void *opaque);


Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/