Commit 03824c80 authored by Federico Vaga's avatar Federico Vaga

sw:lib: reduce variable scope

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 48db9eb5
......@@ -229,11 +229,12 @@ static int __trtl_fw_buffer(struct trtl_dev *trtl,
struct trtl_desc *wdesc = (struct trtl_desc *)trtl;
unsigned int offset;
unsigned int total_size = 0;
uint32_t sizes;
int err, i;
/* Validate */
for (i = 0; i < n_tlv; ++i) {
uint32_t sizes;
total_size += (sizeof(uint32_t) * 2); /* 32bit for type and size */
total_size += tlv->size;
sizes = wdesc->cfgrom.hmq[idx_cpu][idx_hmq].sizes;
......
......@@ -675,12 +675,11 @@ int trtl_cpu_dump_application_file(struct trtl_dev *trtl,
*/
static int trtl_dev_open(struct trtl_desc *wdesc)
{
char path[64];
if (wdesc->fd_dev < 0) {
char path[64];
snprintf(path, 64, "%s/%s", wdesc->path, wdesc->name);
wdesc->fd_dev = open(path, O_RDWR);
wdesc->fd_dev = open(path, O_RDWR);
if (wdesc->fd_dev < 0)
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment