* [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error
@ 2021-03-26 21:03 Heiner Kallweit
2021-03-30 10:21 ` Robin Murphy
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Heiner Kallweit @ 2021-03-26 21:03 UTC (permalink / raw)
To: Christoph Hellwig, Marek Szyprowski, Robin Murphy
Cc: open list:AMD IOMMU (AMD-VI)
Zillions of drivers use the unlikely() hint when checking the result of
dma_mapping_error(). This is an inline function anyway, so we can move
the hint into the function and remove it from drivers over time.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
This is a resend of a patch from Dec 2020 when I tried to do it
tree-wide. Now start with the actual change, drivers can be changed
afterwards, maybe per subsystem.
---
include/linux/dma-mapping.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index e9d19b974..183e7103a 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -95,7 +95,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
{
debug_dma_mapping_error(dev, dma_addr);
- if (dma_addr == DMA_MAPPING_ERROR)
+ if (unlikely(dma_addr == DMA_MAPPING_ERROR))
return -ENOMEM;
return 0;
}
--
2.31.0
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error
2021-03-26 21:03 [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error Heiner Kallweit
@ 2021-03-30 10:21 ` Robin Murphy
2021-03-30 10:54 ` Heiner Kallweit
2021-03-30 10:59 ` Heiner Kallweit
2021-04-02 14:41 ` Christoph Hellwig
2 siblings, 1 reply; 5+ messages in thread
From: Robin Murphy @ 2021-03-30 10:21 UTC (permalink / raw)
To: Heiner Kallweit, Christoph Hellwig, Marek Szyprowski
Cc: open list:AMD IOMMU (AMD-VI)
On 2021-03-26 21:03, Heiner Kallweit wrote:
> Zillions of drivers use the unlikely() hint when checking the result of
> dma_mapping_error(). This is an inline function anyway, so we can move
> the hint into the function and remove it from drivers over time.
I'm pretty sure I reviewed this last time - please remember to pick up
tags from previous versions when reposting.
Thanks,
Robin.
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> This is a resend of a patch from Dec 2020 when I tried to do it
> tree-wide. Now start with the actual change, drivers can be changed
> afterwards, maybe per subsystem.
> ---
> include/linux/dma-mapping.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index e9d19b974..183e7103a 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -95,7 +95,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
> {
> debug_dma_mapping_error(dev, dma_addr);
>
> - if (dma_addr == DMA_MAPPING_ERROR)
> + if (unlikely(dma_addr == DMA_MAPPING_ERROR))
> return -ENOMEM;
> return 0;
> }
>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error
2021-03-30 10:21 ` Robin Murphy
@ 2021-03-30 10:54 ` Heiner Kallweit
0 siblings, 0 replies; 5+ messages in thread
From: Heiner Kallweit @ 2021-03-30 10:54 UTC (permalink / raw)
To: Robin Murphy, Christoph Hellwig, Marek Szyprowski
Cc: open list:AMD IOMMU (AMD-VI)
On 30.03.2021 12:21, Robin Murphy wrote:
> On 2021-03-26 21:03, Heiner Kallweit wrote:
>> Zillions of drivers use the unlikely() hint when checking the result of
>> dma_mapping_error(). This is an inline function anyway, so we can move
>> the hint into the function and remove it from drivers over time.
>
> I'm pretty sure I reviewed this last time - please remember to pick up tags from previous versions when reposting.
>
Right, you did. My bad.
> Thanks,
> Robin.
>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> This is a resend of a patch from Dec 2020 when I tried to do it
>> tree-wide. Now start with the actual change, drivers can be changed
>> afterwards, maybe per subsystem.
>> ---
>> include/linux/dma-mapping.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
>> index e9d19b974..183e7103a 100644
>> --- a/include/linux/dma-mapping.h
>> +++ b/include/linux/dma-mapping.h
>> @@ -95,7 +95,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
>> {
>> debug_dma_mapping_error(dev, dma_addr);
>> - if (dma_addr == DMA_MAPPING_ERROR)
>> + if (unlikely(dma_addr == DMA_MAPPING_ERROR))
>> return -ENOMEM;
>> return 0;
>> }
>>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error
2021-03-26 21:03 [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error Heiner Kallweit
2021-03-30 10:21 ` Robin Murphy
@ 2021-03-30 10:59 ` Heiner Kallweit
2021-04-02 14:41 ` Christoph Hellwig
2 siblings, 0 replies; 5+ messages in thread
From: Heiner Kallweit @ 2021-03-30 10:59 UTC (permalink / raw)
To: Christoph Hellwig, Marek Szyprowski, Robin Murphy
Cc: open list:AMD IOMMU (AMD-VI)
On 26.03.2021 22:03, Heiner Kallweit wrote:
> Zillions of drivers use the unlikely() hint when checking the result of
> dma_mapping_error(). This is an inline function anyway, so we can move
> the hint into the function and remove it from drivers over time.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> This is a resend of a patch from Dec 2020 when I tried to do it
> tree-wide. Now start with the actual change, drivers can be changed
> afterwards, maybe per subsystem.
> ---
> include/linux/dma-mapping.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index e9d19b974..183e7103a 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -95,7 +95,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
> {
> debug_dma_mapping_error(dev, dma_addr);
>
> - if (dma_addr == DMA_MAPPING_ERROR)
> + if (unlikely(dma_addr == DMA_MAPPING_ERROR))
> return -ENOMEM;
> return 0;
> }
>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error
2021-03-26 21:03 [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error Heiner Kallweit
2021-03-30 10:21 ` Robin Murphy
2021-03-30 10:59 ` Heiner Kallweit
@ 2021-04-02 14:41 ` Christoph Hellwig
2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2021-04-02 14:41 UTC (permalink / raw)
To: Heiner Kallweit
Cc: open list:AMD IOMMU (AMD-VI), Robin Murphy, Christoph Hellwig
Thanks, applied.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-04-02 14:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 21:03 [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error Heiner Kallweit
2021-03-30 10:21 ` Robin Murphy
2021-03-30 10:54 ` Heiner Kallweit
2021-03-30 10:59 ` Heiner Kallweit
2021-04-02 14:41 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.