aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
authorMaxime Bizon <mbizon@freebox.fr>2013-08-30 12:06:41 -0400
committerTony Luck <tony.luck@intel.com>2013-08-30 18:57:01 -0400
commit3bd11cf56e4d9c9a79c0c1a4ebe381c674ec9709 (patch)
treed696c550232d2b6e5a279675a28398cb679590fb /fs/pstore
parent3f8f80f0cfebab185b6fe599c53b63e7e8ae02c9 (diff)
pstore/ram: (really) fix undefined usage of rounddown_pow_of_two
Previous attempt to fix was b042e47491ba5f487601b5141a3f1d8582304170 Suggested use of is_power_of_2() was bogus because is_power_of_2(0) is false (documented behaviour). Signed-off-by: Maxime Bizon <mbizon@freebox.fr> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/ram.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 4027c2065842..fa8cef2cca3a 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -421,11 +421,11 @@ static int ramoops_probe(struct platform_device *pdev)
421 goto fail_out; 421 goto fail_out;
422 } 422 }
423 423
424 if (!is_power_of_2(pdata->record_size)) 424 if (pdata->record_size && !is_power_of_2(pdata->record_size))
425 pdata->record_size = rounddown_pow_of_two(pdata->record_size); 425 pdata->record_size = rounddown_pow_of_two(pdata->record_size);
426 if (!is_power_of_2(pdata->console_size)) 426 if (pdata->console_size && !is_power_of_2(pdata->console_size))
427 pdata->console_size = rounddown_pow_of_two(pdata->console_size); 427 pdata->console_size = rounddown_pow_of_two(pdata->console_size);
428 if (!is_power_of_2(pdata->ftrace_size)) 428 if (pdata->ftrace_size && !is_power_of_2(pdata->ftrace_size))
429 pdata->ftrace_size = rounddown_pow_of_two(pdata->ftrace_size); 429 pdata->ftrace_size = rounddown_pow_of_two(pdata->ftrace_size);
430 430
431 cxt->dump_read_cnt = 0; 431 cxt->dump_read_cnt = 0;