Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-17 Thread Finn Thain
On Wed, 17 Oct 2018, Christoph Hellwig wrote: > > Please leave the possibly unused exports as-is. > I take that to mean "leave the conditional export as-is". Hence, I think v3 (posted on the 16th) should address all of the concerns raised by reviewers... --

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-17 Thread Christoph Hellwig
On Tue, Oct 16, 2018 at 04:39:07PM +1100, Finn Thain wrote: > > Perhaps I've misunderstood your concern here. Is it a problem that > esp_scsi.ko may or may not export the function, depending on .config? > > For example, if esp_scsi.ko came from a build with CONFIG_SUN3X_ESP=y && >

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-17 Thread Christoph Hellwig
On Tue, Oct 16, 2018 at 10:52:26AM +1100, Finn Thain wrote: > True enough. We agree that this #ifdef is undesirable. And yet when I > tried it, I found an unexpected readability benefit to your suggestion: > > #ifdef CONFIG_SCSI_ESP_PIO > u8 __iomem *fifo_reg; > int

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-15 Thread Finn Thain
On Mon, 15 Oct 2018, Hannes Reinecke wrote: > > However, the function declaration really is a worry, as the actual function > body only exists when the config option is enabled. > So either add a dummy function or surround the function declaration by > CONFIG_ESP_PIO. > Otherwise I think Dan

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-15 Thread Finn Thain
On Mon, 15 Oct 2018, Hannes Reinecke wrote: > > > > In the case of send_cmd_residual, that would mean a second #ifdef > > added to esp_data_bytes_sent() where it gets used. I'm happy to comply > > but I fear that all these #ifdefs may harm readability... > > > > There are already other

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-15 Thread Christoph Hellwig
On Mon, Oct 15, 2018 at 12:58:42PM +0200, Hannes Reinecke wrote: > However, the function declaration really is a worry, as the actual function > body only exists when the config option is enabled. Having a prototype without an implementation is no problem at all. We have this case all over the

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-15 Thread Hannes Reinecke
On 10/15/18 8:25 AM, Finn Thain wrote: On Mon, 15 Oct 2018, Hannes Reinecke wrote: On 10/14/18 8:12 AM, Finn Thain wrote: As a temporary measure, the code to implement PIO transfers was duplicated in zorro_esp and mac_esp. Now that it has stabilized move the common code into the core driver

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-15 Thread Finn Thain
On Mon, 15 Oct 2018, Hannes Reinecke wrote: > On 10/14/18 8:12 AM, Finn Thain wrote: > > As a temporary measure, the code to implement PIO transfers was > > duplicated in zorro_esp and mac_esp. Now that it has stabilized > > move the common code into the core driver but don't build it unless > >

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-15 Thread Hannes Reinecke
On 10/14/18 8:12 AM, Finn Thain wrote: As a temporary measure, the code to implement PIO transfers was duplicated in zorro_esp and mac_esp. Now that it has stabilized move the common code into the core driver but don't build it unless needed. This replaces the inline assembler with more

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-14 Thread Finn Thain
On Sun, 14 Oct 2018, Geert Uytterhoeven wrote: > > > --- a/drivers/scsi/Kconfig > > +++ b/drivers/scsi/Kconfig > > @@ -42,6 +42,10 @@ config SCSI_DMA > > bool > > default n > > > > +config SCSI_ESP_PIO > > + bool > > + default n > > "default n" is the default, so

Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-14 Thread Geert Uytterhoeven
Hi Finn, On Sun, Oct 14, 2018 at 8:35 AM Finn Thain wrote: > As a temporary measure, the code to implement PIO transfers was > duplicated in zorro_esp and mac_esp. Now that it has stabilized > move the common code into the core driver but don't build it unless > needed. > > This replaces the

[PATCH v2 5/6] esp_scsi: De-duplicate PIO routines

2018-10-14 Thread Finn Thain
As a temporary measure, the code to implement PIO transfers was duplicated in zorro_esp and mac_esp. Now that it has stabilized move the common code into the core driver but don't build it unless needed. This replaces the inline assembler with more portable writesb() calls. Optimizing the m68k