drivers/rwbuffer: Remove the redundant check in rwb_initialize
the same check already done before Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
73723dd31c
commit
a86a3d4d02
@ -828,9 +828,6 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb)
|
||||
|
||||
/* Allocate the write buffer */
|
||||
|
||||
rwb->wrbuffer = NULL;
|
||||
if (rwb->wrmaxblocks > 0)
|
||||
{
|
||||
allocsize = rwb->wrmaxblocks * rwb->blocksize;
|
||||
rwb->wrbuffer = kmm_malloc(allocsize);
|
||||
if (!rwb->wrbuffer)
|
||||
@ -838,7 +835,6 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb)
|
||||
ferr("Write buffer kmm_malloc(%d) failed\n", allocsize);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
finfo("Write buffer size: %d bytes\n", allocsize);
|
||||
}
|
||||
@ -859,9 +855,6 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb)
|
||||
|
||||
/* Allocate the read-ahead buffer */
|
||||
|
||||
rwb->rhbuffer = NULL;
|
||||
if (rwb->rhmaxblocks > 0)
|
||||
{
|
||||
allocsize = rwb->rhmaxblocks * rwb->blocksize;
|
||||
rwb->rhbuffer = kmm_malloc(allocsize);
|
||||
if (!rwb->rhbuffer)
|
||||
@ -869,7 +862,6 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb)
|
||||
ferr("Read-ahead buffer kmm_malloc(%d) failed\n", allocsize);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
finfo("Read-ahead buffer size: %d bytes\n", allocsize);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user