From e0a98ff45a06d621ef86663424f1e6d076cd101f Mon Sep 17 00:00:00 2001 From: Shashank Singh Date: Thu, 9 May 2019 14:30:37 +0530 Subject: [PATCH] gpu: nvgpu: fix cert-c violation for irq var irq number read from dt is unsigned type and it is stored in signed variable(CERT-INIT31-C). So, make irq number as unsigned. Jira NVGPU-3438 Change-Id: I2afd8686bf2f5405caec62cf94418e4bd009be07 Signed-off-by: Shashank Singh Reviewed-on: https://git-master.nvidia.com/r/2115393 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 4 ++-- drivers/gpu/nvgpu/os/linux/module.c | 2 +- drivers/gpu/nvgpu/os/linux/pci.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 6d449e2b3..21f3619b6 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -2057,8 +2057,8 @@ struct gk20a { nvgpu_atomic_t sw_irq_nonstall_last_handled; int irqs_enabled; - int irq_stall; /* can be same as irq_nonstall in case of PCI */ - int irq_nonstall; + u32 irq_stall; /* can be same as irq_nonstall in case of PCI */ + u32 irq_nonstall; /* * The deductible memory size for max_comptag_mem (in MBytes) diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index c146bcb2f..27f9c9ff7 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -1362,7 +1362,7 @@ static int gk20a_probe(struct platform_device *dev) gk20a->irq_stall = platform_get_irq(dev, 0); gk20a->irq_nonstall = platform_get_irq(dev, 1); - if (gk20a->irq_stall < 0 || gk20a->irq_nonstall < 0) { + if ((int)gk20a->irq_stall < 0 || (int)gk20a->irq_nonstall < 0) { err = -ENXIO; goto return_err; } diff --git a/drivers/gpu/nvgpu/os/linux/pci.c b/drivers/gpu/nvgpu/os/linux/pci.c index 92db603bb..27575a7a7 100644 --- a/drivers/gpu/nvgpu/os/linux/pci.c +++ b/drivers/gpu/nvgpu/os/linux/pci.c @@ -633,7 +633,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, g->irq_stall = pdev->irq; g->irq_nonstall = pdev->irq; - if (g->irq_stall < 0) { + if ((int)g->irq_stall < 0) { err = -ENXIO; goto err_disable_msi; }