Skip to contentSkip to conversation

stdio_dev.h: Drop the video section as it is unused

PATCH New Tom Rini 2 participants 6 messages May 3, 2018 – May 6, 2018

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH v2 1/2 stdio_dev.h: Drop the video section as it is unused

With tighter build flags the fact that this header referenced uchar/ushort without including what typedefs it causes an error. Rather than add another include here, drop the section in question as it is unused.

---
Changes in v2:
- Reword slightly, add Tested-by

---
 include/stdio_dev.h | 18 ------------------
 1 file changed, 18 deletions(-)
include/stdio_dev.h +0 -18
index 3164fa2a5579..1ea8bff47bab 100644
@@ -49,24 +49,6 @@ struct stdio_dev {
 };
 
 /*
- * VIDEO EXTENSIONS
- */
-#define VIDEO_FORMAT_RGB_INDEXED	0x0000
-#define VIDEO_FORMAT_RGB_DIRECTCOLOR	0x0001
-#define VIDEO_FORMAT_YUYV_4_4_4		0x0010
-#define VIDEO_FORMAT_YUYV_4_2_2		0x0011
-
-typedef struct {
-	void *address;			/* Address of framebuffer		*/
-	ushort	width;			/* Horizontal resolution		*/
-	ushort	height;			/* Vertical resolution			*/
-	uchar	format;			/* Format				*/
-	uchar	colors;			/* Colors number or color depth		*/
-	void (*setcolreg) (int, int, int, int);
-	void (*getcolreg) (int, void *);
-} video_ext_t;
-
-/*
  * VARIABLES
  */
 extern struct stdio_dev *stdio_devices[];
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 1/2 stdio_dev.h: Drop the video section as it is unused

Quoted 8 lines · Tom Rini

With tighter build flags the fact that this header referenced uchar/ushort without including what typedefs it causes an error. Rather than add another include here, drop the section in question as it is unused.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180506/e72346ac/attachment.sig>
author
#2 lore raw

PATCH v2 2/2 stdio_names: Ensure MAX_NAMES is defined before use, don't use 3 directly

In reply to Tom Rini

With tighter build flags the fact that <stdio_dev.h> doesn't have a reference back to MAX_NAMES causes an error. Include <stdio.h> here and then in common/console.c use MAX_NAMES rather than 3 when working with stdio_names.

---
Changes in v2:
- New patch

---
 common/console.c    | 4 ++--
 include/stdio_dev.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
common/console.c +2 -2
index 0e0295514b21..f1a5e95c8f39 100644
@@ -847,7 +847,7 @@ done:
 
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
 	/* set the environment variables (will overwrite previous env settings) */
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < MAX_NAMES; i++) {
 		env_set(stdio_names[i], stdio_devices[i]->name);
 	}
 #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
@@ -926,7 +926,7 @@ int console_init_r(void)
 #endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
 
 	/* Setting environment variables */
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < MAX_NAMES; i++) {
 		env_set(stdio_names[i], stdio_devices[i]->name);
 	}
 
include/stdio_dev.h +1 -0
index 1ea8bff47bab..c2a88b4fc416 100644
@@ -8,6 +8,7 @@
 #ifndef _STDIO_DEV_H_
 #define _STDIO_DEV_H_
 
+#include <stdio.h>
 #include <linux/list.h>
 
 /*
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 2/2 stdio_names: Ensure MAX_NAMES is defined before use, don't use 3 directly

Quoted 20 lines · Tom Rini

With tighter build flags the fact that <stdio_dev.h> doesn't have a reference back to MAX_NAMES causes an error. Include <stdio.h> here and then in common/console.c use MAX_NAMES rather than 3 when working with stdio_names.

---
Changes in v2:
- New patch

---
 common/console.c    | 4 ++--
 include/stdio_dev.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
common/console.c +0 -0
index 0e0295514b21..f1a5e95c8f39 100644

common/console.c done: · line 850

Quoted 5 lines
common/console.c +1 -1
@@ -847,7 +847,7 @@ done:
 
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
        /* set the environment variables (will overwrite previous env settings) */
-       for (i = 0; i < 3; i++) {
+       for (i = 0; i < MAX_NAMES; i++) {

I think you mean MAX_FILES? With MAX_NAMES it fails, with MAX_FILES it builds.

With the that change, if it's correct:

Quoted 31 lines
common/console.c +1 -1
                env_set(stdio_names[i], stdio_devices[i]->name);
        }
 #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
@@ -926,7 +926,7 @@ int console_init_r(void)
 #endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
 
        /* Setting environment variables */
-       for (i = 0; i < 3; i++) {
+       for (i = 0; i < MAX_NAMES; i++) {
                env_set(stdio_names[i], stdio_devices[i]->name);
        }
 
include/stdio_dev.h +1 -1
index 1ea8bff47bab..c2a88b4fc416 100644
@@ -8,6 +8,7 @@
 #ifndef _STDIO_DEV_H_
 #define _STDIO_DEV_H_
 
+#include <stdio.h>
 #include <linux/list.h>
 
 /*
--

2.7.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

author
#4 lore raw

PATCH v2 2/2 stdio_names: Ensure MAX_NAMES is defined before use, don't use 3 directly

Quoted 29 lines · Peter Robinson
Quoted 20 lines · Tom Rini

With tighter build flags the fact that <stdio_dev.h> doesn't have a reference back to MAX_NAMES causes an error. Include <stdio.h> here and then in common/console.c use MAX_NAMES rather than 3 when working with stdio_names.

---
Changes in v2:
- New patch

---
 common/console.c    | 4 ++--
 include/stdio_dev.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
common/console.c +0 -0
index 0e0295514b21..f1a5e95c8f39 100644

common/console.c done: · line 850

Quoted 5 lines
common/console.c +1 -1
@@ -847,7 +847,7 @@ done:
 
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
        /* set the environment variables (will overwrite previous env settings) */
-       for (i = 0; i < 3; i++) {
+       for (i = 0; i < MAX_NAMES; i++) {

I think you mean MAX_FILES? With MAX_NAMES it fails, with MAX_FILES it builds.

Quoted 2 lines

With the that change, if it's correct:

If anyone is wonder if I'll ever learn to not post something I quickly did and was sure it was right, the answer is no. But I don't push those changes out (on purpose) at least! I'll fix it up before merging, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180503/c20eeaff/attachment.sig>
author
#5 lore raw

PATCH v2 2/2 stdio_names: Ensure MAX_NAMES is defined before use, don't use 3 directly

In reply to Tom Rini
Quoted 8 lines · Tom Rini

With tighter build flags the fact that <stdio_dev.h> doesn't have a reference back to MAX_NAMES causes an error. Include <stdio.h> here and then in common/console.c use MAX_NAMES rather than 3 when working with stdio_names.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180506/70a8d7df/attachment.sig>