commonspartan
PATCH 1/1 commonspartan
ChangeLog:
* Patch by Kai-Uwe Bloem, Robert Schwebel, 13 May 2004:
When code is compiled without -fsigned-char compiler claims about 'always false due to limited data type'. This patch doesn't change functionality but makes it work on fussy 2.95.3-arm compilers.
Robert
Signature · 40 lines
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hornemannstra?e 12, 31137 Hildesheim, Germany
Phone: +49-5121-28619-0 | Fax: +49-5121-28619-4
-------------- next part --------------
#
# Author: Robert Schwebel <[email protected]>
#
# Description: Changelog Entry:
#
# * Patch by Kai-Uwe Bloem, Robert Schwebel, 13 May 2004:
# When code is compiled without -fsigned-char compiler
# claims about 'always false due to limited data type'.
# This patch doesn't change functionality but makes it
# work on fussy 2.95.3-arm compilers.
#
# State: 2003-12-09: submitted
#
# 2004-01-04: WD: "Please explain why you think this patch
# is needed, i. e. which problem it fixes. At least provide a
# CHANGELOG entry."
#
# 2004-05-13: Changelog Entry added, resubmit
#
# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
#
--- u-boot-patches/common/spartan2.c~commonspartan 2003-07-24 16:59:42.000000000 +0200
+++ u-boot-patches/common/spartan2.c 2003-12-09 08:52:06.000000000 +0100
@@ -516,7 +516,7 @@
(*fn->clk) (FALSE, TRUE, cookie);
CONFIG_FPGA_DELAY ();
/* Write data */
- (*fn->wr) ((val < 0), TRUE, cookie);
+ (*fn->wr) ((val & 0x80), TRUE, cookie);
CONFIG_FPGA_DELAY ();
/* Assert the clock */
(*fn->clk) (TRUE, TRUE, cookie);PATCH 1/1 commonspartan
Quoted 6 lines · In message <[email protected]> you wrote:
* Patch by Kai-Uwe Bloem, Robert Schwebel, 13 May 2004:
When code is compiled without -fsigned-char compiler claims about 'always false due to limited data type'. This patch doesn't change functionality but makes it work on fussy 2.95.3-arm compilers.
...
char val;
...
Review
Quoted 2 lines
(quoted diff) +1
-1- (*fn->wr) ((val < 0), TRUE, cookie); + (*fn->wr) ((val & 0x80), TRUE, cookie);
Actually I don't like the idea of testing the MSB when I really want to test for <0; maybe the correct way to fix this warning is to make val a "signed char" instead?
What do you think?
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] There are three things I always forget. Names, faces - the third I can't remember. - Italo Svevo