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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83EEBC001DE for ; Wed, 19 Jul 2023 16:54:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230375AbjGSQyb (ORCPT ); Wed, 19 Jul 2023 12:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbjGSQy3 (ORCPT ); Wed, 19 Jul 2023 12:54:29 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 440FC91; Wed, 19 Jul 2023 09:54:28 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="430289382" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="430289382" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2023 09:54:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="789481190" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="789481190" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP; 19 Jul 2023 09:54:24 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qMARS-001aWY-2H; Wed, 19 Jul 2023 19:54:22 +0300 Date: Wed, 19 Jul 2023 19:54:22 +0300 From: Andy Shevchenko To: Samuel Holland Cc: Linus Walleij , Bartosz Golaszewski , Emil Renner Berthing , Rob Herring , Frank Rowand , Palmer Dabbelt , Paul Walmsley , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v2 3/4] gpio: sifive: Get the parent IRQ's domain from its irq_data Message-ID: References: <20230719163446.1398961-1-samuel.holland@sifive.com> <20230719163446.1398961-4-samuel.holland@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230719163446.1398961-4-samuel.holland@sifive.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 19, 2023 at 09:34:44AM -0700, Samuel Holland wrote: > Do not parse the devicetree again when the data is already available > from the IRQ subsystem. This follows the example of the ThunderX and > X-Gene GPIO drivers. The ngpio check is needed to avoid a possible > out-of-bounds read. ... > - girq->parent_domain = parent; > + girq->parent_domain = irq_get_irq_data(chip->irq_number[0])->domain; For the sake of readability I would like to leave parent variable and assign it beforehand somewhere upper in the code. Also, can irq_get_irq_data() return NULL? Needs a comment on top of that assignment or an additional check. -- With Best Regards, Andy Shevchenko