Re: [PATCH] dma-mapping: move hint unlikely for dma_mapping_error from drivers to core

2020-12-10 Thread Kalle Valo
Heiner Kallweit  writes:

> 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.
>>From time to time discussions pop up how effective unlikely() is,
> and that it should be used only if something is really very unlikely.
> I think that's the case here.
>
> Patch was created with some help from coccinelle.
>
> @@
> expression dev, dma_addr;
> @@
>
> - unlikely(dma_mapping_error(dev, dma_addr))
> + dma_mapping_error(dev, dma_addr)
>
> Signed-off-by: Heiner Kallweit 
> ---
> If ok, then tbd through which tree this is supposed to go.
> Patch is based on linux-next-20201210.
> ---

[...]

>  drivers/net/wireless/ath/ath10k/htt_rx.c  |  2 +-
>  drivers/net/wireless/ath/ath10k/pci.c |  2 +-
>  drivers/net/wireless/ath/ath10k/snoc.c|  2 +-
>  drivers/net/wireless/ath/ath11k/ce.c  |  2 +-
>  drivers/net/wireless/ath/ath11k/dp_rx.c   |  2 +-
>  drivers/net/wireless/ath/ath5k/base.c |  2 +-
>  drivers/net/wireless/ath/ath9k/beacon.c   |  2 +-
>  drivers/net/wireless/ath/ath9k/recv.c | 21 +++-
>  drivers/net/wireless/ath/ath9k/xmit.c |  2 +-
>  drivers/net/wireless/ath/wil6210/txrx.c   | 10 
>  drivers/net/wireless/ath/wil6210/txrx_edma.c  |  4 +--
>  drivers/net/wireless/broadcom/b43/dma.c   |  2 +-
>  drivers/net/wireless/broadcom/b43legacy/dma.c |  2 +-
>  drivers/net/wireless/intel/iwlwifi/pcie/tx.c  | 10 
>  drivers/net/wireless/intel/iwlwifi/queue/tx.c | 10 
>  drivers/net/wireless/mediatek/mt76/dma.c  |  8 +++---
>  .../net/wireless/ralink/rt2x00/rt2x00queue.c  |  4 +--

For wireless drivers:

Acked-by: Kalle Valo 

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH] dma-mapping: move hint unlikely for dma_mapping_error from drivers to core

2020-12-10 Thread Wolfram Sang
On Thu, Dec 10, 2020 at 03:47:50PM +0100, 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.
> From time to time discussions pop up how effective unlikely() is,
> and that it should be used only if something is really very unlikely.
> I think that's the case here.
> 
> Patch was created with some help from coccinelle.
> 
> @@
> expression dev, dma_addr;
> @@
> 
> - unlikely(dma_mapping_error(dev, dma_addr))
> + dma_mapping_error(dev, dma_addr)
> 
> Signed-off-by: Heiner Kallweit 

Acked-by: Wolfram Sang  # for I2C



signature.asc
Description: PGP signature
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu