lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1456059084-22098-1-git-send-email-stefani@seibold.net>
Date:	Sun, 21 Feb 2016 13:51:24 +0100
From:	Stefani Seibold <stefani@...bold.net>
To:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	torvalds@...ux-foundation.org
Cc:	matija.glavinic-pecotic.ext@...ia.com,
	alexander.sverdlin@...ia.com, stefani@...bold.net
Subject: [PATCH] kfifo: fix sparse complains

This patch fix complains by the sparse tool when using kfifo_put() with non
scalar types like structures (i.e. drivers/iio/industrialio-event.c).

Casting a pointer to the value and read this pointer instead of directly casting
the value will fix this.

The generated code is equal.

Signed-off-by: Stefani Seibold <stefani@...bold.net>
---
 include/linux/kfifo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 473b436..41eb6fd 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -401,7 +401,7 @@ __kfifo_int_must_check_helper( \
 			((typeof(__tmp->type))__kfifo->data) : \
 			(__tmp->buf) \
 			)[__kfifo->in & __tmp->kfifo.mask] = \
-				(typeof(*__tmp->type))__val; \
+				*(typeof(__tmp->type))&__val; \
 			smp_wmb(); \
 			__kfifo->in++; \
 		} \
-- 
2.7.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ