From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linuxppc-dev@ozlabs.org
Cc: mpe@ellerman.id.au, mikey@neuling.org
Subject: [PATCH 6/8] powerpc/prom: Simplify the logic while fetching SLB size
Date: Wed, 29 Jul 2015 12:40:03 +0530 [thread overview]
Message-ID: <1438153805-31828-6-git-send-email-khandual@linux.vnet.ibm.com> (raw)
In-Reply-To: <1438153805-31828-1-git-send-email-khandual@linux.vnet.ibm.com>
This patch just simplifies the existing code logic while fetching
the SLB size property from the device tree. This also changes the
function name from check_cpu_slb_size to init_mmu_slb_size as
it just initializes the mmu_slb_size value.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
arch/powerpc/kernel/prom.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 8b888b1..4bb43c0 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -218,22 +218,18 @@ static void __init check_cpu_pa_features(unsigned long node)
}
#ifdef CONFIG_PPC_STD_MMU_64
-static void __init check_cpu_slb_size(unsigned long node)
+static void __init init_mmu_slb_size(unsigned long node)
{
const __be32 *slb_size_ptr;
- slb_size_ptr = of_get_flat_dt_prop(node, "slb-size", NULL);
- if (slb_size_ptr != NULL) {
- mmu_slb_size = be32_to_cpup(slb_size_ptr);
- return;
- }
- slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
- if (slb_size_ptr != NULL) {
+ slb_size_ptr = of_get_flat_dt_prop(node, "slb-size", NULL) ? :
+ of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
+
+ if (slb_size_ptr)
mmu_slb_size = be32_to_cpup(slb_size_ptr);
- }
}
#else
-#define check_cpu_slb_size(node) do { } while(0)
+#define init_mmu_slb_size(node) do { } while(0)
#endif
static struct feature_property {
@@ -380,7 +376,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
check_cpu_feature_properties(node);
check_cpu_pa_features(node);
- check_cpu_slb_size(node);
+ init_mmu_slb_size(node);
#ifdef CONFIG_PPC64
if (nthreads > 1)
--
2.1.0
next prev parent reply other threads:[~2015-07-29 7:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 7:09 [PATCH 1/8] powerpc/slb: Remove a duplicate extern variable Anshuman Khandual
2015-07-29 7:09 ` [PATCH 2/8] powerpc/slb: Rename all the 'slot' occurrences to 'entry' Anshuman Khandual
2015-08-13 1:44 ` [2/8] " Michael Ellerman
2015-07-29 7:10 ` [PATCH 3/8] powerpc/slb: Define macros for the bolted slots Anshuman Khandual
2015-07-29 7:10 ` [PATCH 4/8] powerpc/slb: Add some helper functions to improve modularization Anshuman Khandual
2015-08-12 4:11 ` [4/8] " Michael Ellerman
2015-08-12 6:36 ` Anshuman Khandual
2015-07-29 7:10 ` [PATCH 5/8] powerpc/slb: Add documentation to runtime patching of SLB encoding Anshuman Khandual
2015-08-12 5:12 ` [5/8] " Michael Ellerman
2015-08-13 1:44 ` Michael Ellerman
2015-07-29 7:10 ` Anshuman Khandual [this message]
2015-08-13 1:44 ` [6/8] powerpc/prom: Simplify the logic while fetching SLB size Michael Ellerman
2015-07-29 7:10 ` [PATCH 7/8] powerpc/xmon: Drop the 'valid' variable completely in 'dump_segments' Anshuman Khandual
2015-08-13 1:44 ` [7/8] " Michael Ellerman
2015-07-29 7:10 ` [PATCH 8/8] powerpc/xmon: Add some more elements to the existing PACA dump list Anshuman Khandual
2015-08-12 6:05 ` Michael Ellerman
2015-08-12 6:27 ` Anshuman Khandual
2015-08-13 1:44 ` [1/8] powerpc/slb: Remove a duplicate extern variable Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438153805-31828-6-git-send-email-khandual@linux.vnet.ibm.com \
--to=khandual@linux.vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).