From 03dafe3202372e557f7125dc8155cb1d564d1f5e Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 1 Nov 2017 23:08:45 +0100 Subject: Enable further warning flags, address new warnings mtd_debug: Remove a duplicate if case. MTD_CAP_NANDFLASH has only one flag set (MTD_WRITEABLE). Directly below, we had a check for MTD_WRITEABLE in the else branch which can't possible ever have triggered. Checking for MTD_WRITEABLE in addition to the CAP constants was probably not intended anyway, given the check for the individual flags if all else fails. integck: We already established that "r" is less than the number of elements in the list, so the loop condition doesn't need to check if w is NULL in addition. At least this way, the compiler "gets" that w cannot be NULL below and doesn't issue warnings. Signed-off-by: David Oberhollenzer --- tests/fs-tests/integrity/integck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c index cac145d..84753d6 100644 --- a/tests/fs-tests/integrity/integck.c +++ b/tests/fs-tests/integrity/integck.c @@ -1164,7 +1164,7 @@ static int file_mmap_write(struct file_info *file) } r = random_no(write_cnt); w = file->writes; - for (i = 0; w && w->next && i < r; i++) + for (i = 0; i < r; i++) w = w->next; offs = (w->offset / fsinfo.page_size) * fsinfo.page_size; -- cgit v1.2.3