2020-11-23 07:05:40

by Tian Tao

[permalink] [raw]
Subject: [PATCH] spi: dw: fixed missing resource_size

fixed the coccicheck:
drivers/spi/spi-dw-bt1.c:220:27-30: ERROR: Missing
resource_size with mem.

Signed-off-by: Tian Tao <[email protected]>
---
drivers/spi/spi-dw-bt1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c
index f382dfad..da4f4d8 100644
--- a/drivers/spi/spi-dw-bt1.c
+++ b/drivers/spi/spi-dw-bt1.c
@@ -217,7 +217,7 @@ static int dw_spi_bt1_sys_init(struct platform_device *pdev,
if (mem) {
dwsbt1->map = devm_ioremap_resource(&pdev->dev, mem);
if (!IS_ERR(dwsbt1->map)) {
- dwsbt1->map_len = (mem->end - mem->start + 1);
+ dwsbt1->map_len = resource_size(mem);
dws->mem_ops.dirmap_create = dw_spi_bt1_dirmap_create;
dws->mem_ops.dirmap_read = dw_spi_bt1_dirmap_read;
} else {
--
2.7.4


2020-11-25 12:16:52

by Serge Semin

[permalink] [raw]
Subject: Re: [PATCH] spi: dw: fixed missing resource_size

On Mon, Nov 23, 2020 at 03:02:55PM +0800, Tian Tao wrote:
> fixed the coccicheck:
> drivers/spi/spi-dw-bt1.c:220:27-30: ERROR: Missing
> resource_size with mem.

Thanks, Tian!
Acked-by: Serge Semin <[email protected]>

>
> Signed-off-by: Tian Tao <[email protected]>
> ---
> drivers/spi/spi-dw-bt1.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c
> index f382dfad..da4f4d8 100644
> --- a/drivers/spi/spi-dw-bt1.c
> +++ b/drivers/spi/spi-dw-bt1.c
> @@ -217,7 +217,7 @@ static int dw_spi_bt1_sys_init(struct platform_device *pdev,
> if (mem) {
> dwsbt1->map = devm_ioremap_resource(&pdev->dev, mem);
> if (!IS_ERR(dwsbt1->map)) {
> - dwsbt1->map_len = (mem->end - mem->start + 1);
> + dwsbt1->map_len = resource_size(mem);
> dws->mem_ops.dirmap_create = dw_spi_bt1_dirmap_create;
> dws->mem_ops.dirmap_read = dw_spi_bt1_dirmap_read;
> } else {
> --
> 2.7.4
>

2020-11-25 14:05:06

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] spi: dw: fixed missing resource_size

On Mon, 23 Nov 2020 15:02:55 +0800, Tian Tao wrote:
> fixed the coccicheck:
> drivers/spi/spi-dw-bt1.c:220:27-30: ERROR: Missing
> resource_size with mem.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: dw: fixed missing resource_size
commit: 459ea85049b01708e364c34deac24b00909c73ed

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark