HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: vendorcode/cavium/bdk/libdram: Add missing <stdlib.h> ......................................................................
vendorcode/cavium/bdk/libdram: Add missing <stdlib.h>
Change-Id: I9ded44422a267e244343502dd5d6ab355e5a788d Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c 1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/37378/1
diff --git a/src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c b/src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c index 291fe85..47eb07d 100644 --- a/src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c +++ b/src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c @@ -39,6 +39,7 @@ #include <bdk.h> #include "dram-internal.h"
+#include <stdlib.h> #include <string.h> #include <lame_string.h> /* for strtoul */ #include <libbdk-hal/bdk-atomic.h>
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: vendorcode/cavium/bdk/libdram: Add missing <stdlib.h> ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37378/6/src/vendorcode/cavium/bdk/l... File src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c:
https://review.coreboot.org/c/coreboot/+/37378/6/src/vendorcode/cavium/bdk/l... PS6, Line 1384: max( <stdlib.h>
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: vendorcode/cavium/bdk/libdram: Add missing <stdlib.h> ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37378/6/src/vendorcode/cavium/bdk/l... File src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c:
https://review.coreboot.org/c/coreboot/+/37378/6/src/vendorcode/cavium/bdk/l... PS6, Line 1384: max(
<stdlib. […]
max() probably does not belong into stdlib.h
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: vendorcode/cavium/bdk/libdram: Add missing <stdlib.h> ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37378/6/src/vendorcode/cavium/bdk/l... File src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c:
https://review.coreboot.org/c/coreboot/+/37378/6/src/vendorcode/cavium/bdk/l... PS6, Line 1384: max(
max() probably does not belong into stdlib. […]
defined here "dram-util.h" but not useful..:
#if 0 /* FIXME(dhendrix): min/max are defined in stdlib.h */ /** * Standard min(a,b) macro */ #define min(X, Y) \ ({ typeof (X) __x = (X); \ typeof (Y) __y = (Y); \ (__x < __y) ? __x : __y; })
/** * Standard max(a,b) macro */ #define max(X, Y) \ ({ typeof (X) __x = (X); typeof(Y) __y = (Y); \ (__x > __y) ? __x : __y; }) #endif
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: vendorcode/cavium/bdk/libdram: Add missing <stdlib.h> ......................................................................
Patch Set 6:
Wait for someone else to comment on this. My suggestion would be to use MAX() here and also remove existing defines of min() and max() in <stdlib.h>.
Hello David Hendricks, Idwer Vollering, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37378
to look at the new patch set (#7).
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
src/include: Remove min/max() from <stdlib.h>
Change-Id: I9ded44422a267e244343502dd5d6ab355e5a788d Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/include/stdlib.h M src/vendorcode/cavium/bdk/libdram/dram-util.h 2 files changed, 0 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/37378/7
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 8: Code-Review+1
Idwer Vollering has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 9:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37378/9/src/vendorcode/cavium/bdk/l... File src/vendorcode/cavium/bdk/libdram/dram-util.h:
https://review.coreboot.org/c/coreboot/+/37378/9/src/vendorcode/cavium/bdk/l... PS9, Line 49: */ Keep the comment block
Idwer Vollering has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 9:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37378/9/src/vendorcode/cavium/bdk/l... File src/vendorcode/cavium/bdk/libdram/dram-util.h:
https://review.coreboot.org/c/coreboot/+/37378/9/src/vendorcode/cavium/bdk/l... PS9, Line 46: /* FIXME(dhendrix): min/max are defined in stdlib.h */ Cut here
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 9: Code-Review+2
Hello Kyösti Mälkki, David Hendricks, Idwer Vollering, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37378
to look at the new patch set (#10).
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
src/include: Remove min/max() from <stdlib.h>
Change-Id: I9ded44422a267e244343502dd5d6ab355e5a788d Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/include/stdlib.h M src/vendorcode/cavium/bdk/libdram/dram-util.h 2 files changed, 0 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/37378/10
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 10:
(2 comments)
Thx
https://review.coreboot.org/c/coreboot/+/37378/9/src/vendorcode/cavium/bdk/l... File src/vendorcode/cavium/bdk/libdram/dram-util.h:
https://review.coreboot.org/c/coreboot/+/37378/9/src/vendorcode/cavium/bdk/l... PS9, Line 46: /* FIXME(dhendrix): min/max are defined in stdlib.h */
Cut here
Done
https://review.coreboot.org/c/coreboot/+/37378/9/src/vendorcode/cavium/bdk/l... PS9, Line 49: */
Keep the comment block
Done
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 10: Code-Review+2
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 10:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37378/6/src/vendorcode/cavium/bdk/l... File src/vendorcode/cavium/bdk/libdram/dram-tune-ddr3.c:
https://review.coreboot.org/c/coreboot/+/37378/6/src/vendorcode/cavium/bdk/l... PS6, Line 1384: max(
defined here "dram-util.h" but not useful..: […]
Done
HAOUAS Elyes has removed a vote from this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Removed Code-Review+2 by HAOUAS Elyes ehaouas@noos.fr
HAOUAS Elyes has removed a vote from this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Removed -Code-Review by HAOUAS Elyes ehaouas@noos.fr
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 11: Code-Review+1
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
Patch Set 12: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37378 )
Change subject: src/include: Remove min/max() from <stdlib.h> ......................................................................
src/include: Remove min/max() from <stdlib.h>
Change-Id: I9ded44422a267e244343502dd5d6ab355e5a788d Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Reviewed-on: https://review.coreboot.org/c/coreboot/+/37378 Reviewed-by: Patrick Georgi pgeorgi@google.com Reviewed-by: Kyösti Mälkki kyosti.malkki@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/include/stdlib.h M src/vendorcode/cavium/bdk/libdram/dram-util.h 2 files changed, 0 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved Kyösti Mälkki: Looks good to me, but someone else must approve
diff --git a/src/include/stdlib.h b/src/include/stdlib.h index 34ef93a..a8297f8 100644 --- a/src/include/stdlib.h +++ b/src/include/stdlib.h @@ -3,9 +3,6 @@
#include <stddef.h>
-#define min(a, b) MIN((a), (b)) -#define max(a, b) MAX((a), (b)) - void *memalign(size_t boundary, size_t size); void *malloc(size_t size); /* We never free memory */ diff --git a/src/vendorcode/cavium/bdk/libdram/dram-util.h b/src/vendorcode/cavium/bdk/libdram/dram-util.h index c9a96ba..f8ab6c1 100644 --- a/src/vendorcode/cavium/bdk/libdram/dram-util.h +++ b/src/vendorcode/cavium/bdk/libdram/dram-util.h @@ -42,8 +42,6 @@ * are not meant for users's of the libdram API. */
-#if 0 -/* FIXME(dhendrix): min/max are defined in stdlib.h */ /** * Standard min(a,b) macro */ @@ -58,7 +56,6 @@ #define max(X, Y) \ ({ typeof (X) __x = (X); typeof(Y) __y = (Y); \ (__x > __y) ? __x : __y; }) -#endif
/** * Absolute value of an integer