[PATCH 19/42] state: backend_bucket_direct: max_size is always given

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 31 00:03:23 PDT 2017


max_size is always != 0, so if(direct->max_size) can be skipped.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/state/backend_bucket_direct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/state/backend_bucket_direct.c b/common/state/backend_bucket_direct.c
index 9996ac2919..b72e8adb96 100644
--- a/common/state/backend_bucket_direct.c
+++ b/common/state/backend_bucket_direct.c
@@ -103,7 +103,7 @@ static int state_backend_bucket_direct_write(struct state_backend_storage_bucket
 	int ret;
 	struct state_backend_storage_bucket_direct_meta meta;
 
-	if (direct->max_size && len > direct->max_size - sizeof(meta))
+	if (len > direct->max_size - sizeof(meta))
 		return -E2BIG;
 
 	ret = lseek(direct->fd, direct->offset, SEEK_SET);
-- 
2.11.0




More information about the barebox mailing list