Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp802597ybh; Tue, 21 Jul 2020 08:16:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRQyTN82/VzhtpTYuPRQAmFHZadncwXc8+oZVJwmHVa4VtpoDWJGuZHIDHDatgytxx1Syr X-Received: by 2002:a50:931e:: with SMTP id m30mr27557915eda.341.1595344567509; Tue, 21 Jul 2020 08:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595344567; cv=none; d=google.com; s=arc-20160816; b=vUmVLs4az793PfqVcyv8zh1o8HSZyJJ3/gHjQLKya0nlv7quY5IAQpK7xS2SfKNpIN CukbdaPvFk6ZjynZDNlAn8mWL5GlkVbiq8YlwNkPzyP46qWYZZ1dgEknUe5UNTCBjhUU 948S+KXKw2iKfq3hSYylpxPLURwHr757rNhogFrvVa8AZrpuJfNdy3kHQXCT1JPtRfNX KzohdBRQNLD2aE8NKzy5esOekuAK6hRHJ0zpXIMfpL6RrWr0jBbY9dZuojWhl8noiuIn M+e7WlOH86+g/XEN0fGpw5iUNXZuUeR6f5HWoRJzXCCL1xetcHcIZMLTiFrQLPZ31gq2 XeOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wydGUNHCcr/Ay/PmGE/1jke4ty4+Cqtl8ff2BlS2dHk=; b=Gjj+qjQx0N60yczjvCsx6AkR7P32Smf8SAFhyzrBSobU+k1uFvf+AdLHqASI35dbZG cCttAeKz9AjXotUx7J59eTraCfdFIj88g5EXhBvC9e5L2e/2E6xmUuAM0DoiV9pyks/q 47dWwk6MxhMOkzFiXGM6P+LEMAQFAgT6vT6CwY2bnqrMyztBTA6AVI4MiBvOSS8Hksf4 nKHCbK7ccj26zgt+5pI/48Zf8P02cv/mjs26J0WICcriAcxM+vMyNLE6auq1VmPwc7fu pLrnQzT5+02jeuOpUqZ/3rfcE1N8dlzM91Ya9xCb2YgfsY/FC4NDbawccYr62Lf69OtT JDsQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si12819762ejx.493.2020.07.21.08.15.44; Tue, 21 Jul 2020 08:16:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728775AbgGUPNT (ORCPT + 99 others); Tue, 21 Jul 2020 11:13:19 -0400 Received: from verein.lst.de ([213.95.11.211]:52598 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbgGUPNT (ORCPT ); Tue, 21 Jul 2020 11:13:19 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 1B92268AFE; Tue, 21 Jul 2020 17:13:14 +0200 (CEST) Date: Tue, 21 Jul 2020 17:13:13 +0200 From: Christoph Hellwig To: Maxim Levitsky Cc: linux-kernel@vger.kernel.org, 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" , Damien Le Moal , 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 Subject: Re: [PATCH 01/10] block: introduce blk_is_valid_logical_block_size Message-ID: <20200721151313.GA10620@lst.de> References: <20200721105239.8270-1-mlevitsk@redhat.com> <20200721105239.8270-2-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200721105239.8270-2-mlevitsk@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +/** > + * blk_check_logical_block_size - check if logical block size is supported > + * by the kernel > + * @size: the logical block size, in bytes > + * > + * Description: > + * This function checks if the block layers supports given block size > + **/ > +bool blk_is_valid_logical_block_size(unsigned int size) > +{ > + return size >= SECTOR_SIZE && size <= PAGE_SIZE && !is_power_of_2(size); Shouldn't this be a ... && is_power_of_2(size)? > if (q->limits.io_min < q->limits.physical_block_size) > q->limits.io_min = q->limits.physical_block_size; > + > } This adds a pointless empty line. > +extern bool blk_is_valid_logical_block_size(unsigned int size); No need for externs on function declarations.