From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 01/10] block: introduce blk_is_valid_logical_block_size Date: Tue, 21 Jul 2020 17:13:13 +0200 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 Return-path: Content-Disposition: inline In-Reply-To: <20200721105239.8270-2-mlevitsk@redhat.com> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: virtualization@lists.linuxfoundation.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.