All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] LzmaTools: don't self assign values
@ 2014-06-10 21:37 Jeroen Hofstee
  2014-06-11 22:20 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Jeroen Hofstee @ 2014-06-10 21:37 UTC (permalink / raw)
  To: u-boot

It seems the code tries to trick the compiler the argument
is actually used. However compilers became too smart to
fool them so easily an now warn. Gcc and clang don't seem
to emit a warning when the argument is unused. If so it
should be decorated with unused / (void).

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
---
 lib/lzma/LzmaTools.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/lzma/LzmaTools.c b/lib/lzma/LzmaTools.c
index 90d31cd..cfc7cb0 100644
--- a/lib/lzma/LzmaTools.c
+++ b/lib/lzma/LzmaTools.c
@@ -34,8 +34,8 @@
 #include <linux/string.h>
 #include <malloc.h>
 
-static void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }
-static void SzFree(void *p, void *address) { p = p; free(address); }
+static void *SzAlloc(void *p, size_t size) { return malloc(size); }
+static void SzFree(void *p, void *address) { free(address); }
 
 int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize,
                   unsigned char *inStream,  SizeT  length)
-- 
1.8.3.2

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

* [U-Boot] LzmaTools: don't self assign values
  2014-06-10 21:37 [U-Boot] [PATCH] LzmaTools: don't self assign values Jeroen Hofstee
@ 2014-06-11 22:20 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2014-06-11 22:20 UTC (permalink / raw)
  To: u-boot

On Tue, Jun 10, 2014 at 11:37:23PM +0200, Jeroen Hofstee wrote:

> It seems the code tries to trick the compiler the argument
> is actually used. However compilers became too smart to
> fool them so easily an now warn. Gcc and clang don't seem
> to emit a warning when the argument is unused. If so it
> should be decorated with unused / (void).
> 
> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140611/18f8559f/attachment.pgp>

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

end of thread, other threads:[~2014-06-11 22:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-10 21:37 [U-Boot] [PATCH] LzmaTools: don't self assign values Jeroen Hofstee
2014-06-11 22:20 ` [U-Boot] " Tom Rini

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.