Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp246695imm; Thu, 6 Sep 2018 01:37:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaVX0Dez3wF/qvORNgGjAnm5aRdh57C/T6/WDoYd4Ws4DOiY34qMQOwcL4kyVhuJxFdsP60 X-Received: by 2002:a65:6413:: with SMTP id a19-v6mr1559794pgv.359.1536223039955; Thu, 06 Sep 2018 01:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536223039; cv=none; d=google.com; s=arc-20160816; b=KERFEnshNwHTnuw6cViZX7QukBAzEoPjpBl0NzSU7UvcktmmVaL7lOdeHwwffTbLAh 23ST0Wya36svTpPDNVVnO/DZKNge3iuOpJQMtrQd+5C2joJYMNBo6Chxsjst+bP1NnJL CuplQbUTyhve03IbTfS40nOc4V56jx6agn2Cr1R1M2nJ8aU0s2TmlCqxML5HzFnvfi// Rk0N42x2vbMBS5/nomZwq8MY/93gtCPXrx6B64T5RrR4AIhk9O4K88+Nu7PRY/X+N5mH s6hqdZKcxvE4YeOfvImiL5WVGjBnaaSgzS7Ey07rxaCUZdsjd1kQsGqFEBLNxX5PYsL6 Yr6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TEHLVcKNeF+BgDOPYOq3XieA2U7PlVaKeebuaX+Lv28=; b=C7tXFVCIxxYOql9HssSKLryIS7On9KtzqeqyJgOnRKAOMi6o4ytRDDncG2J8H6CD/e 0v/z1iQMWcuz9Ho64kzfJ1VQR8jh+hYtm5Y9KJ9/qEis8lG00V13W2U3AiVpoPPVNeVF a9cp3cFd8pRar53TvXUUNU8eGD3D79GAzwwr4p2XkFPy3sGpYjo9ZJvjS2VvJi2n4EmL 6j2F3TKIGQy8x2W9Q/WQHFC8frvTKCOMgd/GH0Rgi/VNSmMRDf2ODr3XcZByajHSFq7t 2VQjJzRrSZzsLEpal4OUC7RArqqDEglbAmE4l9EdbgL89igz2BPMIYXCNa0AUqaFaDXS N4cw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10-v6si4913017pfe.291.2018.09.06.01.37.04; Thu, 06 Sep 2018 01:37:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728133AbeIFNJw (ORCPT + 99 others); Thu, 6 Sep 2018 09:09:52 -0400 Received: from mail.skyhub.de ([5.9.137.197]:42482 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727827AbeIFNJw (ORCPT ); Thu, 6 Sep 2018 09:09:52 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Qxpyof8OjICm; Thu, 6 Sep 2018 10:35:13 +0200 (CEST) Received: from zn.tnic (p200300EC2BCBB900329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2bcb:b900:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D65951EC02D1; Thu, 6 Sep 2018 10:35:12 +0200 (CEST) Date: Thu, 6 Sep 2018 10:35:06 +0200 From: Borislav Petkov To: Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , linux-edac@vger.kernel.org Subject: Re: [PATCH 18/21] edac: cpc925: use for_each_of_cpu_node iterator Message-ID: <20180906083506.GA10768@zn.tnic> References: <20180905193738.19325-1-robh@kernel.org> <20180905193738.19325-19-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180905193738.19325-19-robh@kernel.org> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 05, 2018 at 02:37:35PM -0500, Rob Herring wrote: > Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This > has the side effect of defaulting to iterating using "cpu" node names in > preference to the deprecated (for FDT) device_type == "cpu". > > Cc: Borislav Petkov > Cc: Mauro Carvalho Chehab > Cc: linux-edac@vger.kernel.org > Signed-off-by: Rob Herring > --- > Please ack and I will take via the DT tree. This is dependent on the > first 2 patches. Completely unknown territory for me so I'd trust your judgement. Staring at 1/21, the conversion looks ok except the removal of those prints that a cpu nodes are not present - I wonder if they even meant anything or were just there during driver development... > drivers/edac/cpc925_edac.c | 20 ++------------------ > 1 file changed, 2 insertions(+), 18 deletions(-) > > diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c > index 2c98e020df05..3c0881ac9880 100644 > --- a/drivers/edac/cpc925_edac.c > +++ b/drivers/edac/cpc925_edac.c > @@ -593,8 +593,7 @@ static void cpc925_mc_check(struct mem_ctl_info *mci) > /******************** CPU err device********************************/ > static u32 cpc925_cpu_mask_disabled(void) > { > - struct device_node *cpus; > - struct device_node *cpunode = NULL; > + struct device_node *cpunode; > static u32 mask = 0; > > /* use cached value if available */ > @@ -603,20 +602,8 @@ static u32 cpc925_cpu_mask_disabled(void) > > mask = APIMASK_ADI0 | APIMASK_ADI1; > > - cpus = of_find_node_by_path("/cpus"); > - if (cpus == NULL) { > - cpc925_printk(KERN_DEBUG, "No /cpus node !\n"); This thing... > - return 0; > - } > - > - while ((cpunode = of_get_next_child(cpus, cpunode)) != NULL) { > + for_each_of_cpu_node(cpunode) { > const u32 *reg = of_get_property(cpunode, "reg", NULL); > - > - if (strcmp(cpunode->type, "cpu")) { > - cpc925_printk(KERN_ERR, "Not a cpu node in /cpus: %s\n", cpunode->name); ... and this thing. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.