From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752810AbcIOOcn (ORCPT ); Thu, 15 Sep 2016 10:32:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41029 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754832AbcIOOcS (ORCPT ); Thu, 15 Sep 2016 10:32:18 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: arbab@linux.vnet.ibm.com X-IMSS-HAND-OFF-DIRECTIVE: 127.0.0.1:10026 Date: Thu, 15 Sep 2016 09:31:57 -0500 From: Reza Arbab To: Rob Herring Cc: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Frank Rowand , Jonathan Corbet , Andrew Morton , Bharata B Rao , Nathan Fontenot , Stewart Smith , Alistair Popple , Balbir Singh , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linuxppc-dev , "devicetree@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH v2 1/3] drivers/of: recognize status property of dt memory nodes References: <1473883618-14998-1-git-send-email-arbab@linux.vnet.ibm.com> <1473883618-14998-2-git-send-email-arbab@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Organization: IBM Linux Technology Center User-Agent: Mutt/1.6.2-neo (2016-08-21) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16091514-0028-0000-0000-000005983910 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005765; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000185; SDB=6.00757977; UDB=6.00359637; IPR=6.00531590; BA=6.00004731; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012682; XFM=3.00000011; UTC=2016-09-15 14:32:16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16091514-0029-0000-0000-00002F41B9DB Message-Id: <20160915143157.mi7xhxfedbic6m63@arbab-laptop> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-15_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609150195 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 15, 2016 at 08:43:08AM -0500, Rob Herring wrote: >On Wed, Sep 14, 2016 at 3:06 PM, Reza Arbab wrote: >> + status = of_get_flat_dt_prop(node, "status", NULL); >> + add_memory = !status || !strcmp(status, "okay"); > >Move this into it's own function to mirror the unflattened version >(of_device_is_available). Also, make sure the logic is the same. IIRC, >"ok" is also allowed. Will do. >> @@ -1057,6 +1062,9 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname, >> pr_debug(" - %llx , %llx\n", (unsigned long long)base, >> (unsigned long long)size); >> >> + if (!add_memory) >> + continue; > >There's no point in checking this in the loop. status applies to the >whole node. Just return up above. I was trying to preserve that pr_debug output for these nodes, but I'm also fine with skipping it. Thanks for your feedback! I'll spin a v3 of this patchset soon. -- Reza Arbab