[PATCH][next] iommu/dma: Use kvcalloc() instead of kvzalloc()

2021-09-28 Thread Gustavo A. R. Silva
Use 2-factor argument form kvcalloc() instead of kvzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva --- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c

Re: [PATCH][next] iommu/vt-d: Fix out-bounds-warning in intel_svm_page_response()

2021-04-14 Thread Gustavo A. R. Silva
Hi Balou, On 4/14/21 00:24, Lu Baolu wrote: > Hi Gustavo, > > On 4/14/21 3:54 AM, Gustavo A. R. Silva wrote: >> Replace call to memcpy() with just a couple of simple assignments in >> order to fix the following out-of-bounds warning: >> >> drivers/iommu/int

[PATCH v2][next] iommu/vt-d: Fix out-bounds-warning in intel_svm_page_response()

2021-04-14 Thread Gustavo A. R. Silva
of &desc.qw2 and &resp.qw2, respectively. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/109 Signed-off-by: Gustavo A. R. Silva --- Changes i

[PATCH][next] iommu/vt-d: Fix out-bounds-warning in intel_svm_page_response()

2021-04-13 Thread Gustavo A. R. Silva
ength of &desc.qw2. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/109 Signed-off-by: Gustavo A. R. Silva --- drivers/iommu/intel/svm.c | 7

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-09 Thread Gustavo A. R. Silva
is break; > > Found using: > > $ grep-2.5.4 -rP --include=*.[ch] -n > "fallthrough;(\s*(case\s+\w+|default)\s*:\s*){1,7}break;" * > > Miscellanea: > > o Move or coalesce a couple label blocks above a default: block. > > Signed-off-by:

[PATCH] iommu/qcom: Replace zero-length array with flexible-array member

2020-02-12 Thread Gustavo A. R. Silva
lle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva --- drivers/iommu/qcom_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) d

[PATCH] iommu/qcom_iommu: Use struct_size() helper

2019-08-29 Thread Gustavo A. R. Silva
ice that, in this case, variable sz is not necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/iommu/qcom_iommu.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/qcom_iommu.

Re: [PATCH] iommu/dmar: Use struct_size() helper

2019-04-26 Thread Gustavo A. R. Silva
On 4/26/19 9:44 AM, Joerg Roedel wrote: > On Thu, Apr 18, 2019 at 01:46:24PM -0500, Gustavo A. R. Silva wrote: >> Make use of the struct_size() helper instead of an open-coded version >> in order to avoid any potential type mistakes, in particular in the >> context in whi

[PATCH] iommu/dmar: Use struct_size() helper

2019-04-18 Thread Gustavo A. R. Silva
ize = struct_size(info, path, level); Signed-off-by: Gustavo A. R. Silva --- drivers/iommu/dmar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 9c49300e9fb7..6d969a172fbb 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dma

[PATCH] iommu: remove unnecessary code

2017-05-11 Thread Gustavo A. R. Silva
did_old is an unsigned variable and, greater-than-or-equal-to-zero comparison of an unsigned variable is always true. Addresses-Coverity-ID: 1398477 Signed-off-by: Gustavo A. R. Silva --- drivers/iommu/intel-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers