All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf: arm-cmn: Fix unsigned comparison to less than zero
@ 2020-10-01 11:03 Will Deacon
  2020-10-01 11:03 ` [PATCH 2/2] perf: arm-cmn: Fix conversion specifiers for node type Will Deacon
  2020-10-01 15:45 ` [PATCH 1/2] perf: arm-cmn: Fix unsigned comparison to less than zero Gustavo A. R. Silva
  0 siblings, 2 replies; 3+ messages in thread
From: Will Deacon @ 2020-10-01 11:03 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Will Deacon, robin.murphy, Gustavo A . R . Silva

Ensure that the 'irq' field of 'struct arm_cmn_dtc' is a signed int
so that it can be compared '< 0'.

Link: https://lore.kernel.org/r/20200929170835.GA15956@embeddedor
Addresses-Coverity-ID: 1497488 ("Unsigned compared against 0")
Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
Reported-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
---
 drivers/perf/arm-cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index e824b5b83ea2..cd4da4c5dac0 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -217,7 +217,7 @@ struct arm_cmn_node {
 
 struct arm_cmn_dtc {
 	void __iomem *base;
-	unsigned int irq;
+	int irq;
 	int irq_friend;
 	bool cc_active;
 
-- 
2.28.0.709.gb0816b6eb0-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] perf: arm-cmn: Fix conversion specifiers for node type
  2020-10-01 11:03 [PATCH 1/2] perf: arm-cmn: Fix unsigned comparison to less than zero Will Deacon
@ 2020-10-01 11:03 ` Will Deacon
  2020-10-01 15:45 ` [PATCH 1/2] perf: arm-cmn: Fix unsigned comparison to less than zero Gustavo A. R. Silva
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2020-10-01 11:03 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Will Deacon, robin.murphy, kernel test robot

The node type field is an enum type, so print it as a 32-bit quantity
rather than as an unsigned short.

Link: https://lore.kernel.org/r/202009302350.QIzfkx62-lkp@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Will Deacon <will@kernel.org>
---
 drivers/perf/arm-cmn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index cd4da4c5dac0..a76ff594f3ca 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -1324,7 +1324,7 @@ static void arm_cmn_init_node_info(struct arm_cmn *cmn, u32 offset, struct arm_c
 	else
 		level = 2;
 
-	dev_dbg(cmn->dev, "node%*c%#06hx%*ctype:%-#6hx id:%-4hd off:%#x\n",
+	dev_dbg(cmn->dev, "node%*c%#06hx%*ctype:%-#6x id:%-4hd off:%#x\n",
 			(level * 2) + 1, ' ', node->id, 5 - (level * 2), ' ',
 			node->type, node->logid, offset);
 }
@@ -1430,7 +1430,7 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
 				break;
 			/* Something has gone horribly wrong */
 			default:
-				dev_err(cmn->dev, "invalid device node type: 0x%hx\n", dn->type);
+				dev_err(cmn->dev, "invalid device node type: 0x%x\n", dn->type);
 				return -ENODEV;
 			}
 		}
-- 
2.28.0.709.gb0816b6eb0-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] perf: arm-cmn: Fix unsigned comparison to less than zero
  2020-10-01 11:03 [PATCH 1/2] perf: arm-cmn: Fix unsigned comparison to less than zero Will Deacon
  2020-10-01 11:03 ` [PATCH 2/2] perf: arm-cmn: Fix conversion specifiers for node type Will Deacon
@ 2020-10-01 15:45 ` Gustavo A. R. Silva
  1 sibling, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2020-10-01 15:45 UTC (permalink / raw)
  To: Will Deacon; +Cc: robin.murphy, linux-arm-kernel

On Thu, Oct 01, 2020 at 12:03:14PM +0100, Will Deacon wrote:
> Ensure that the 'irq' field of 'struct arm_cmn_dtc' is a signed int
> so that it can be compared '< 0'.
> 
> Link: https://lore.kernel.org/r/20200929170835.GA15956@embeddedor
> Addresses-Coverity-ID: 1497488 ("Unsigned compared against 0")
> Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
> Reported-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> Signed-off-by: Will Deacon <will@kernel.org>

Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Thanks
--
Gustavo

> ---
>  drivers/perf/arm-cmn.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
> index e824b5b83ea2..cd4da4c5dac0 100644
> --- a/drivers/perf/arm-cmn.c
> +++ b/drivers/perf/arm-cmn.c
> @@ -217,7 +217,7 @@ struct arm_cmn_node {
>  
>  struct arm_cmn_dtc {
>  	void __iomem *base;
> -	unsigned int irq;
> +	int irq;
>  	int irq_friend;
>  	bool cc_active;
>  
> -- 
> 2.28.0.709.gb0816b6eb0-goog
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-01 15:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-01 11:03 [PATCH 1/2] perf: arm-cmn: Fix unsigned comparison to less than zero Will Deacon
2020-10-01 11:03 ` [PATCH 2/2] perf: arm-cmn: Fix conversion specifiers for node type Will Deacon
2020-10-01 15:45 ` [PATCH 1/2] perf: arm-cmn: Fix unsigned comparison to less than zero Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.