Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8247311rwi; Tue, 25 Oct 2022 04:30:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4sWQ/uDUq6iDHVQqrSy6iLfZ5eno8qjbryvF87FqzPtSV/nQrV7Wp/LvXzpfFMfFWc+oRl X-Received: by 2002:a05:6402:2489:b0:454:11de:7698 with SMTP id q9-20020a056402248900b0045411de7698mr35866782eda.214.1666697412251; Tue, 25 Oct 2022 04:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666697412; cv=none; d=google.com; s=arc-20160816; b=vK4RNj6hjg+H/OG1YIWyxkJReYG1Gza1OxOpC/xwUZANEwB14JzBM1OvIHTwW0BryJ WLnjFOuHr0py0A3W24Ue543Asu9O6uqs7Qc51Sy7TF/jdWx+XhwNxpi8bse1us91PbIM GnLQ+j+2i2RYAtiJXwX4afGiXhRZPXEhZsOOH1YwAnsCGXT9uwNzjgqQQ1B2XMOnXmEb BifdpdjipTqcP6WZupZdbVlTf+VBjqS95eh/u3ZhwUnSaBMDlTXjs5IWTL8GGfQgqxqx qFvJdLQgm/sH+pp/Jm9rqOnxHEHtkarksQ5zqvGPpKX6E7NAa4r7V1Y0FKGBAy3OH9jK OoRw== 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 :dkim-signature; bh=EtpT6yptCjgiGQ0pzprLOvBeq8q5hjOg0D9KpcHtcDI=; b=Yb8ZI6XWMYHEtfQlif+hfhnCTQx5/Lvn4/VbSNEtmrYQwT6bxrftbTfR+ebPm3hg+I QIQsdYjH3T2gvbtQxOyBM1XEfeeS356O459PutmunbFtz/RX2YOTSUTqKk3RmgGV+CUT tM0lrI/RJbg62gZ/j5qozMhAJWPMz/Mk+zD/A+hZtHb55tNuRA71LcYQGDD54kI2pGWo YyY+4mjQrStFTPgUgt8pfo2atzN8IfiuDaW1eDY1oRFnsErwotsI+3PMoaZl8qOkF2Dd carPWTrLLisDsihh4AvO0l6gxY7Dq4bpRObJzSdhaDORvQ1iOUJAGTyit4EabZKBPLWJ 2Szw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fcrXhQPl; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ce12-20020a170906b24c00b0078a3ef9f092si1962568ejb.998.2022.10.25.04.29.46; Tue, 25 Oct 2022 04:30:12 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=fcrXhQPl; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231903AbiJYLPy (ORCPT + 99 others); Tue, 25 Oct 2022 07:15:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231819AbiJYLPm (ORCPT ); Tue, 25 Oct 2022 07:15:42 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7050211E461; Tue, 25 Oct 2022 04:15:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666696541; x=1698232541; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=I/5u94u6MpEzVP8gikfALeB7J/YtsYkWMNaw/bQchGY=; b=fcrXhQPlhrvYU1vQRG+hXusiPCZKALwy93mnCFWVj6rHvkkBYfeifkb1 +TXyyd8RJII7RMc0RoYxnVZPBcRxvTcchBo6JnV58iB6Fdf5eEIRKpVmM MvCfV16Zoqi0AvnEFB4VXDTVCCllgaLTVlNUR8k8gxpBLZyZqNBIzC9ta iikHIdb1QaQsmUAMC3tyAuQ9wzptkN6S8J134ENtukgYC85vz1FaSyezT 1o7/BHel1GnJd0T4cVu7HoxOt4p7hB6YsGj3IlJgjkXkQuJ6SKzN1xLcF p5LA2f11yniOLeLj6escoB3/tZ6ous/hMFJQ2MUxXVg0KujvaRDe+Hi+y Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="306378060" X-IronPort-AV: E=Sophos;i="5.95,211,1661842800"; d="scan'208";a="306378060" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2022 04:15:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="960778489" X-IronPort-AV: E=Sophos;i="5.95,211,1661842800"; d="scan'208";a="960778489" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP; 25 Oct 2022 04:15:38 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1onHuC-001xlF-1b; Tue, 25 Oct 2022 14:15:36 +0300 Date: Tue, 25 Oct 2022 14:15:36 +0300 From: Andy Shevchenko To: "Vaittinen, Matti" Cc: Matti Vaittinen , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Akhil R , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-i2c@vger.kernel.org" Subject: Re: [PATCH 1/2] drivers: fwnode: fix fwnode_irq_get_byname() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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 Tue, Oct 25, 2022 at 10:00:07AM +0000, Vaittinen, Matti wrote: > On 10/25/22 12:18, Andy Shevchenko wrote: > > On Tue, Oct 25, 2022 at 11:50:59AM +0300, Matti Vaittinen wrote: ... > >> + ret = fwnode_irq_get(fwnode, index); > > > >> + > > > > Redundant blank line and better to use traditional pattern: > > >> + if (!ret) > >> + return -EINVAL; > >> + > >> + return ret; > > > > if (ret) > > return ret; > > > > /* We treat mapping errors as invalid case */ > > return -EINVAL; > > > >> } > > I like the added comment - but in this case I don't prefer the > "traditional pattern" you suggest. We do check for a very special error > case indicated by ret 0. > > if (!ret) > return -EINVAL; > > makes it obvious the zero is special error. I don't think so. It makes ! easily to went through the cracks. If you want an explicit, use ' == 0' and add a comment. > if (ret) > return ret; > > the traditional pattern makes this look like traditional error return - > which it is not. The comment you added is nice though. It could be just > before the check for > > if (!ret). -- With Best Regards, Andy Shevchenko