Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp561130rdb; Thu, 8 Feb 2024 14:04:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEp7dFZliCfLrHMynEMFgUb0NChXTXXr/rnonAyw98jBVHU5xpf282HT+U1o9wRe2zPHMrQ X-Received: by 2002:a17:902:d352:b0:1d9:65e6:4af7 with SMTP id l18-20020a170902d35200b001d965e64af7mr1088380plk.30.1707429843519; Thu, 08 Feb 2024 14:04:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707429843; cv=pass; d=google.com; s=arc-20160816; b=aRPFF4n/nBbOMziA5D5jGF3c7PGE4GJr9p+DJIMpbxhEm9JVCxKRmG+56JxfGz8QPw Ag3j5Dyxf6VWVJkSxisCqfrARnOHTbyVBU5uP+sCjoUHY+EnnG6pPEpuCB55e6i4fS2F ARnVez69vD2mNaPiWIanCZnw9z22Z5TqUBlqNJtm+37XmOiGC2zOliZlVLfmIfvDaSGc //LajBbodwCIqiPBy2jrDt4xjGP3gNxRKurTL6su7dq4e/zhh6hWIVB4hIoNsjA7g2fQ Zf3nUuPjtsN1hjVl1hkItIW+FaEbUNxSw5Gt6Yw+3d7WtOfbsCA2ifUPKMDF3dNvjiYa y1EQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hREChlwOUAinJ30ONM8m24MoMqhTnx3XR98z962/qrU=; fh=V9ypZHaRf/hyv1Vr5NE2MHu77MqfLb3+WHbUCjJ4SvA=; b=PyvgRCLlRUS8wr7EXhmo9NAxrMB2pK2gGKHCVdXnGsfy4B4TA47u699sYa5DaKTgfq P8NUHnOjWoiIl3DkCVL7zBwqZohxAv3L5BegQwuZCi5gE675XypRkXsTca2Ybnv4vOO0 wi004u9E0NvOnQ4L+hHVlseEK8FxWHJExl/40fMfo39MHICIoXFZatWSvYpi4KlieOvg SDhQnj7fKyLP57Av1m13VH5pGl1j9IqVJz0e3qx8Biq7Hrq7KIX6hOa0GLQdgEtuHmv8 NDcIM1Jrsmd/3AGw7C414P23xX5fRU1vNPS3x4nSHw0eMk+Xl+w1E8g80lUUUGsWGFvl VEYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SgEMSM1L; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58419-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCXZwKJBz1VkPb9Ly6kpsattiAEF5GelMb2dapfd4xVLl7TnV/opzI1w69YLvLIHsbQteQ15QTOWRHopzdz63nJLXSEhjnr9i1ULbyQ/Gw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d14-20020a170903230e00b001d59055c547si463169plh.293.2024.02.08.14.04.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 14:04:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58419-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SgEMSM1L; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58419-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DF854282007 for ; Thu, 8 Feb 2024 17:09:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DEC7134CD6; Thu, 8 Feb 2024 17:04:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SgEMSM1L" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFEE886AFF; Thu, 8 Feb 2024 17:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411881; cv=none; b=u9QwLhzrTbdxGnlWw8NQLs6rbokcKNgj7WWcZi89qOQnYHNcqG35KvwoHju/u8Ch2TsssaMxogS2nV6Qy+KOxgoge0vzcgS8vgBFOiWhqJXoaxHJh9GYxuu+11EU4N+5o39A24Wi1eT7MSTZh1s8gLI/pvpDnXMQXw7LUhJRPqI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411881; c=relaxed/simple; bh=PTrnrsT2Geunz+SnN8BD71O48bXNxNI49r+JQOFpfQI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UgQTZxazvcBL+ZfKvW4Q1nyppZOArfIb74Kcb2grcszjakLShGDublWeEuUl1bKkRkErlMvJ5c5/GHx13YFgCtlheBRA+ZeILf5S0Tb6ryQc+R5q0Cys2qpTtbzp6yzIM4hkWx2iVXRkGVtsRcc3apsPnd2Fdqk49li3cGzoKXg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SgEMSM1L; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411881; x=1738947881; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=PTrnrsT2Geunz+SnN8BD71O48bXNxNI49r+JQOFpfQI=; b=SgEMSM1LEmWMWwg5ST4wosPaJ1uN59v/82j1aII1eKFlfTiRHIWaUj7e R5eD5+TJeUcw7qg1rLghe/Ec+8u7TNW58f6D4ljdCkVT1tQyGZmX1CTvM Y6cGKeYqcCvJASoDvAzU4EO/r1QUthykU3fELm9gCPF4p1lYqP6ISqIQa d9aaOhJFgO2LO32BspAIvsNYOgm2qTN27etCOK0UTKBuoXztOEFtI+ivW 9nPuwq82gI+RMqfk9kfpzh1eFgu70vkfIHN7Z8QWF3CFvIB8v1XnEpbyq pJXUnazy20IWUSsZxfvIbrRABuF9GpQ8sQZ907nSNqupdMF6Pjhomh/mq g==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="11836371" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="11836371" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 09:04:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="910425503" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="910425503" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 09:04:36 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rY7pC-00000002vkG-0CEj; Thu, 08 Feb 2024 19:04:34 +0200 Date: Thu, 8 Feb 2024 19:04:33 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Raag Jadav , jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, lakshmi.sowjanya.d@intel.com, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/5] pwm: dwc: drop redundant error check Message-ID: References: <20240208070529.28562-1-raag.jadav@intel.com> <20240208070529.28562-2-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Feb 08, 2024 at 08:46:44AM +0100, Uwe Kleine-K?nig wrote: > On Thu, Feb 08, 2024 at 12:35:25PM +0530, Raag Jadav wrote: > > pcim_iomap_table() fails only if pcim_iomap_regions() fails. No need to > > check for failure if the latter is already successful. > > Is this really true? pcim_iomap_table() calls devres_alloc_node() which > might fail if the allocation fails. (Yes, I know > https://lwn.net/Articles/627419/, but the rule is still to check for > errors, right?) We do not add a dead code to the kernel, right? > What am I missing? Mysterious ways of the twisted PCI devres code. Read the above commit message again :-) For your convenience I can elaborate. pcim_iomap_table() calls _first_ devres_find() which _will_ succeed if the pcim_iomap_regions() previously succeeded. Does it help to understand how it designed? -- With Best Regards, Andy Shevchenko