Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1229602lqm; Thu, 2 May 2024 08:37:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWWWpkJTw0r4RWEPXX0A5uYN2A6C+5Zb/PUqL0yrs2HQ4myB6OOymsRLmtH/6DUiHxdEdUbpMiM7ROSjdVRSN3MeA/lwHSLk8TfSSWrXQ== X-Google-Smtp-Source: AGHT+IFGNrTcAS800/EdePFwCdkBJOXWztrhLo/45iyYC95WbWqwQD1dqwcZ3sF994Pt5VB32zqa X-Received: by 2002:a05:6e02:2166:b0:369:9492:c24b with SMTP id s6-20020a056e02216600b003699492c24bmr95865ilv.10.1714664254430; Thu, 02 May 2024 08:37:34 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c8-20020a637248000000b00604b94711besi1246517pgn.43.2024.05.02.08.37.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 08:37:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=Fo4d0fzN; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-166654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166654-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (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 11C4D281CEE for ; Thu, 2 May 2024 15:37:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE14715B54F; Thu, 2 May 2024 15:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Fo4d0fzN" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 8218C15574D; Thu, 2 May 2024 15:37:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714664247; cv=none; b=cBxvXNGAl/t6fXiofLmgFAK4sJ6RNHR3RM/CcuiNFv1XtDT8on5IieXGB5t6v/Okcjn3FcX40DhOwjuKLAsaLZzD3xsTETG7uitLlabapJLpvuiC7q3ZfYH2RxgBHVn0W+hlZ/yuBH2y2cTtYQvUA1gdFWpZ7E5dsTuAoNblqdE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714664247; c=relaxed/simple; bh=j38UorVmR/AGSdNTHCstKIyo+0I5Y1p2zSzuxJtlmJ8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aWHneD2eLxg0/9ffKEu2/TUm4JlJ1fhsRRvP2jMiqNkIu503WSAnmp+dQiwHLBQoE3axUfE3ZpgEwh9qFXNqtnArO3yYNurV7l7cJPEAZSYvEQOpdGCuxupE6t7DeA+DypeCT6ggNRg2bk0RRsyIEtRvnilH6Cr3r/lfre2WT9M= 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=Fo4d0fzN; arc=none smtp.client-ip=192.198.163.16 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=1714664246; x=1746200246; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=j38UorVmR/AGSdNTHCstKIyo+0I5Y1p2zSzuxJtlmJ8=; b=Fo4d0fzNecH2EqhMu8FUUpP6n49EyqYnvGvYPgLV1Qe/M3ej94QTgK/m shH3EnWMpHbxZnH4VQUxRwbUCwi/8Myi7y3NClE7ENDDcrpBXmDhiyd6F Zu2J4lO6NCfQ565S8BTeyS+JlyN+IjIqNjQzwHi20B2dORQnJ1k0H39tj rLMqJyL1ZXLXJ0SVWsZJGNONy28K8jsCvVCD31XyoviYAPtzmiLO5PxZ5 1B8BIBWuVEV2YwOmMNow5AgTzl29Qr7neue/SV8SX0LPjTdWzZUftLzYY A5JpPVp4GhhW9vW7Gji2TTRhiLv6MzFn3fAjRMD/IBF2/g4si4yEreLqD w==; X-CSE-ConnectionGUID: rME7CR6tQFuzSl67IhZFPQ== X-CSE-MsgGUID: ecH8zU9+QD+eqRHGvufOXg== X-IronPort-AV: E=McAfee;i="6600,9927,11062"; a="10978268" X-IronPort-AV: E=Sophos;i="6.07,247,1708416000"; d="scan'208";a="10978268" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2024 08:37:23 -0700 X-CSE-ConnectionGUID: rQ0mIaCQTiOvdIA7WfTaOg== X-CSE-MsgGUID: 8QDHy7o5TB+CjJnL4WNbZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,247,1708416000"; d="scan'208";a="64596205" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2024 08:37:20 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1s2YUm-00000003MfF-3qvM; Thu, 02 May 2024 18:37:16 +0300 Date: Thu, 2 May 2024 18:37:16 +0300 From: Andy Shevchenko To: Nuno =?iso-8859-1?Q?S=E1?= Cc: nuno.sa@analog.com, Petr Mladek , Chris Down , John Ogness , Greg Kroah-Hartman , Jonathan Cameron , Lars-Peter Clausen , Olivier Moysan , Andi Shyti , Jyoti Bhayana , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Subject: Re: [PATCH v2 1/4] dev_printk: add new dev_err_probe() helpers Message-ID: References: <20240423-dev-add_dev_errp_probe-v2-0-12f43c5d8b0d@analog.com> <20240423-dev-add_dev_errp_probe-v2-1-12f43c5d8b0d@analog.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, May 02, 2024 at 01:54:36PM +0200, Nuno S? wrote: > On Tue, 2024-04-23 at 18:45 +0300, Andy Shevchenko wrote: > > On Tue, Apr 23, 2024 at 06:31:20PM +0300, Andy Shevchenko wrote: > > > On Tue, Apr 23, 2024 at 05:20:30PM +0200, Nuno Sa via B4 Relay wrote: > > > > From: Nuno Sa .. > > > > +#define dev_err_cast_probe(dev, ___err_ptr, fmt, > > > > ...) ({ \ > > > > + ERR_PTR(dev_err_probe(dev, PTR_ERR(___err_ptr), fmt, > > > > ##__VA_ARGS__)); \ > > > > +}) > > > > After looking into the next patch I think this should be rewritten to use %pe, > > hence should be an exported function. Or dev_err_probe() should be split to > > a version that makes the difference between int and const void * (maybe using > > _Generic()). > > I replied a bit in the other patch but I'm of the opinion that's likely just more > complicated than it needs to be (IMO). Why is the PTR_ERR(___err_ptr) that bad??If we > really want to have a version that takes pointer why not just: > > #define dev_err_ptr_probe(dev, ___err, fmt, ...) \ > dev_err_probe(dev, PTR_ERR(__err), fmt, ##__VA_ARGS__) > > > (yes, while _Generic() could be fun I'm trying to avoid it. In this case, I think > having explicit defines is more helpful) It seems dev_err_probe() already uses %pe, so we are fine. -- With Best Regards, Andy Shevchenko