All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: zynq: Use unsigned type with comparison with ARRAY_SIZE
@ 2017-11-10 13:07 Michal Simek
  2017-12-05 20:33 ` Joe Hershberger
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2017-11-10 13:07 UTC (permalink / raw)
  To: u-boot

Sparse is return warning about this:
arch/arm/mach-zynq/slcr.c: In function 'zynq_slcr_get_mio_pin_status':
arch/arm/mach-zynq/slcr.c:185:16: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < ARRAY_SIZE(mio_periphs); i++) {
                ^

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/mach-zynq/slcr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index 2a207ae46c18..ba453a70248d 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -179,8 +179,9 @@ u32 zynq_slcr_get_idcode(void)
 int zynq_slcr_get_mio_pin_status(const char *periph)
 {
 	const struct zynq_slcr_mio_get_status *mio_ptr;
-	int val, i, j;
+	int val, j;
 	int mio = 0;
+	u32 i;
 
 	for (i = 0; i < ARRAY_SIZE(mio_periphs); i++) {
 		if (strcmp(periph, mio_periphs[i].peri_name) == 0) {
-- 
1.9.1

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

* [U-Boot] [PATCH] arm: zynq: Use unsigned type with comparison with ARRAY_SIZE
  2017-11-10 13:07 [U-Boot] [PATCH] arm: zynq: Use unsigned type with comparison with ARRAY_SIZE Michal Simek
@ 2017-12-05 20:33 ` Joe Hershberger
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Hershberger @ 2017-12-05 20:33 UTC (permalink / raw)
  To: u-boot

On Fri, Nov 10, 2017 at 7:07 AM, Michal Simek <michal.simek@xilinx.com> wrote:
> Sparse is return warning about this:
> arch/arm/mach-zynq/slcr.c: In function 'zynq_slcr_get_mio_pin_status':
> arch/arm/mach-zynq/slcr.c:185:16: warning: comparison between signed and
> unsigned integer expressions [-Wsign-compare]
>   for (i = 0; i < ARRAY_SIZE(mio_periphs); i++) {
>                 ^
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>

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

end of thread, other threads:[~2017-12-05 20:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 13:07 [U-Boot] [PATCH] arm: zynq: Use unsigned type with comparison with ARRAY_SIZE Michal Simek
2017-12-05 20:33 ` Joe Hershberger

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.