Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp698457ybh; Tue, 21 Jul 2020 05:58:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJX6mWT/sWnQ8SZUY2U5A3K09GNWiWSjUguEYUHFamV0q+wuQiobeT1AXzN9OFYgvvQ5Va X-Received: by 2002:a17:906:d143:: with SMTP id br3mr24575960ejb.268.1595336320096; Tue, 21 Jul 2020 05:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595336320; cv=none; d=google.com; s=arc-20160816; b=ZMfNgkidsbYvutu+ovRuXDkkcO/AkCa2UnxWMRQ0gQw+fMX4YiUF4tjBq97abLb4It pGhT5H2sv/htcQ5CcEant2fbD+ry9zwIOybpy4FiG1CmFLylvTmnYOak37vFOrLdQc4G 4otMQeyeuhXflJ5iCRKPiCmNFmuythXvmHN6M/gARWX7/HIxEQfdTB6lTinKrvu/T+9k GNaJY8Asqea2AZqX5pnc0ane+XXTi/2scBfyswL/ueJetsY6Cfui5Ue8cus3LOsDfYdo EbPuLF6lmBdy1OE5/lxCzwNYqtlqHSRPcs1JeaGGuEvw7X/D4KpNJOPw8w0/yl5Ew4Q+ Wplg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=gcyS8fcxtufsTHCFEHHMYCv8/G/j17I02uFKGiQeviM=; b=eebXrhbqM8gOGHRVHiTdQjEiKcmN65vu+WZfQPCEU9RSbSuQIgnqLOPOWC8cHjOtFu ddDaSsPxKASvq86A2UtoOinaNTctcFptY9Qw/2PANCbTIfLCXqTmgHrKz8TnwfeLSIcG QmF8S7Svmxz/g+20XV+S9djTXAMaR5GXvtC8CXPpDSfBYtuRsQgWo5SUd4TiZ7Si65iE J85trSv2ftX2AM2S0yUWSmROPRWZkQjgyt0vwkGk+DCAPRdhQnbgcNAQ2DmpNmRr1egi e/d3nbgLA4RRXDsyaD37e0o9mdQnBJ79q4SltG7xQcPqmNWABvhX5AyeqP4BkWJPdmLa oRPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="GOrnW/Tx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn17si11734138ejb.46.2020.07.21.05.58.17; Tue, 21 Jul 2020 05:58:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="GOrnW/Tx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727038AbgGUM4A (ORCPT + 99 others); Tue, 21 Jul 2020 08:56:00 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:60894 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726737AbgGUM4A (ORCPT ); Tue, 21 Jul 2020 08:56:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595336158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gcyS8fcxtufsTHCFEHHMYCv8/G/j17I02uFKGiQeviM=; b=GOrnW/TxaUuXMPXm4Bu/w3aW7jN/NJL7Z1RN7WRybzqiMibkGlQgLVY76BnidgESaGK4jW 8fPzWj7ppc2EUPBEQ1gjq+4G6G9LsWtvmcMVuTabhIFhLovWE7eipYzGPhM3NJyzrm9Vkt NFNKLYXc31z5O3Ud/13nSQ7EPaJF6uU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-469-MY6qAbUXO7O16qVB19jUxQ-1; Tue, 21 Jul 2020 08:55:56 -0400 X-MC-Unique: MY6qAbUXO7O16qVB19jUxQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACA018014D7; Tue, 21 Jul 2020 12:55:53 +0000 (UTC) Received: from fedora-32-enviroment (unknown [10.35.206.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78F657B400; Tue, 21 Jul 2020 12:55:38 +0000 (UTC) Message-ID: <155668af6420a6516ded0e9101e0a47401a928d9.camel@redhat.com> Subject: Re: [PATCH 09/10] block: scsi: sd: use blk_is_valid_logical_block_size From: Maxim Levitsky To: Damien Le Moal , "linux-kernel@vger.kernel.org" Cc: Keith Busch , Josef Bacik , "open list:BLOCK LAYER" , Sagi Grimberg , Jens Axboe , "open list:NVM EXPRESS DRIVER" , "open list:SCSI CDROM DRIVER" , Tejun Heo , Bart Van Assche , "Martin K. Petersen" , Jason Wang , Maxim Levitsky , Stefan Hajnoczi , Colin Ian King , "Michael S. Tsirkin" , Paolo Bonzini , Ulf Hansson , Ajay Joshi , Ming Lei , "open list:SONY MEMORYSTICK SUBSYSTEM" , Christoph Hellwig , Satya Tangirala , "open list:NETWORK BLOCK DEVICE (NBD)" , Hou Tao , Jens Axboe , "open list:VIRTIO CORE AND NET DRIVERS" , "James E.J. Bottomley" , Alex Dubov Date: Tue, 21 Jul 2020 15:55:37 +0300 In-Reply-To: References: <20200721105239.8270-1-mlevitsk@redhat.com> <20200721105239.8270-10-mlevitsk@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.2 (3.36.2-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-07-21 at 11:25 +0000, Damien Le Moal wrote: > On 2020/07/21 19:55, Maxim Levitsky wrote: > > Use blk_is_valid_logical_block_size instead of hardcoded list > > s/hardcoded list/hardcoded checks./ Done, thanks! Best regards, Maxim Levitsky > > > Signed-off-by: Maxim Levitsky > > --- > > drivers/scsi/sd.c | 5 +---- > > 1 file changed, 1 insertion(+), 4 deletions(-) > > > > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c > > index d90fefffe31b7..f012e7397b058 100644 > > --- a/drivers/scsi/sd.c > > +++ b/drivers/scsi/sd.c > > @@ -2520,10 +2520,7 @@ sd_read_capacity(struct scsi_disk *sdkp, > > unsigned char *buffer) > > "assuming 512.\n"); > > } > > > > - if (sector_size != 512 && > > - sector_size != 1024 && > > - sector_size != 2048 && > > - sector_size != 4096) { > > + if (!blk_is_valid_logical_block_size(sector_size)) { > > sd_printk(KERN_NOTICE, sdkp, "Unsupported sector size > > %d.\n", > > sector_size); > > /* > > > > With the commit message fixed, looks OK. > > Reviewed-by: Damien Le Moal >