[Suggestion] mm/bootmem.c: need return failure code when BUG() neither CONFIG_BUG nor HAVE_ARCH_BUG is defined.

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

 



Hello Maintainers:

If neither CONFIG_BUG nor HAVE_ARCH_BUG is defined, the BUG() will
defined as empty (e.g. randconfig with MMU for arm s5pv210)

As a function, it need return an error code to upper caller, but excuse
me, I can not find the suitable error code for return (it seems only
'return -1' is not suitable).

Please help check, thanks.


356 static int __init mark_bootmem(unsigned long start, unsigned long end,
357                                 int reserve, int flags)
358 {
359         unsigned long pos;
360         bootmem_data_t *bdata;
361 
362         pos = start;
363         list_for_each_entry(bdata, &bdata_list, list) {
364                 int err;
365                 unsigned long max;
366 
367                 if (pos < bdata->node_min_pfn ||
368                     pos >= bdata->node_low_pfn) {
369                         BUG_ON(pos != start);
370                         continue;
371                 }
372 
373                 max = min(bdata->node_low_pfn, end);
374 
375                 err = mark_bootmem_node(bdata, pos, max, reserve, flags);
376                 if (reserve && err) {
377                         mark_bootmem(start, pos, 0, 0);
378                         return err;
379                 }
380 
381                 if (max == end)
382                         return 0;
383                 pos = bdata->node_low_pfn;
384         }
385         BUG();
386 }



Thanks.
-- 
Chen Gang

Asianux Corporation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




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