* [PATCH 0/7] fix IS_ERR_VALUE usage
@ 2016-02-15 14:35 Andrzej Hajda
2016-02-15 14:35 ` [PATCH 6/7] fbdev: exynos: " Andrzej Hajda
2016-02-17 10:48 ` [PATCH 0/7] " Arnd Bergmann
0 siblings, 2 replies; 4+ messages in thread
From: Andrzej Hajda @ 2016-02-15 14:35 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
This small set of independent patches tries to fix incorrect
IS_ERR_VALUE macro usage. It fixes most usages leading to errors
as described in [1]. It also follows conclusion from the discussion
[1][2] - IS_ERR_VALUE should be used only with unsigned long type,
signed types should use comparison 'ret < 0'.
The patchset does not fix errors present in net/ethernet/freescale
and soc/fsq/qe drivers - these drivers mixes different types:
dma_addr_t, u32, unsigned long, fixing it properly seems to me more
challenging, maybe maintainers or brave volunteers can look it.
The list of missing fixes:
drivers/net/ethernet/freescale/fs_enet/mac-scc.c:149:36-37: WARNING: incorrect argument type in IS_ERR_VALUE(fep -> ring_mem_addr)
drivers/net/ethernet/freescale/ucc_geth.c:2237:48-49: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> tx_bd_ring_offset [ j ])
drivers/net/ethernet/freescale/ucc_geth.c:2314:48-49: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> rx_bd_ring_offset [ j ])
drivers/net/ethernet/freescale/ucc_geth.c:2524:44-45: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> tx_glbl_pram_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2544:45-46: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> thread_dat_tx_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2571:46-47: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> send_q_mem_reg_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2612:42-43: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> scheduler_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2659:54-55: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> tx_fw_statistics_pram_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2696:44-45: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> rx_glbl_pram_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2715:45-46: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> thread_dat_rx_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2736:54-55: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> rx_fw_statistics_pram_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2756:53-54: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> rx_irq_coalescing_tbl_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2822:44-45: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> rx_bd_qs_tbl_offset)
drivers/net/ethernet/freescale/ucc_geth.c:2908:47-48: WARNING: incorrect argument type in IS_ERR_VALUE(ugeth -> exf_glbl_param_offset)
drivers/net/ethernet/freescale/ucc_geth.c:292:36-37: WARNING: incorrect argument type in IS_ERR_VALUE(init_enet_offset)
drivers/net/ethernet/freescale/ucc_geth.c:3042:39-40: WARNING: incorrect argument type in IS_ERR_VALUE(init_enet_pram_offset)
drivers/soc/fsl/qe/ucc_fast.c:271:60-61: WARNING: incorrect argument type in IS_ERR_VALUE(uccf -> ucc_fast_tx_virtual_fifo_base_offset)
drivers/soc/fsl/qe/ucc_fast.c:284:60-61: WARNING: incorrect argument type in IS_ERR_VALUE(uccf -> ucc_fast_rx_virtual_fifo_base_offset)
drivers/soc/fsl/qe/ucc_slow.c:186:38-39: WARNING: incorrect argument type in IS_ERR_VALUE(uccs -> us_pram_offset)
drivers/soc/fsl/qe/ucc_slow.c:213:38-39: WARNING: incorrect argument type in IS_ERR_VALUE(uccs -> rx_base_offset)
drivers/soc/fsl/qe/ucc_slow.c:224:38-39: WARNING: incorrect argument type in IS_ERR_VALUE(uccs -> tx_base_offset)
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:110:35-36: WARNING: unknown argument type in IS_ERR_VALUE(fpi -> dpram_offset)
[1]: http://permalink.gmane.org/gmane.linux.kernel/2120927
[2]: http://permalink.gmane.org/gmane.linux.kernel/2150581
Regards
Andrzej
Andrzej Hajda (7):
netfilter: fix IS_ERR_VALUE usage
MIPS: module: fix incorrect IS_ERR_VALUE macro usages
drivers: char: mem: fix IS_ERROR_VALUE usage
atmel-isi: fix IS_ERR_VALUE usage
serial: clps711x: fix IS_ERR_VALUE usage
fbdev: exynos: fix IS_ERR_VALUE usage
usb: gadget: fsl_qe_udc: fix IS_ERR_VALUE usage
arch/mips/kernel/module-rela.c | 2 +-
arch/mips/kernel/module.c | 2 +-
drivers/char/mem.c | 2 +-
drivers/media/platform/soc_camera/atmel-isi.c | 4 ++--
drivers/tty/serial/clps711x.c | 14 ++++++++------
drivers/usb/gadget/udc/fsl_qe_udc.c | 2 +-
drivers/video/fbdev/exynos/exynos_mipi_dsi.c | 6 +++---
include/linux/netfilter/x_tables.h | 6 +++---
net/ipv4/netfilter/arp_tables.c | 11 +++++++----
net/ipv4/netfilter/ip_tables.c | 12 ++++++++----
net/ipv6/netfilter/ip6_tables.c | 13 +++++++++----
11 files changed, 44 insertions(+), 30 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 6/7] fbdev: exynos: fix IS_ERR_VALUE usage
2016-02-15 14:35 [PATCH 0/7] fix IS_ERR_VALUE usage Andrzej Hajda
@ 2016-02-15 14:35 ` Andrzej Hajda
2016-02-16 13:36 ` Tomi Valkeinen
2016-02-17 10:48 ` [PATCH 0/7] " Arnd Bergmann
1 sibling, 1 reply; 4+ messages in thread
From: Andrzej Hajda @ 2016-02-15 14:35 UTC (permalink / raw)
To: linux-kernel
Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Marek Szyprowski,
Inki Dae, Donghwa Lee, Kyungmin Park,
Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev,
linux-samsung-soc
IS_ERR_VALUE macro should be used only with unsigned long type.
For signed types comparison 'ret < 0' should be used.
The patch follows conclusion from discussion on LKML [1][2].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2120927
[2]: http://permalink.gmane.org/gmane.linux.kernel/2150581
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
drivers/video/fbdev/exynos/exynos_mipi_dsi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/exynos/exynos_mipi_dsi.c b/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
index b527fe4..951b592 100644
--- a/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
@@ -402,12 +402,12 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
goto error;
}
- dsim->irq = platform_get_irq(pdev, 0);
- if (IS_ERR_VALUE(dsim->irq)) {
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0) {
dev_err(&pdev->dev, "failed to request dsim irq resource\n");
- ret = -EINVAL;
goto error;
}
+ dsim->irq = ret;
init_completion(&dsim_wr_comp);
init_completion(&dsim_rd_comp);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 6/7] fbdev: exynos: fix IS_ERR_VALUE usage
2016-02-15 14:35 ` [PATCH 6/7] fbdev: exynos: " Andrzej Hajda
@ 2016-02-16 13:36 ` Tomi Valkeinen
0 siblings, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2016-02-16 13:36 UTC (permalink / raw)
To: Andrzej Hajda, linux-kernel
Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, Inki Dae,
Donghwa Lee, Kyungmin Park, Jean-Christophe Plagniol-Villard,
linux-fbdev, linux-samsung-soc
[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]
On 15/02/16 16:35, Andrzej Hajda wrote:
> IS_ERR_VALUE macro should be used only with unsigned long type.
> For signed types comparison 'ret < 0' should be used.
>
> The patch follows conclusion from discussion on LKML [1][2].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2120927
> [2]: http://permalink.gmane.org/gmane.linux.kernel/2150581
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
> drivers/video/fbdev/exynos/exynos_mipi_dsi.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/exynos/exynos_mipi_dsi.c b/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
> index b527fe4..951b592 100644
> --- a/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
> +++ b/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
> @@ -402,12 +402,12 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
> goto error;
> }
>
> - dsim->irq = platform_get_irq(pdev, 0);
> - if (IS_ERR_VALUE(dsim->irq)) {
> + ret = platform_get_irq(pdev, 0);
> + if (ret < 0) {
> dev_err(&pdev->dev, "failed to request dsim irq resource\n");
> - ret = -EINVAL;
> goto error;
> }
> + dsim->irq = ret;
>
> init_completion(&dsim_wr_comp);
> init_completion(&dsim_rd_comp);
>
Thanks, queued for 4.6.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/7] fix IS_ERR_VALUE usage
2016-02-15 14:35 [PATCH 0/7] fix IS_ERR_VALUE usage Andrzej Hajda
2016-02-15 14:35 ` [PATCH 6/7] fbdev: exynos: " Andrzej Hajda
@ 2016-02-17 10:48 ` Arnd Bergmann
1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-02-17 10:48 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 15 February 2016 15:35:18 Andrzej Hajda wrote:
>
> Andrzej Hajda (7):
> netfilter: fix IS_ERR_VALUE usage
> MIPS: module: fix incorrect IS_ERR_VALUE macro usages
> drivers: char: mem: fix IS_ERROR_VALUE usage
> atmel-isi: fix IS_ERR_VALUE usage
> serial: clps711x: fix IS_ERR_VALUE usage
> fbdev: exynos: fix IS_ERR_VALUE usage
> usb: gadget: fsl_qe_udc: fix IS_ERR_VALUE usage
>
Can you Cc me the next time on all of the patches? I only got
three of them this time.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-17 10:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15 14:35 [PATCH 0/7] fix IS_ERR_VALUE usage Andrzej Hajda
2016-02-15 14:35 ` [PATCH 6/7] fbdev: exynos: " Andrzej Hajda
2016-02-16 13:36 ` Tomi Valkeinen
2016-02-17 10:48 ` [PATCH 0/7] " Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).