[PATCH v2 3/9] r8169: use new helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index efaea1a0a..ae476fe8d

[PATCH v2 2/9] PCI: use helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/pci/msi.c| 6 +++--- drivers/pci/search.c | 10 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 73986825d..e039b740f 100644

[PATCH v2 1/9] PCI: add helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
In several places in the kernel we find PCI_DEVID used like this: PCI_DEVID(dev->bus->number, dev->devfn) Therefore create a helper for it. Signed-off-by: Heiner Kallweit --- include/linux/pci.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/pci.h b/include/li

[PATCH v2 0/9] PCI: add help pci_dev_id

2019-04-24 Thread Heiner Kallweit
In several places in the kernel we find PCI_DEVID used like this: PCI_DEVID(dev->bus->number, dev->devfn) Therefore create a helper for it. v2: - apply the change to all affected places in the kernel Heiner Kallweit (9): PCI: add helper pci_dev_id PCI: use helper pci_dev_id r8169

[PATCH v2 4/9] powerpc/powernv/npu: use helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- arch/powerpc/platforms/powernv/npu-dma.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c

[PATCH v2 5/9] drm/amdkfd: use helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index

[PATCH v2 6/9] iommu/amd: use helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/iommu/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index f467cc4b4..5cb201422 100644 --- a/drivers/iommu

[PATCH v2 8/9] stmmac: pci: use helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac

[PATCH v2 7/9] iommu/vt-d: use helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/iommu/intel-iommu.c | 2 +- drivers/iommu/intel_irq_remapping.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c

[PATCH v2 9/9] platform/chrome: chromeos_laptop: use helper pci_dev_id

2019-04-24 Thread Heiner Kallweit
Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/platform/chrome/chromeos_laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c index

dma-mapping: use bit macros

2019-11-29 Thread Heiner Kallweit
Not necessarily a big leap for mankind, but using bit macros makes the code better readable, especially the definition of DMA_BIT_MASK is more intuitive. Signed-off-by: Heiner Kallweit --- include/linux/dma-mapping.h | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions

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

2020-12-10 Thread Heiner Kallweit
nly 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 wh

[PATCH v2] dma-mapping: add unlikely hint for error path in dma_mapping_error

2020-12-13 Thread Heiner Kallweit
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 this function and remove it from drivers. Signed-off-by: Heiner Kallweit --- v2: Split the big patch into the change for dma-mapping.h

Re: [PATCH v2] dma-mapping: add unlikely hint for error path in dma_mapping_error

2020-12-13 Thread Heiner Kallweit
Am 13.12.2020 um 22:27 schrieb Song Bao Hua (Barry Song): > > >> -Original Message----- >> From: Heiner Kallweit [mailto:hkallwe...@gmail.com] >> Sent: Monday, December 14, 2020 5:33 AM >> To: Christoph Hellwig ; Marek Szyprowski >> ; Robin Murphy ; Song

Re: [PATCH v2] dma-mapping: add unlikely hint for error path in dma_mapping_error

2021-01-08 Thread Heiner Kallweit
On 14.12.2020 14:01, Robin Murphy wrote: > On 2020-12-13 16:32, 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 this function and r

[PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error

2021-03-26 Thread Heiner Kallweit
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 --- This is a resend of a patch from Dec 2020 when I

Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error

2021-03-30 Thread Heiner Kallweit
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

Re: [PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error

2021-03-30 Thread Heiner Kallweit
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:

[PATCH 3/3] iommu: remove unneeded check

2016-06-28 Thread Heiner Kallweit
The init function ensures that iommu_group_kset can't be NULL. Therefore this check isn't needed. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/iommu/iommu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index b

[PATCH 2/3] iommu: improve handling of failed call to kset_create_and_add

2016-06-28 Thread Heiner Kallweit
If kset_create_and_add fails then most likely due to out-of-memory. There's not necessarily a bug somewhere. Therefore I think we shouldn't use BUG_ON and simply return -ENOMEM. That's also what other callers of kset_create_and_add do. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.

Re: [PATCH 3/3] iommu: remove unneeded check

2016-06-28 Thread Heiner Kallweit
Am 28.06.2016 um 22:09 schrieb Alex Williamson: > On Tue, 28 Jun 2016 20:40:37 +0200 > Heiner Kallweit <hkallwe...@gmail.com> wrote: > >> The init function ensures that iommu_group_kset can't be NULL. >> Therefore this check isn't needed. > > Have you seen your p

Re: [PATCH] iommu: simplify and fix ida handling

2016-07-04 Thread Heiner Kallweit
Am 04.07.2016 um 13:46 schrieb Joerg Roedel: > On Wed, Jun 29, 2016 at 09:13:59PM +0200, Heiner Kallweit wrote: >> Ida handling can be much simplified by using the ida_simple_.. functions. >> >> This change also fixes the bug that previously checking for errors >&

Re: [PATCH 3/3] iommu: remove unneeded check

2016-06-29 Thread Heiner Kallweit
Am 29.06.2016 um 00:07 schrieb Alex Williamson: > On Tue, 28 Jun 2016 23:37:06 +0200 > Heiner Kallweit <hkallwe...@gmail.com> wrote: > >> Am 28.06.2016 um 22:09 schrieb Alex Williamson: >>> On Tue, 28 Jun 2016 20:40:37 +0200 >>> Heiner Kallweit <hkallwe

[PATCH] iommu: simplify and fix ida handling

2016-06-29 Thread Heiner Kallweit
Ida handling can be much simplified by using the ida_simple_.. functions. This change also fixes the bug that previously checking for errors returned by ida_get_new() was incomplete. ida_get_new() can return errors other than EAGAIN, e.g. ENOSPC. This case wasn't handled. Signed-off-by: Heiner