Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp620981ybh; Tue, 21 Jul 2020 03:58:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6wpOAjmRKdCmxdxRMFafmqls1UM75nFsonog/q5y9xvOzwyPYCGU+6eP0EfivATBRxQY8 X-Received: by 2002:a05:6402:1d0a:: with SMTP id dg10mr24338977edb.110.1595329135054; Tue, 21 Jul 2020 03:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595329135; cv=none; d=google.com; s=arc-20160816; b=STDLrY7aFuZGlG3lsG7c0CEIAgIVTtyRbM0htcm/uKbKWgdYDw/XtXJbryBtpZlATY 2Fv5OFG7IGctqkhayOq+hg+vk3AKTfeUdbuE9lb4Z96TrCTWFzs1ByQZVeVaedI/KXzg y32RKKNrpH8mOTA2/s8qnHxQigMD9LZtv+oUmtEtaF2jPPvf3Hq2iOlMA1jZn2HOrHkK vVd4FZFMTaVpWQneo1mc6kM3k8lR4fCu4dA7rfDAQCFcJqJTK8fV32ouq+i/p+M1j8Ha WS9gj+GTEnAf2331RbUh4OjOI+CFiCQI7EoFuJWPvfLjl31ci78DVwUCW/l4aS2r7N82 Otvg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jOZ3UhCTTXauv567OIWb7UfFogeyp1mZiVe9qWbA3oo=; b=In1HlJhBLuXWlWngNx5wYwYq6up/nklk90jotIqcREyga74FZodLDotWHT3DSDjFn+ ncFZ9PrHmD5w0Mmu5wVLs6M78sDqSmVFjplPSsnQE5FqvoJgWn8k9PpaS6n3QEmNVQQN ZtzpRx6GV7u48UN0rFl5SJfquMm4OtOuvNU4n1RBpV/Y9vGj9I2Ewnu0LjaaS42WG7g3 doz2pIRhQtSwRHY78KgX2uvNSUVi1JS5nJH0onR3wrw/+279r62XdOMjlRppulZzPYJs qqJ03ohuhCfpj7pYxh3piOFBeO35Ju7Pv1+4QxG7EZH5Twdhi8V5DeTSOZqj20mbSAWn 5/Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="LGW/FECQ"; 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 dh2si12206232edb.55.2020.07.21.03.58.32; Tue, 21 Jul 2020 03:58:55 -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="LGW/FECQ"; 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 S1726977AbgGUKze (ORCPT + 99 others); Tue, 21 Jul 2020 06:55:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:25305 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728037AbgGUKzd (ORCPT ); Tue, 21 Jul 2020 06:55:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595328933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jOZ3UhCTTXauv567OIWb7UfFogeyp1mZiVe9qWbA3oo=; b=LGW/FECQIRWgRa6vQORmnMnKimJE/zFQ6KIOQY+pOj0aly0pQlV8Dycvr62z6mGVrjmZsL xK94WNa/0BrDlVqFXAat5nhm89qqaL88qClrLvYqvdhQY/hR6O5sTijvjNrc0J65vGm3uY RGgUSXeQUuRXx3EXcKdXkN8ehopNgcA= 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-354-MW0yyVdePGqPeJmXvqorTQ-1; Tue, 21 Jul 2020 06:55:29 -0400 X-MC-Unique: MW0yyVdePGqPeJmXvqorTQ-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 12326193F561; Tue, 21 Jul 2020 10:55:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C0181C4; Tue, 21 Jul 2020 10:55:15 +0000 (UTC) From: Maxim Levitsky To: linux-kernel@vger.kernel.org Cc: Keith Busch , Josef Bacik , linux-block@vger.kernel.org (open list:BLOCK LAYER), Sagi Grimberg , Jens Axboe , linux-nvme@lists.infradead.org (open list:NVM EXPRESS DRIVER), linux-scsi@vger.kernel.org (open list:SCSI CDROM DRIVER), Tejun Heo , Bart Van Assche , "Martin K. Petersen" , Damien Le Moal , Jason Wang , Maxim Levitsky , Stefan Hajnoczi , Colin Ian King , "Michael S. Tsirkin" , Paolo Bonzini , Ulf Hansson , Ajay Joshi , Ming Lei , linux-mmc@vger.kernel.org (open list:SONY MEMORYSTICK SUBSYSTEM), Christoph Hellwig , Satya Tangirala , nbd@other.debian.org (open list:NETWORK BLOCK DEVICE (NBD)), Hou Tao , Jens Axboe , virtualization@lists.linux-foundation.org (open list:VIRTIO CORE AND NET DRIVERS), "James E.J. Bottomley" , Alex Dubov , Maxim Levitsky Subject: [PATCH 09/10] block: scsi: sd: use blk_is_valid_logical_block_size Date: Tue, 21 Jul 2020 13:52:38 +0300 Message-Id: <20200721105239.8270-10-mlevitsk@redhat.com> In-Reply-To: <20200721105239.8270-1-mlevitsk@redhat.com> References: <20200721105239.8270-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Use blk_is_valid_logical_block_size instead of hardcoded list 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); /* -- 2.26.2