diff mbox series

[6/7] block: remove the fallback case in queue_dma_alignment

Message ID 20240625110603.50885-7-hch@lst.de (mailing list archive)
State Superseded, archived
Headers show
Series [1/7] md: set md-specific flags for all queue limits | expand

Checks

Context Check Description
mdraidci/vmtest-md-6_11-PR success PR summary
mdraidci/vmtest-md-6_11-VM_Test-0 success Logs for build-kernel

Commit Message

Christoph Hellwig June 25, 2024, 11:05 a.m. UTC
Now that all updates go through blk_validate_limits the default of 511
is set at initialization time.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/blkdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

John Garry June 25, 2024, 12:03 p.m. UTC | #1
On 25/06/2024 12:05, Christoph Hellwig wrote:
> Now that all updates go through blk_validate_limits the default of 511
> is set at initialization time.

The code handles q == NULL case, so is q == NULL now impossible?

> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   include/linux/blkdev.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index e23fc418bb2260..d93fba7a1f3162 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1393,7 +1393,7 @@ static inline bool bdev_is_zone_start(struct block_device *bdev,
>   
>   static inline int queue_dma_alignment(const struct request_queue *q)
>   {
> -	return q ? q->limits.dma_alignment : 511;
> +	return q->limits.dma_alignment;
>   }
>   
>   static inline unsigned int
Christoph Hellwig June 25, 2024, 2:34 p.m. UTC | #2
On Tue, Jun 25, 2024 at 01:03:19PM +0100, John Garry wrote:
> On 25/06/2024 12:05, Christoph Hellwig wrote:
> > Now that all updates go through blk_validate_limits the default of 511
> > is set at initialization time.
> 
> The code handles q == NULL case, so is q == NULL now impossible?

No caller ever passed a NULL q in. But yes, this could use a sentence
in the commit log.
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index e23fc418bb2260..d93fba7a1f3162 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1393,7 +1393,7 @@  static inline bool bdev_is_zone_start(struct block_device *bdev,
 
 static inline int queue_dma_alignment(const struct request_queue *q)
 {
-	return q ? q->limits.dma_alignment : 511;
+	return q->limits.dma_alignment;
 }
 
 static inline unsigned int