Re: [PATCH v2 20/36] mac_scsi: Cleanup PDMA code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/30/2014 08:46 AM, Hannes Reinecke wrote:
> On 10/27/2014 06:26 AM, Finn Thain wrote:
>> Fix whitespace, remove pointless volatile qualifiers and improve code style
>> by use of INPUT_DATA_REG and OUTPUT_DATA_REG macros.
>>
>> Signed-off-by: Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx>
>>
>> ---
>>  drivers/scsi/mac_scsi.c |  122 ++++++++++++++++++++++++------------------------
>>  1 file changed, 62 insertions(+), 60 deletions(-)
>>
>> Index: linux/drivers/scsi/mac_scsi.c
>> ===================================================================
>> --- linux.orig/drivers/scsi/mac_scsi.c	2014-10-27 16:25:42.000000000 +1100
>> +++ linux/drivers/scsi/mac_scsi.c	2014-10-27 16:25:43.000000000 +1100
>> @@ -86,9 +86,9 @@ module_param(setup_hostid, int, 0);
>>  #define	AFTER_RESET_DELAY	(HZ/2)
>>  #endif
>>  
>> -static volatile unsigned char *mac_scsi_regp = NULL;
>> -static volatile unsigned char *mac_scsi_drq  = NULL;
>> -static volatile unsigned char *mac_scsi_nodrq = NULL;
>> +static unsigned char *mac_scsi_regp;
>> +static unsigned char *mac_scsi_drq;
>> +static unsigned char *mac_scsi_nodrq;
>>  
>>  
>>  /*
>> @@ -262,6 +262,7 @@ static void mac_scsi_reset_boot(struct S
>>  }
>>  #endif
>>  
>> +#ifdef PSEUDO_DMA
>>  /* 
>>     Pseudo-DMA: (Ove Edlund)
>>     The code attempts to catch bus errors that occur if one for example
>> @@ -331,38 +332,38 @@ __asm__ __volatile__					\
>>       : "0"(s), "1"(d), "2"(len)				\
>>       : "d0")
>>  
>> -
>> -static int macscsi_pread (struct Scsi_Host *instance,
>> -			  unsigned char *dst, int len)
>> +static int macscsi_pread(struct Scsi_Host *instance,
>> +                         unsigned char *dst, int len)
>>  {
>> -   unsigned char *d;
>> -   volatile unsigned char *s;
>> +	unsigned char *d;
>> +	unsigned char *s;
>> +
>> +	NCR5380_local_declare();
>> +	NCR5380_setup(instance);
>> +
>> +	s = mac_scsi_drq + (INPUT_DATA_REG << 4);
>> +	d = dst;
>>  
>> -   NCR5380_local_declare();
>> -   NCR5380_setup(instance);
>> +	/* These conditions are derived from MacOS */
>>  
>> -   s = mac_scsi_drq+0x60;
>> -   d = dst;
>> +	while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) &&
>> +	       !(NCR5380_read(STATUS_REG) & SR_REQ))
>> +		;
>> +
>> +	if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) &&
>> +	    (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)) {
>> +		pr_err("Error in macscsi_pread\n");
>> +		return -1;
>> +	}
>>  
>> -/* These conditions are derived from MacOS */
>> -
>> -   while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) 
>> -         && !(NCR5380_read(STATUS_REG) & SR_REQ))
>> -      ;
>> -   if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) 
>> -         && (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)) {
>> -      printk(KERN_ERR "Error in macscsi_pread\n");
>> -      return -1;
>> -   }
>> -
>> -   CP_IO_TO_MEM(s, d, len);
>> -   
>> -   if (len != 0) {
>> -      printk(KERN_NOTICE "Bus error in macscsi_pread\n");
>> -      return -1;
>> -   }
>> -   
>> -   return 0;
>> +	CP_IO_TO_MEM(s, d, len);
>> +
>> +	if (len != 0) {
>> +		pr_notice("Bus error in macscsi_pread\n");
>> +		return -1;
>> +	}
>> +
>> +	return 0;
>>  }
>>  
>>  
>> @@ -424,39 +425,40 @@ __asm__ __volatile__					\
>>       : "0"(s), "1"(d), "2"(len)				\
>>       : "d0")
>>  
>> -static int macscsi_pwrite (struct Scsi_Host *instance,
>> -				  unsigned char *src, int len)
>> +static int macscsi_pwrite(struct Scsi_Host *instance,
>> +                          unsigned char *src, int len)
>>  {
>> -   unsigned char *s;
>> -   volatile unsigned char *d;
>> +	unsigned char *s;
>> +	unsigned char *d;
>> +
>> +	NCR5380_local_declare();
>> +	NCR5380_setup(instance);
>>  
>> -   NCR5380_local_declare();
>> -   NCR5380_setup(instance);
>> +	s = src;
>> +	d = mac_scsi_drq + (OUTPUT_DATA_REG << 4);
>>  
>> -   s = src;
>> -   d = mac_scsi_drq;
>> -   
>> -/* These conditions are derived from MacOS */
>> -
>> -   while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) 
>> -         && (!(NCR5380_read(STATUS_REG) & SR_REQ) 
>> -            || (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH))) 
>> -      ;
>> -   if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ)) {
>> -      printk(KERN_ERR "Error in macscsi_pwrite\n");
>> -      return -1;
>> -   }
>> -
>> -   CP_MEM_TO_IO(s, d, len);   
>> -
>> -   if (len != 0) {
>> -      printk(KERN_NOTICE "Bus error in macscsi_pwrite\n");
>> -      return -1;
>> -   }
>> -   
>> -   return 0;
>> -}
>> +	/* These conditions are derived from MacOS */
>> +
>> +	while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) &&
>> +	       (!(NCR5380_read(STATUS_REG) & SR_REQ) ||
>> +	        (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)))
>> +		;
>> +
>> +	if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ)) {
>> +		pr_err("Error in macscsi_pwrite\n");
>> +		return -1;
>> +	}
>> +
>> +	CP_MEM_TO_IO(s, d, len);
>>  
>> +	if (len != 0) {
>> +		pr_notice("Bus error in macscsi_pwrite\n");
>> +		return -1;
>> +	}
>> +
>> +	return 0;
>> +}
>> +#endif
>>  
>>  #include "NCR5380.c"
>>  
>>
>>
> Any reason why you didn't re-indent macscsi_indent?
> 
Ahh, forget it.

Addressed with the next patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@xxxxxxx			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux