linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: "Ewan D. Milne" <emilne@redhat.com>, linux-scsi@vger.kernel.org
Cc: michael.christie@oracle.com, dgilbert@interlog.com, bvanassche@acm.org
Subject: Re: [PATCH v2 8/9] scsi: Simplify nested if conditional in scsi_probe_lun()
Date: Fri, 15 Aug 2025 11:50:53 +0900	[thread overview]
Message-ID: <6a86060f-a077-4681-9787-679b493b2bb1@kernel.org> (raw)
In-Reply-To: <20250814182907.1501213-9-emilne@redhat.com>

On 8/15/25 03:29, Ewan D. Milne wrote:
> Make code congruent with similar code in read_capacity_16()/read_capacity_10().
> 
> Signed-off-by: Ewan D. Milne <emilne@redhat.com>
> ---
>  drivers/scsi/scsi_scan.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index c754b1d566e0..1346a52f55c4 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -717,14 +717,13 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
>  				"scsi scan: INQUIRY %s with code 0x%x\n",
>  				result ? "failed" : "successful", result));
>  
> -		if (result == 0) {
> +		if ((result == 0) && (resid == try_inquiry_len)) {

No need for the inner parenthesis.

>  			/*
>  			 * if nothing was transferred, we try
>  			 * again. It's a workaround for some USB
>  			 * devices.
>  			 */
> -			if (resid == try_inquiry_len)
> -				continue;
> +			continue;
>  		}
>  		break;
>  	}


-- 
Damien Le Moal
Western Digital Research

  parent reply	other threads:[~2025-08-15  2:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 18:28 [PATCH v2 0/9] Retry READ CAPACITY(10)/(16) with good status but no data Ewan D. Milne
2025-08-14 18:28 ` [PATCH v2 1/9] scsi: Explicitly specify .ascq = 0x00 for ASC 0x28/0x29 scsi_failures Ewan D. Milne
2025-08-14 18:29 ` [PATCH v2 2/9] scsi: sd: Explicitly specify .ascq = SCMD_FAILURE_ASCQ_ANY for ASC 0x3a Ewan D. Milne
2025-08-14 21:24   ` Bart Van Assche
2025-08-15 19:17     ` Ewan Milne
2025-08-14 18:29 ` [PATCH v2 3/9] scsi: sd: Pass buffer length as argument to sd_read_capacity() et al Ewan D. Milne
2025-08-14 21:31   ` Bart Van Assche
2025-08-15  2:43   ` Damien Le Moal
2025-08-15 18:53     ` Ewan Milne
2025-08-14 18:29 ` [PATCH v2 4/9] scsi: sd: Have scsi-ml retry read_capacity_16 errors Ewan D. Milne
2025-08-14 21:33   ` Bart Van Assche
2025-08-14 18:29 ` [PATCH v2 5/9] scsi: sd: Avoid passing potentially uninitialized "sense_valid" to read_capacity_error() Ewan D. Milne
2025-08-14 21:34   ` Bart Van Assche
2025-08-14 18:29 ` [PATCH v2 6/9] scsi: sd: Remove checks for -EOVERFLOW in sd_read_capacity() Ewan D. Milne
2025-08-14 21:36   ` Bart Van Assche
2025-08-14 18:29 ` [PATCH v2 7/9] scsi: sd: Check for and retry in case of READ_CAPCITY(10)/(16) returning no data Ewan D. Milne
2025-08-14 21:37   ` Bart Van Assche
2025-08-15  2:50   ` Damien Le Moal
2025-08-15 18:31     ` Ewan Milne
2025-08-14 18:29 ` [PATCH v2 8/9] scsi: Simplify nested if conditional in scsi_probe_lun() Ewan D. Milne
2025-08-14 21:37   ` Bart Van Assche
2025-08-15  2:50   ` Damien Le Moal [this message]
2025-08-14 18:29 ` [PATCH v2 9/9] scsi: scsi_debug: Add option to suppress returned data but return good status Ewan D. Milne
2025-08-14 21:41   ` Bart Van Assche

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=6a86060f-a077-4681-9787-679b493b2bb1@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=dgilbert@interlog.com \
    --cc=emilne@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michael.christie@oracle.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;
as well as URLs for NNTP newsgroup(s).