From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Levitsky Subject: Re: [PATCH 01/10] block: introduce blk_is_valid_logical_block_size Date: Wed, 22 Jul 2020 11:50:26 +0300 Message-ID: References: <20200721105239.8270-1-mlevitsk@redhat.com> <20200721105239.8270-2-mlevitsk@redhat.com> <20200721151313.GA10620@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200721151313.GA10620@lst.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" To: Christoph Hellwig Cc: "Michael S. Tsirkin" , "open list:NVM EXPRESS DRIVER" , "open list:VIRTIO CORE AND NET DRIVERS" , Hou Tao , Sagi Grimberg , "open list:SCSI CDROM DRIVER" , Satya Tangirala , Ajay Joshi , Alex Dubov , "James E.J. Bottomley" , Josef Bacik , Ming Lei , "open list:BLOCK LAYER" , Stefan Hajnoczi , Colin Ian King , Keith Busch , "open list:NETWORK BLOCK DEVICE (NBD)" , Bart Van Assche , Maxim Levitsky , Jens Axboe Jens List-Id: virtualization@lists.linuxfoundation.org On Tue, 2020-07-21 at 17:13 +0200, Christoph Hellwig wrote: > > +/** > > + * 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)? Yep. I noticed that few minutes after I sent the patches. > > > 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. Will fix. > > > +extern bool blk_is_valid_logical_block_size(unsigned int size); > > No need for externs on function declarations. I also think so, but I followed the style of all existing function prototypes in this file. Most of them have 'extern'. Thanks for the review! Best regards, maxim Levitsky