Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8489850rwp; Wed, 19 Jul 2023 10:28:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlEsHEBkOxUkDcDBffDQ+c44S+ugMIs7MdZT5eksOiS0o+oraIs1xTNZ8ye+5V8f4rekM9sQ X-Received: by 2002:a05:6a20:4322:b0:134:70b7:2386 with SMTP id h34-20020a056a20432200b0013470b72386mr3632869pzk.9.1689787738949; Wed, 19 Jul 2023 10:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689787738; cv=none; d=google.com; s=arc-20160816; b=e7MOjdmCcn7jE66mkXBq3GttZ6n5Zcslst40qylSAO3UBSUxhMKTjJJxmfBvf83dMy lkzp6gbaiYVjIZtzHe/ZsWocP7yNCoZ3TtsSDAw2R5tDxreAzVDAxDbRtrpaTBiOJjxQ Z/8STcERnY3HR/OJNmOUBa/E4q85BcdO8PbCKLUf3ZuvybUhKPgKThfDaEpNDDUQi7CY Up0F9yMT+w7qoHwB8zbL/mDembZf+zbr7AbP2OQfvM313cVZyn/pLjg5pvlpvLqKV8Dz c0ICQ3IOfpdXnBWR3a3xxNazjbUxfYIHTShU52aPLp2udLkmrk5Qpf8gjhcbIEV7ZzZH I9Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=tobHcrP/M02Wi8NoAaLaPy3Wv++cxj5+saX5rYQvld4=; fh=cA0Ln4kADB9MaxBObWf36lXo0Mdqh7yUk2YEczCWWws=; b=k396vv5MX/XRadEO2tCSbbV/2VQjx6GJHgSOSv6RsiWGUf+h6m8vlOwFWeLBsx4R5d dnHF1iTQFPhMdvbWfcF1kQWyKerC/4eJSFpDLku8ibqDrNaI8TihLsx9d2CsjlY9EIv3 vnO5h6ECU5kb9LX0nRnaxoyriMGpgMyxsp4fFMLm05YQFX6hm8gW13GBak123FfqC17w JY3VJlxn+baqlceD6wZJ8WWjQqWl1lgyb4C1S5fM9rp1mgEzyHtnfB6V94+HunRB9pem 7nwGl0xZCpREIMC5ijVwx7/OrilJtAPmOy5FuZ04p2kHiQN5ZxZzlJdeaCoGw4SX/sj+ USoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v17-20020a634811000000b0055c8b7c0a31si3632956pga.363.2023.07.19.10.28.46; Wed, 19 Jul 2023 10:28:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjGSQya (ORCPT + 99 others); Wed, 19 Jul 2023 12:54:30 -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 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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