Skip to contentSkip to conversation

dfu: Delete superfluous initialization of the dfu_buf_size static variable

PATCH New Lukasz Majewski 2 participants 2 messages Jul 8, 2015 – Aug 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dfu: Delete superfluous initialization of the dfu_buf_size static variable

After extension of the dfu_get_buf() to also setup (implicitly) the dfu_buf_size variable it is not needed to set dfu_buf_size to CONFIG_SYS_DFU_DATA_BUF_SIZE.

This variable is set in the dfu_get_buf() by not only considering CONFIG_SYS_DFU_DATA_BUF but more importantly the "dfu_bufsiz" env variable. Therefore, dfu_get_buf() should be used for initialization.

---
 drivers/dfu/dfu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dfu/dfu.c +1 -1
index 0560afa..332be67 100644
@@ -76,7 +76,7 @@ int dfu_init_env_entities(char *interface, char *devstr)
 }
 
 static unsigned char *dfu_buf;
-static unsigned long dfu_buf_size = CONFIG_SYS_DFU_DATA_BUF_SIZE;
+static unsigned long dfu_buf_size;
 
 unsigned char *dfu_free_buf(void)
 {
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 dfu: Delete superfluous initialization of the dfu_buf_size static variable

Hello Lukasz,

Quoted 18 lines · Lukasz Majewski

After extension of the dfu_get_buf() to also setup (implicitly) the dfu_buf_size variable it is not needed to set dfu_buf_size to CONFIG_SYS_DFU_DATA_BUF_SIZE.

This variable is set in the dfu_get_buf() by not only considering CONFIG_SYS_DFU_DATA_BUF but more importantly the "dfu_bufsiz" env variable. Therefore, dfu_get_buf() should be used for initialization.

---
  drivers/dfu/dfu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dfu/dfu.c +0 -0
index 0560afa..332be67 100644

drivers/dfu/dfu.c int dfu_init_env_entities(char *interface, char *devstr) · line 82

Quoted 8 lines
drivers/dfu/dfu.c +1 -1
@@ -76,7 +76,7 @@ int dfu_init_env_entities(char *interface, char *devstr)
  }
 
  static unsigned char *dfu_buf;
-static unsigned long dfu_buf_size = CONFIG_SYS_DFU_DATA_BUF_SIZE;
+static unsigned long dfu_buf_size;
 
  unsigned char *dfu_free_buf(void)
  {

Best regards,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com