[ipxe-devel] [PATCH] [build] Remove nested 'my' declaration.

2016-05-27 Thread Vinson Lee
Fix build error with perl >= 5.23.2.

Can't redeclare "my" in "my" at ./util/parserom.pl line 160, near ", "

Fixes: 68d8a44469ecd ("[build] Rewrite parserom.pl to support multiple source 
files")
Signed-off-by: Vinson Lee <v...@freedesktop.org>
---
 src/util/parserom.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/parserom.pl b/src/util/parserom.pl
index 28df606..5a849a5 100755
--- a/src/util/parserom.pl
+++ b/src/util/parserom.pl
@@ -157,7 +157,7 @@ sub process_isa_rom {
 
 # Output Makefile rules for the specified ROM declarations
 sub print_make_rules {
-my ( $state, my $image, my $desc, my $vendor, my $device, my $dup ) = @_;
+my ( $state, $image, $desc, $vendor, $device, $dup ) = @_;
 unless ( $state->{'is_header_printed'} ) {
 print "# NIC\t\n";
 print "# NIC\tfamily\t$state->{family}\n";
-- 
2.8.3

___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel


[ipxe-devel] [PATCH] [mcurses] Fix GCC 6 nonnull-compare errors.

2016-02-27 Thread Vinson Lee
Remove null checks for arguments declared as nonnull.

  [BUILD] bin/windows.o
hci/mucurses/windows.c: In function ‘delwin’:
hci/mucurses/windows.c:21:5: error: nonnull argument ‘win’ compared to NULL 
[-Werror=nonnull-compare]
  if ( win == NULL )
 ^
hci/mucurses/windows.c: In function ‘derwin’:
hci/mucurses/windows.c:54:5: error: nonnull argument ‘parent’ compared to NULL 
[-Werror=nonnull-compare]
  if ( parent == NULL )
 ^
hci/mucurses/windows.c: In function ‘dupwin’:
hci/mucurses/windows.c:78:5: error: nonnull argument ‘orig’ compared to NULL 
[-Werror=nonnull-compare]
  if ( orig == NULL )
 ^
hci/mucurses/windows.c: In function ‘mvwin’:
hci/mucurses/windows.c:102:5: error: nonnull argument ‘win’ compared to NULL 
[-Werror=nonnull-compare]
  if ( win == NULL )
 ^
hci/mucurses/windows.c: In function ‘subwin’:
hci/mucurses/windows.c:152:5: error: nonnull argument ‘parent’ compared to NULL 
[-Werror=nonnull-compare]
  if ( parent == NULL )
 ^

Fixes: d39e79248c2d ("__nonnull changes")
Signed-off-by: Vinson Lee <v...@freedesktop.org>
---
 src/hci/mucurses/windows.c | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/src/hci/mucurses/windows.c b/src/hci/mucurses/windows.c
index 7f39bdea2b7d..5f5d1f4e2a16 100644
--- a/src/hci/mucurses/windows.c
+++ b/src/hci/mucurses/windows.c
@@ -18,9 +18,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  * @ret rc return status code
  */
 int delwin ( WINDOW *win ) {
-   if ( win == NULL )
-   return ERR;
-
/* I think we should blank the region covered by the window -
   ncurses doesn't do this, but they have a buffer, so they
   may just be deleting from an offscreen context whereas we
@@ -51,8 +48,6 @@ int delwin ( WINDOW *win ) {
 WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
 int begin_y, int begin_x ) {
WINDOW *child;
-   if ( parent == NULL )
-   return NULL;
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
if ( ( (unsigned)ncols > parent->width ) || 
@@ -75,8 +70,6 @@ WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
  */
 WINDOW *dupwin ( WINDOW *orig ) {
WINDOW *copy;
-   if ( orig == NULL )
-   return NULL;
if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
copy->scr = orig->scr;
@@ -99,8 +92,6 @@ WINDOW *dupwin ( WINDOW *orig ) {
  * @ret rc return status code
  */
 int mvwin ( WINDOW *win, int y, int x ) {
-   if ( win == NULL )
-   return ERR;
if ( ( ( (unsigned)y + win->height ) > LINES ) ||
 ( ( (unsigned)x + win->width ) > COLS ) )
return ERR;
@@ -149,8 +140,6 @@ WINDOW *newwin ( int nlines, int ncols, int begin_y, int 
begin_x ) {
 WINDOW *subwin ( WINDOW *parent, int nlines, int ncols,
 int begin_y, int begin_x ) {
WINDOW *child;
-   if ( parent == NULL )
-   return NULL;
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
child = newwin( nlines, ncols, begin_y, begin_x );
-- 
2.7.1

___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel


[ipxe-devel] [PATCH] [mcurses] Fix GCC 6 nonnull-compare errors.

2016-02-27 Thread Vinson Lee
Remove null checks for arguments declared as nonnull.

  [BUILD] bin/windows.o
hci/mucurses/windows.c: In function ‘delwin’:
hci/mucurses/windows.c:21:5: error: nonnull argument ‘win’ compared to NULL 
[-Werror=nonnull-compare]
  if ( win == NULL )
 ^
hci/mucurses/windows.c: In function ‘derwin’:
hci/mucurses/windows.c:54:5: error: nonnull argument ‘parent’ compared to NULL 
[-Werror=nonnull-compare]
  if ( parent == NULL )
 ^
hci/mucurses/windows.c: In function ‘dupwin’:
hci/mucurses/windows.c:78:5: error: nonnull argument ‘orig’ compared to NULL 
[-Werror=nonnull-compare]
  if ( orig == NULL )
 ^
hci/mucurses/windows.c: In function ‘mvwin’:
hci/mucurses/windows.c:102:5: error: nonnull argument ‘win’ compared to NULL 
[-Werror=nonnull-compare]
  if ( win == NULL )
 ^
hci/mucurses/windows.c: In function ‘subwin’:
hci/mucurses/windows.c:152:5: error: nonnull argument ‘parent’ compared to NULL 
[-Werror=nonnull-compare]
  if ( parent == NULL )
 ^

Fixes: d39e79248c2d ("__nonnull changes")
Signed-off-by: Vinson Lee <v...@freedesktop.org>
---
 src/hci/mucurses/windows.c | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/src/hci/mucurses/windows.c b/src/hci/mucurses/windows.c
index 7f39bdea2b7d..5f5d1f4e2a16 100644
--- a/src/hci/mucurses/windows.c
+++ b/src/hci/mucurses/windows.c
@@ -18,9 +18,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  * @ret rc return status code
  */
 int delwin ( WINDOW *win ) {
-   if ( win == NULL )
-   return ERR;
-
/* I think we should blank the region covered by the window -
   ncurses doesn't do this, but they have a buffer, so they
   may just be deleting from an offscreen context whereas we
@@ -51,8 +48,6 @@ int delwin ( WINDOW *win ) {
 WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
 int begin_y, int begin_x ) {
WINDOW *child;
-   if ( parent == NULL )
-   return NULL;
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
if ( ( (unsigned)ncols > parent->width ) || 
@@ -75,8 +70,6 @@ WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
  */
 WINDOW *dupwin ( WINDOW *orig ) {
WINDOW *copy;
-   if ( orig == NULL )
-   return NULL;
if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
copy->scr = orig->scr;
@@ -99,8 +92,6 @@ WINDOW *dupwin ( WINDOW *orig ) {
  * @ret rc return status code
  */
 int mvwin ( WINDOW *win, int y, int x ) {
-   if ( win == NULL )
-   return ERR;
if ( ( ( (unsigned)y + win->height ) > LINES ) ||
 ( ( (unsigned)x + win->width ) > COLS ) )
return ERR;
@@ -149,8 +140,6 @@ WINDOW *newwin ( int nlines, int ncols, int begin_y, int 
begin_x ) {
 WINDOW *subwin ( WINDOW *parent, int nlines, int ncols,
 int begin_y, int begin_x ) {
WINDOW *child;
-   if ( parent == NULL )
-   return NULL;
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
child = newwin( nlines, ncols, begin_y, begin_x );
-- 
2.7.1

___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel


[ipxe-devel] [PATCH] [mcurses] Fix GCC 6 nonnull-compare errors.

2016-04-15 Thread Vinson Lee
Remove null checks for arguments declared as nonnull.

  [BUILD] bin/windows.o
hci/mucurses/windows.c: In function ‘delwin’:
hci/mucurses/windows.c:21:5: error: nonnull argument ‘win’ compared to NULL 
[-Werror=nonnull-compare]
  if ( win == NULL )
 ^
hci/mucurses/windows.c: In function ‘derwin’:
hci/mucurses/windows.c:54:5: error: nonnull argument ‘parent’ compared to NULL 
[-Werror=nonnull-compare]
  if ( parent == NULL )
 ^
hci/mucurses/windows.c: In function ‘dupwin’:
hci/mucurses/windows.c:78:5: error: nonnull argument ‘orig’ compared to NULL 
[-Werror=nonnull-compare]
  if ( orig == NULL )
 ^
hci/mucurses/windows.c: In function ‘mvwin’:
hci/mucurses/windows.c:102:5: error: nonnull argument ‘win’ compared to NULL 
[-Werror=nonnull-compare]
  if ( win == NULL )
 ^
hci/mucurses/windows.c: In function ‘subwin’:
hci/mucurses/windows.c:152:5: error: nonnull argument ‘parent’ compared to NULL 
[-Werror=nonnull-compare]
  if ( parent == NULL )
 ^

Fixes: d39e79248c2d ("__nonnull changes")
Signed-off-by: Vinson Lee <v...@freedesktop.org>
---
 src/hci/mucurses/windows.c | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/src/hci/mucurses/windows.c b/src/hci/mucurses/windows.c
index 7f39bdea2b7d..5f5d1f4e2a16 100644
--- a/src/hci/mucurses/windows.c
+++ b/src/hci/mucurses/windows.c
@@ -18,9 +18,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  * @ret rc return status code
  */
 int delwin ( WINDOW *win ) {
-   if ( win == NULL )
-   return ERR;
-
/* I think we should blank the region covered by the window -
   ncurses doesn't do this, but they have a buffer, so they
   may just be deleting from an offscreen context whereas we
@@ -51,8 +48,6 @@ int delwin ( WINDOW *win ) {
 WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
 int begin_y, int begin_x ) {
WINDOW *child;
-   if ( parent == NULL )
-   return NULL;
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
if ( ( (unsigned)ncols > parent->width ) || 
@@ -75,8 +70,6 @@ WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
  */
 WINDOW *dupwin ( WINDOW *orig ) {
WINDOW *copy;
-   if ( orig == NULL )
-   return NULL;
if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
copy->scr = orig->scr;
@@ -99,8 +92,6 @@ WINDOW *dupwin ( WINDOW *orig ) {
  * @ret rc return status code
  */
 int mvwin ( WINDOW *win, int y, int x ) {
-   if ( win == NULL )
-   return ERR;
if ( ( ( (unsigned)y + win->height ) > LINES ) ||
 ( ( (unsigned)x + win->width ) > COLS ) )
return ERR;
@@ -149,8 +140,6 @@ WINDOW *newwin ( int nlines, int ncols, int begin_y, int 
begin_x ) {
 WINDOW *subwin ( WINDOW *parent, int nlines, int ncols,
 int begin_y, int begin_x ) {
WINDOW *child;
-   if ( parent == NULL )
-   return NULL;
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
return NULL;
child = newwin( nlines, ncols, begin_y, begin_x );
-- 
2.7.1

___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel


[ipxe-devel] [PATCH] [build] Ignore GCC 7 implicit-fallthrough errors.

2017-02-13 Thread Vinson Lee
GCC 7 -Wextra now enables -Wimplicit-fallthrough.

https://gcc.gnu.org/gcc-7/changes.html

$ make
[...]
  [BUILD] bin/igbvf_vf.o
drivers/net/igbvf/igbvf_vf.c: In function ‘igbvf_promisc_set_vf’:
drivers/net/igbvf/igbvf_vf.c:359:10: error: this statement may fall through 
[-Werror=implicit-fallthrough=]
   msgbuf |= E1000_VF_SET_PROMISC_MULTICAST;
drivers/net/igbvf/igbvf_vf.c:360:2: note: here
  case e1000_promisc_unicast:
  ^~~~

Signed-off-by: Vinson Lee <v...@freedesktop.org>
---
 src/Makefile.housekeeping | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index f09db37289e3..5e67fbc3bc24 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -179,6 +179,13 @@ WNA_FLAGS := $(shell $(WNA_TEST) && $(ECHO) '-Wno-address')
 WORKAROUND_CFLAGS += $(WNA_FLAGS)
 endif
 
+# gcc 7.0 -Wextra enables -Wimplicit-fallthrough.
+ifeq ($(CCTYPE),gcc)
+WNIF_TEST = $(CC) -Wno-implicit-fallthrough -x c -c /dev/null -o /dev/null 
>/dev/null 2>&1
+WNIF_FLAGS := $(shell $(WNIF_TEST) && $(ECHO) '-Wno-implicit-fallthrough')
+WORKAROUND_CFLAGS += $(WNIF_FLAGS)
+endif
+
 # Some versions of gas choke on division operators, treating them as
 # comment markers.  Specifying --divide will work around this problem,
 # but isn't available on older gas versions.
-- 
2.11.1

___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel