Skip to contentSkip to conversation

Fixed use of rounddown_pow_of_two in ramoops

PATCH In review Marco Stornelli 3 participants 3 messages Nov 19, 2011 – Nov 22, 2011 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixed use of rounddown_pow_of_two in ramoops

From: Marco Stornelli <[email protected]>

The return value of rounddown_pow_of_two wasn't evaluated, so the operation was a no-op.

---
 drivers/char/ramoops.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/char/ramoops.c +2 -2
index 7c7f42a1f8..9658116 100644
@@ -126,8 +126,8 @@ static int __init ramoops_probe(struct platform_device *pdev)
                goto fail3;
        }
 
-       rounddown_pow_of_two(pdata->mem_size);
-       rounddown_pow_of_two(pdata->record_size);
+       pdata->mem_size = rounddown_pow_of_two(pdata->mem_size);
+       pdata->record_size = rounddown_pow_of_two(pdata->record_size);
 
        /* Check for the minimum memory size */
        if (pdata->mem_size < MIN_MEM_SIZE &&
#2 lore raw
In reply to Marco Stornelli
Quoted 15 lines · On Sat, 19 Nov 2011 14:32:15 +0100 Marco Stornelli <[email protected]>…

From: Marco Stornelli <[email protected]>

The return value of rounddown_pow_of_two wasn't evaluated, so the operation was a no-op.

---
 drivers/char/ramoops.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/char/ramoops.c +0 -0
index 7c7f42a1f8..9658116 100644

drivers/char/ramoops.c static int __init ramoops_probe(struct platform_device *pdev) · line 133

Quoted 10 lines
drivers/char/ramoops.c +2 -2
@@ -126,8 +126,8 @@ static int __init ramoops_probe(struct platform_device *pdev)
                goto fail3;
        }
 
-       rounddown_pow_of_two(pdata->mem_size);
-       rounddown_pow_of_two(pdata->record_size);
+       pdata->mem_size = rounddown_pow_of_two(pdata->mem_size);
+       pdata->record_size = rounddown_pow_of_two(pdata->record_size);
 
        /* Check for the minimum memory size */
        if (pdata->mem_size < MIN_MEM_SIZE &&

waah.

There goes my chance to get my name in the kernel tree :(