…
> +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
…
> @@ -595,6 +597,7 @@ static int qcom_iommu_of_xlate(struct device *dev, struct
> of_phandle_args *args)
>* banks are ok, but multiple devices are not:
>*/
> if (WARN_ON(qcom_iommu != dev_iommu_priv_g
…
> +++ b/drivers/vfio/vfio_iommu_type1.c
> @@ -2798,7 +2798,7 @@ static int vfio_iommu_type1_dma_rw_chunk
…
> - bool kthread = current->mm == NULL;
> + bool kthread_load_mm;
> size_t offset;
How do you think about to reduce the scope for such variables?
https://refactoring.com/catal
…
> +++ b/drivers/vfio/vfio_iommu_type1.c
…
> @@ -2812,11 +2815,10 @@ static int vfio_iommu_type1_dma_rw_chunk
…
> if (!mm)
> return -EPERM;
>
> - if (kthread)
> + if (kthread && use_mm)
Can another design approach make sense here?
+ bool thread_use_mm = ((curren
>> Can it be helpful to convert initialisations for these variables
>> into later assignments?
>
> Perhaps. Then it looks like the below.
…
> +++ b/drivers/vfio/vfio_iommu_type1.c
> @@ -2798,9 +2798,12 @@ static int vfio_iommu_type1_dma_rw_chunk
…
> - bool kthread = current->mm == NULL;
> +
…
> +++ b/drivers/vfio/vfio_iommu_type1.c
> @@ -2798,7 +2798,8 @@ static int vfio_iommu_type1_dma_rw_chunk
…
> - bool kthread = current->mm == NULL;
> + bool kthread = current->flags & PF_KTHREAD;
> + bool use_mm = current->mm == NULL;
…
Can it be helpful to convert initialisations for
> Improve the exception handling to free the resources correctly when
> failed to allocate an iommu group.
I propose to avoid the specification of duplicate function calls.
Will it become helpful to add a few jump targets?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Doc
>> Do you disagree to the application of the Linux coding style then
>> for the recommended exception handling?
>
> No, that's not what I mean. My point is the exception handling in this
> patch is simple and no need to add 'goto' statement which does not help
> to improve readability.
Do we come
>> * I suggest to avoid the specification of duplicate function calls.
>> Will it be helpful to add a few jump targets?
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162#n455
>
> I do
> Optimize the error handling to free the resources correctly when
> failed to allocate an iommu group.
* I would not categorise the desired completion of exception handling
as a software optimisation.
* Would you like to add the tag “Fixes” to the commit message?
* I suggest to avoid the spec
> …
>> +++ b/drivers/iommu/qcom_iommu.c
>> @@ -813,8 +813,11 @@ static int qcom_iommu_device_probe(struct
>> platform_device *pdev)
>> qcom_iommu->dev = dev;
>>
>> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
…
>> qcom_iommu->local_base = devm_ioremap_resource(dev,
> The function qcom_iommu_device_probe() does not perform sufficient
> error checking after executing devm_ioremap_resource(), which can
> result in crashes if a critical error path is encountered.
Your update suggestion will be rechecked once more.
* Can it be that the patch would need a higher
> Release resources when exiting on error.
I have got doubts that such a change description fits to
the proposed source code adjustment.
…
> +++ b/drivers/iommu/qcom_iommu.c
> @@ -813,8 +813,11 @@ static int qcom_iommu_device_probe(struct
> platform_device *pdev)
> qcom_iommu->dev = dev;
Hello,
I tried another script for the semantic patch language out.
This source code analysis approach points out that the implementation
of the function “rk_iommu_add_device” contains still
an unchecked call of the function “device_link_add”.
https://git.kernel.org/pub/scm/linux/kernel/git/next/li
Hello,
I tried another script for the semantic patch language out.
This source code analysis approach points out that the implementation
of the function “exynos_iommu_add_device” contains still
an unchecked call of the function “device_link_add”.
https://git.kernel.org/pub/scm/linux/kernel/git/tor
> The call to of_parse_phandle returns a node pointer with refcount
> incremented thus it must be explicitly decremented after the last
> usage.
Can a splitting of this information into two sentences help?
> 581 static int mtk_iommu_probe(struct platform_device *pdev)
> 582 {
> ...
I sugges
> The call to of_parse_phandle returns a node pointer with refcount
> incremented thus it must be explicitly decremented after the last
> usage.
Can a splitting of this information into two sentences help?
> 581 static int mtk_iommu_probe(struct platform_device *pdev)
> 582 {
> ...
I sugges
>> Date: Sat, 20 Jan 2018 15:30:17 +0100
>>
>> Omit extra messages for a memory allocation failure in these functions.
>
> Why?
Do you find the wording “WARNING: Possible unnecessary 'out of memory' message”
(from the script “checkpatch.pl”) more reasonable?
> This may as well be "delete some s
>> Date: Sat, 20 Jan 2018 13:51:49 +0100
>>
>> Omit an extra message for a memory allocation failure in this function.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring
>
> NACK on this one and th
From: Markus Elfring
Date: Sat, 20 Jan 2018 15:30:17 +0100
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/iommu/arm-smmu-v3.c | 9 +++--
drivers/iommu/arm-smmu.c
From: Markus Elfring
Date: Sat, 20 Jan 2018 14:55:21 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/iommu/dmar.c | 2 --
1 file changed, 2 deletions(-)
diff
From: Markus Elfring
Date: Sat, 20 Jan 2018 14:28:13 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/iommu/exynos-iommu.c | 2 --
1 file changed, 2 deletions
From: Markus Elfring
Date: Sat, 20 Jan 2018 13:51:49 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/iommu/intel-iommu.c | 1 -
1 file changed, 1 deletion
From: Markus Elfring
Date: Fri, 19 Jan 2018 22:22:38 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/iommu/ipmmu-vmsa.c | 4 +---
1 file changed, 1 insertion
From: Markus Elfring
Date: Fri, 19 Jan 2018 21:44:31 +0100
Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/iommu/tegra-gart.c | 8 ++--
1 file changed, 2 insertions
From: Markus Elfring
Date: Sat, 7 Oct 2017 19:19:45 +0200
Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This
From: Markus Elfring
Date: Sat, 7 Oct 2017 17:34:23 +0200
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
lib/test_kasan.c | 5 ++---
lib/test_kmod.c | 8 ++--
lib
From: Markus Elfring
Date: Sat, 7 Oct 2017 19:39:29 +0200
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
test: Delete five error messages for a failed memory allocation
Improve a size determination in seven functions
lib/dma-debug.c
From: Markus Elfring
Date: Fri, 6 Nov 2015 18:32:41 +0100
The free_io_pgtable_ops() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)
How do you think about to extend an other SmPL scrip
> From: Markus Elfring
> Date: Thu, 5 Feb 2015 17:54:16 +0100
>
> The vfree() function performs also input parameter validation.
> Thus the test around the call is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Marku
From: Markus Elfring
Date: Sun, 28 Jun 2015 15:55:11 +0200
The free_io_pgtable_ops() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
From: Markus Elfring
Date: Thu, 5 Feb 2015 17:54:16 +0100
The vfree() function performs also input parameter validation.
Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/iommu/tegra-gart.c | 3
>> If you are convinced that dropping the null tests is a good idea, then you
>> can submit the patch that makes the change to the relevant maintainers and
>> mailing lists.
>From af73fb59d5d4b2c289fb236d0752522b6b38 Mon Sep 17 00:00:00 2001
From: Markus Elfring
Date
33 matches
Mail list logo