Re: [PATCH v1.0 7/16] arcmsr: revise message_isr_bh_fn to delete duplicate code

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

 



On Wed, Apr 30, 2014 at 07:02:37PM +0800, ching wrote:
> +	}
> +	atomic_inc(&acb->rq_map_token);

This patch is a nice cleanup but it would be even better if you flipped
this condition around.

> +	if (readl(signature) == ARCMSR_SIGNATURE_GET_CONFIG) {

	if (readl(signature) != ARCMSR_SIGNATURE_GET_CONFIG)
		return;

> +		for (target = 0; target < ARCMSR_MAX_TARGETID - 1;
> +			target++) {
> +			temp = readb(devicemap);
> +			diff = (*acb_dev_map) ^ temp;
> +			if (diff != 0) {
> +				*acb_dev_map = temp;
> +				for (lun = 0; lun < ARCMSR_MAX_TARGETLUN;
> +					lun++) {
> +					if ((diff & 0x01) == 1 &&
> +						(temp & 0x01) == 1) {
> +						scsi_add_device(acb->host,
> +							0, target, lun);
> +					} else if ((diff & 0x01) == 1
> +						&& (temp & 0x01) == 0) {
> +						psdev =
> +							scsi_device_lookup(acb->host,
> +							0, target, lun);

The whitespace is weird here.  Do:

					psdev = scsi_device_lookup(acb->host,
							0, target, lun);

> +						if (psdev != NULL) {
> +							scsi_remove_device(psdev);
> +							scsi_device_put(psdev);
>  						}
>  					}
> -					devicemap++;
> -					acb_dev_map++;
> +					temp >>= 1;
> +					diff >>= 1;
>  				}
>  			}
> +			devicemap++;
> +			acb_dev_map++;
>  		}

regards,
dan carpenter

--
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