public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ching <ching2048@areca.com.tw>
Cc: jbottomley@parallels.com, thenzl@redhat.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1.0 7/16] arcmsr: revise message_isr_bh_fn to delete duplicate code
Date: Fri, 2 May 2014 11:49:39 +0300	[thread overview]
Message-ID: <20140502084939.GD4963@mwanda> (raw)
In-Reply-To: <1398855757.6930.25.camel@localhost>

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


      reply	other threads:[~2014-05-02  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 11:02 [PATCH v1.0 7/16] arcmsr: revise message_isr_bh_fn to delete duplicate code ching
2014-05-02  8:49 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140502084939.GD4963@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ching2048@areca.com.tw \
    --cc=jbottomley@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=thenzl@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox