[bug report] mm, compaction: round-robin the order while searching the free lists for a target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Mel Gorman,

The patch 1688e2896de4: "mm, compaction: round-robin the order while
searching the free lists for a target" from Jan 8, 2019, leads to the
following static checker warning:

	mm/compaction.c:1252 next_search_order()
	warn: impossible condition '(cc->search_order < 0) => (0-u16max < 0)'

mm/compaction.c
    1243 static int next_search_order(struct compact_control *cc, int order)
    1244 {
    1245 	order--;
    1246 	if (order < 0)
    1247 		order = cc->order - 1;
    1248 
    1249 	/* Search wrapped around? */
    1250 	if (order == cc->search_order) {
    1251 		cc->search_order--;
--> 1252 		if (cc->search_order < 0)
                            ^^^^^^^^^^^^^^^^^^^^
u16 can't be negative.

    1253 			cc->search_order = cc->order - 1;
    1254 		return -1;
    1255 	}
    1256 
    1257 	return order;
    1258 }

regards,
dan carpenter




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux