Re: [PATCH 02/10] sandbox: Drop CONFIG_HOST_MAX_DEVICES

2021-11-14 Thread Heinrich Schuchardt

On 11/14/21 04:21, Simon Glass wrote:

This can go in the related header file. Drop the CONFIG option.


4 devices seems to be adequate.

Reviewed-by: Heinrich Schuchardt 



Signed-off-by: Simon Glass 
---

  cmd/host.c   | 2 +-
  drivers/block/sandbox.c  | 6 +++---
  include/configs/sandbox.h| 2 --
  include/sandboxblockdev.h| 3 +++
  scripts/config_whitelist.txt | 1 -
  5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cmd/host.c b/cmd/host.c
index 2e998abbcdc..f0d989ac0f9 100644
--- a/cmd/host.c
+++ b/cmd/host.c
@@ -78,7 +78,7 @@ static int do_host_info(struct cmd_tbl *cmdtp, int flag, int 
argc,
if (argc < 1 || argc > 2)
return CMD_RET_USAGE;
int min_dev = 0;
-   int max_dev = CONFIG_HOST_MAX_DEVICES - 1;
+   int max_dev = SANDBOX_HOST_MAX_DEVICES - 1;
if (argc >= 2) {
char *ep;
char *dev_str = argv[1];
diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c
index 1c2c3b4f886..53925ce9b69 100644
--- a/drivers/block/sandbox.c
+++ b/drivers/block/sandbox.c
@@ -19,11 +19,11 @@
  DECLARE_GLOBAL_DATA_PTR;

  #ifndef CONFIG_BLK
-static struct host_block_dev host_devices[CONFIG_HOST_MAX_DEVICES];
+static struct host_block_dev host_devices[SANDBOX_HOST_MAX_DEVICES];

  static struct host_block_dev *find_host_device(int dev)
  {
-   if (dev >= 0 && dev < CONFIG_HOST_MAX_DEVICES)
+   if (dev >= 0 && dev < SANDBOX_HOST_MAX_DEVICES)
return _devices[dev];

return NULL;
@@ -259,7 +259,7 @@ U_BOOT_DRIVER(sandbox_host_blk) = {
  U_BOOT_LEGACY_BLK(sandbox_host) = {
.if_typename= "host",
.if_type= IF_TYPE_HOST,
-   .max_devs   = CONFIG_HOST_MAX_DEVICES,
+   .max_devs   = SANDBOX_HOST_MAX_DEVICES,
.get_dev= host_get_dev_err,
  };
  #endif
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index d614b704715..ea6080869a8 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -14,8 +14,6 @@
  #define CONFIG_SYS_TIMER_RATE 100
  #endif

-#define CONFIG_HOST_MAX_DEVICES 4
-
  #define CONFIG_MALLOC_F_ADDR  0x001

  #define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */
diff --git a/include/sandboxblockdev.h b/include/sandboxblockdev.h
index 4006e942a02..4ca9554e38a 100644
--- a/include/sandboxblockdev.h
+++ b/include/sandboxblockdev.h
@@ -6,6 +6,9 @@
  #ifndef __SANDBOX_BLOCK_DEV__
  #define __SANDBOX_BLOCK_DEV__

+/* Maximum number of host devices - see drivers/block/sandbox.c */
+#define SANDBOX_HOST_MAX_DEVICES   4
+
  struct host_block_dev {
  #ifndef CONFIG_BLK
struct blk_desc blk_dev;
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index b9c1c61e13d..10f7a6d4c08 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -440,7 +440,6 @@ CONFIG_HIDE_LOGO_VERSION
  CONFIG_HIKEY_GPIO
  CONFIG_HITACHI_SX14
  CONFIG_HOSTNAME
-CONFIG_HOST_MAX_DEVICES
  CONFIG_HPS_ALTERAGRP_DBGATCLK
  CONFIG_HPS_ALTERAGRP_MAINCLK
  CONFIG_HPS_ALTERAGRP_MPUCLK





[PATCH 02/10] sandbox: Drop CONFIG_HOST_MAX_DEVICES

2021-11-13 Thread Simon Glass
This can go in the related header file. Drop the CONFIG option.

Signed-off-by: Simon Glass 
---

 cmd/host.c   | 2 +-
 drivers/block/sandbox.c  | 6 +++---
 include/configs/sandbox.h| 2 --
 include/sandboxblockdev.h| 3 +++
 scripts/config_whitelist.txt | 1 -
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cmd/host.c b/cmd/host.c
index 2e998abbcdc..f0d989ac0f9 100644
--- a/cmd/host.c
+++ b/cmd/host.c
@@ -78,7 +78,7 @@ static int do_host_info(struct cmd_tbl *cmdtp, int flag, int 
argc,
if (argc < 1 || argc > 2)
return CMD_RET_USAGE;
int min_dev = 0;
-   int max_dev = CONFIG_HOST_MAX_DEVICES - 1;
+   int max_dev = SANDBOX_HOST_MAX_DEVICES - 1;
if (argc >= 2) {
char *ep;
char *dev_str = argv[1];
diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c
index 1c2c3b4f886..53925ce9b69 100644
--- a/drivers/block/sandbox.c
+++ b/drivers/block/sandbox.c
@@ -19,11 +19,11 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifndef CONFIG_BLK
-static struct host_block_dev host_devices[CONFIG_HOST_MAX_DEVICES];
+static struct host_block_dev host_devices[SANDBOX_HOST_MAX_DEVICES];
 
 static struct host_block_dev *find_host_device(int dev)
 {
-   if (dev >= 0 && dev < CONFIG_HOST_MAX_DEVICES)
+   if (dev >= 0 && dev < SANDBOX_HOST_MAX_DEVICES)
return _devices[dev];
 
return NULL;
@@ -259,7 +259,7 @@ U_BOOT_DRIVER(sandbox_host_blk) = {
 U_BOOT_LEGACY_BLK(sandbox_host) = {
.if_typename= "host",
.if_type= IF_TYPE_HOST,
-   .max_devs   = CONFIG_HOST_MAX_DEVICES,
+   .max_devs   = SANDBOX_HOST_MAX_DEVICES,
.get_dev= host_get_dev_err,
 };
 #endif
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index d614b704715..ea6080869a8 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -14,8 +14,6 @@
 #define CONFIG_SYS_TIMER_RATE  100
 #endif
 
-#define CONFIG_HOST_MAX_DEVICES 4
-
 #define CONFIG_MALLOC_F_ADDR   0x001
 
 #define CONFIG_SYS_CBSIZE  1024/* Console I/O Buffer Size */
diff --git a/include/sandboxblockdev.h b/include/sandboxblockdev.h
index 4006e942a02..4ca9554e38a 100644
--- a/include/sandboxblockdev.h
+++ b/include/sandboxblockdev.h
@@ -6,6 +6,9 @@
 #ifndef __SANDBOX_BLOCK_DEV__
 #define __SANDBOX_BLOCK_DEV__
 
+/* Maximum number of host devices - see drivers/block/sandbox.c */
+#define SANDBOX_HOST_MAX_DEVICES   4
+
 struct host_block_dev {
 #ifndef CONFIG_BLK
struct blk_desc blk_dev;
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index b9c1c61e13d..10f7a6d4c08 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -440,7 +440,6 @@ CONFIG_HIDE_LOGO_VERSION
 CONFIG_HIKEY_GPIO
 CONFIG_HITACHI_SX14
 CONFIG_HOSTNAME
-CONFIG_HOST_MAX_DEVICES
 CONFIG_HPS_ALTERAGRP_DBGATCLK
 CONFIG_HPS_ALTERAGRP_MAINCLK
 CONFIG_HPS_ALTERAGRP_MPUCLK
-- 
2.34.0.rc1.387.gb447b232ab-goog