lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140502084939.GD4963@mwanda>
Date:	Fri, 2 May 2014 11:49:39 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	ching <ching2048@...ca.com.tw>
Cc:	jbottomley@...allels.com, thenzl@...hat.com,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1.0 7/16] arcmsr: revise message_isr_bh_fn to delete
 duplicate code

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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ