From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F600C3A59D for ; Mon, 19 Aug 2019 09:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5C192184D for ; Mon, 19 Aug 2019 09:31:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="KfUSIee3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726211AbfHSJbD (ORCPT ); Mon, 19 Aug 2019 05:31:03 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39784 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726842AbfHSJbD (ORCPT ); Mon, 19 Aug 2019 05:31:03 -0400 Received: from zn.tnic (p200300EC2F04B7001DE01AE6C2F731B7.dip0.t-ipconnect.de [IPv6:2003:ec:2f04:b700:1de0:1ae6:c2f7:31b7]) (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 E999F1EC0B07; Mon, 19 Aug 2019 11:31:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1566207062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=tNYqVxZOI4B4YC2lrHxCTcuCtzHSepwsdy73xSCZc0I=; b=KfUSIee3hppbIpUeGdON4+xK8tHIudXJtWEIExqzvM0c7bBxsL75CCcfpkJ0BzpEcM8A76 +9Mxaf8tLNcbfSvj5z4NSqpIbdR+65G9S32QQHB2iT99yR7OpFGN/bHefbdFXSrYS9EkP9 YHi4W3S3GPAFxtJK58XKTGWQ2YJv9tA= Date: Mon, 19 Aug 2019 11:31:47 +0200 From: Borislav Petkov To: Lei Wang Cc: "james.morse@arm.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "mchehab@kernel.org" , "linux-edac@vger.kernel.org" , "sashal@kernel.org" , "hangl@microsoft.com" , "lewan@microsoft.com" , "ruizhao@microsoft.com" Subject: Re: [PATCH v5 2/2] EDAC: add EDAC driver for DMC520 Message-ID: <20190819093147.GE4841@zn.tnic> References: <20190807144016.GA24328@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-edac-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org On Tue, Aug 13, 2019 at 01:05:02AM +0000, Lei Wang wrote: > Added some more comments for the file: > > /* > * dmc520_edac.c, EDAC driver for DMC-520 memory controller ^^^^^^^^^^^^^ Filename is redundant. > These comments tell how to potentially expand the driver functions to > support more interrupts besides what are already here. I can read that - the question is why are they there and for whom? For your future colleagues who'll take over this driver or what is those comments' purpose? > As above comments, this comment is to guide potential future adding to > this driver to support other interrupts. See question above. > After edac_mc_alloc(), if succeeds, the above code updates dmc520_edac > struct data. If moving edac_mc_alloc as suggested, I will need to use > local variables to store the data, Yes, do that pls. > Do you mean having an array to keep all the irq_id, and then only > devm_request_irq on them if all of the platform_get_irq are success? No, move it before edac_mc_alloc(). In general, do *all* initialization of your hardware first and only then, when it succeeds, allocate the EDAC structures. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.