Commit 3bd11cf5 authored by Maxime Bizon's avatar Maxime Bizon Committed by Tony Luck

pstore/ram: (really) fix undefined usage of rounddown_pow_of_two

Previous attempt to fix was b042e474

Suggested use of is_power_of_2() was bogus because is_power_of_2(0) is
false (documented behaviour).
Signed-off-by: default avatarMaxime Bizon <mbizon@freebox.fr>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 3f8f80f0
...@@ -421,11 +421,11 @@ static int ramoops_probe(struct platform_device *pdev) ...@@ -421,11 +421,11 @@ static int ramoops_probe(struct platform_device *pdev)
goto fail_out; goto fail_out;
} }
if (!is_power_of_2(pdata->record_size)) if (pdata->record_size && !is_power_of_2(pdata->record_size))
pdata->record_size = rounddown_pow_of_two(pdata->record_size); pdata->record_size = rounddown_pow_of_two(pdata->record_size);
if (!is_power_of_2(pdata->console_size)) if (pdata->console_size && !is_power_of_2(pdata->console_size))
pdata->console_size = rounddown_pow_of_two(pdata->console_size); pdata->console_size = rounddown_pow_of_two(pdata->console_size);
if (!is_power_of_2(pdata->ftrace_size)) if (pdata->ftrace_size && !is_power_of_2(pdata->ftrace_size))
pdata->ftrace_size = rounddown_pow_of_two(pdata->ftrace_size); pdata->ftrace_size = rounddown_pow_of_two(pdata->ftrace_size);
cxt->dump_read_cnt = 0; cxt->dump_read_cnt = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment