Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp998718rdb; Fri, 9 Feb 2024 07:26:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVr441EwVuL4GRM18kAU4VD7uhRYPa1b1RWuneuBtZxnSw3/+jwWNylBlT+NCCAkwHoEZz+DR3n7KO2AHJXhPZxOA1AaX4/PDOwgOuLsw== X-Google-Smtp-Source: AGHT+IHlhGwAq5HayiyJUSmzY8eFrjm+/uwqwBsnx8sVxNQjgB7TJmgtDBVMBzJZx21hHDHfLKle X-Received: by 2002:a05:6402:1803:b0:560:dcb9:18dc with SMTP id g3-20020a056402180300b00560dcb918dcmr1566623edy.18.1707492373126; Fri, 09 Feb 2024 07:26:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707492373; cv=pass; d=google.com; s=arc-20160816; b=lSFpzQzWve5IIxufWELnVjhGvnyonk8qguZK6oIoWd4/P/aFJOhm394lALMRxewqcD sVT/h8ZeO5K8LIjE3n92JYai5R8bJSovwoPW195ABP6SRjuAyANuj1vF+Hm4M2HL2qPT AYYOsvod7p+3cX2l+KTcQOwUcstx+I5e6J/asUFq/A0SJvzvF7a4HyRmpdoAwZZZlg6r +t/auswaZ+Nwg30KAUiq0KGw7Gmb4PtePD2hvtANDtBeEAxVbH7yryEZqLymknmrw83m qKFXIQh/roQ1yYa1cDexextZ2cdThSYHo5vrPPtMFdTIB8ciwS/SGrh/bnnRttZsd3iq sCrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=BBHfCVm3iXU21gRuuNYDgCEqve6Z1LmQ7AV1wXUu/Cg=; fh=sTDqaok/8+1sZJbbrgORXkw7rBhKaKbdJU4CdEEyGac=; b=BqQoQrtBzwiCxDA8ZJ4+HlfNChn6d6wmb9OFN9nPt/IWygeo+CMQlf8DIQMY8ZEBwj xYnA76BHlQxQJz7fD+Hd3PGHBzhGgiTD/8xpd1WWubVS349S/LaksEvAqgKucveDCktK 2FPRLBeOgd2x9HRzvh6YHRrIRC2ZcIX1tps8J4LcrMyB/pD28pX6BPImQQzbaFE2m4iG ZSk8bA7ZK55NRvwNJnzDfEAEtUeDzR2/5W2m5VcBKE4x/4iiwQ4wCQge94UkH78hcwu5 ZXh6c4KsTThh3W303uk/LHBr6U00ZVC4TEP1COvg/8nLyDRzZAgvC68lLuK5RrT/LAyX q0bQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="NH+/2XYT"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-59411-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59411-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; AJvYcCV/qsl4juwYLRaYUfRxc/0pBlfry4qTc7igEpbisViaf4B341fL7bYE87aiTyECfYvGh7+WTHs5F+BlxaWO5j74bVKyT5ERWkYkvNV3CA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i4-20020a05640242c400b0055ff368325csi1015116edc.669.2024.02.09.07.26.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 07:26:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59411-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="NH+/2XYT"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-59411-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59411-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A72B91F2411E for ; Fri, 9 Feb 2024 14:07:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDDDC65BCC; Fri, 9 Feb 2024 14:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NH+/2XYT" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 BFD58657B5; Fri, 9 Feb 2024 14:07:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707487636; cv=none; b=n+mbV/qZHhL+jacW9a486nu8NcJMaOu696XB1SggzMs+/MmNZ02Oe7qso0gIsHSVo8D4IlkF+ShFEf/FO4IEItxlrBzgwg55xij5nHMC3vqUy5rhGPaUHgUDCKsghujcn3tpxgQUtcFinqDV6EsR3edp77H91Op5/Z3J0SjPq84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707487636; c=relaxed/simple; bh=UppTMuPvFgBB9f8XupQc3wIwMSfTH3V3GTIflUXlFXA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TikhDKc8g9bNiCtmf6zqRlVjKASFKVAx5Cp4owmvHKlJMDZmKNIbuELg3nzxkmjSB6Je0x+8umT9H9ApYfncfU38fgkZm4QwXhOkB1kTwMGrIRnjr8Y++E2mxfnPHTXhHGi1Wyp9BV8XrfVUkBsbor4pp7iVj5bWYv9TY4BYCHY= 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=NH+/2XYT; arc=none smtp.client-ip=198.175.65.9 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=1707487635; x=1739023635; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UppTMuPvFgBB9f8XupQc3wIwMSfTH3V3GTIflUXlFXA=; b=NH+/2XYTfz5K2IxQ6nWL6ztT2PxGu8CkkN81U5qrVFaw0lGIaGn+AFr5 c8KId0oAMiz2/sk3KSXQLdDhHyr95BEZ4H5/emszgQj5q6DkSixyTj0+d pZS3eiWMCqgu/OK8EKu/dEln2VRpRhoLdZATwh0Z+Pn0fMXUo9ajQg9Uu FC+RBjOgA536xzT9S5R/Of4KZ9PSIE3zOvpvZ8m9pv1wIJUsQAc3LgS3Q NBh5nHAk94Y2Was1Y99Mbgt5+R/7syYBdag1KA7dIW1e++j75t8dYd0SF Xl+ZzZMTQRVZJMJtlmXP/x18Lu7e4fDhiBsTF/JIXLsDggREvyOpnU4Cg w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="23912329" X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="23912329" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 06:07:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="910717772" X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="910717772" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 06:07:11 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rYRX3-00000003AQI-1FAE; Fri, 09 Feb 2024 16:07:09 +0200 Date: Fri, 9 Feb 2024 16:07:09 +0200 From: Andy Shevchenko To: Krzysztof Kozlowski Cc: Mika Westerberg , Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] gpio: constify opaque pointer in gpio_device_find() match function Message-ID: References: <20240208202704.631203-1-krzysztof.kozlowski@linaro.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240208202704.631203-1-krzysztof.kozlowski@linaro.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Feb 08, 2024 at 09:27:04PM +0100, Krzysztof Kozlowski wrote: > The match function used in gpio_device_find() should not modify the > contents of passed opaque pointer, because such modification would not > be necessary for actual matching and it could lead to quite unreadable, > spaghetti code. IIRC I also asked Bart about this in his series where something similar was used. Good it's not only me who sees the benefits from this. FWIW, Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko