Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp664765ybt; Wed, 24 Jun 2020 08:18:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWe/NSITuYV8WmX+Mm3hoyajTWhV4XOTGVXzu5Ie4h9s+d00Kg7qoGg9tJl9oDn5gOxbCM X-Received: by 2002:a17:906:f2c1:: with SMTP id gz1mr7281702ejb.88.1593011931730; Wed, 24 Jun 2020 08:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593011931; cv=none; d=google.com; s=arc-20160816; b=BsVuVdZw6W+eAnc0fC7t3/vvmCzm/qorV62tC6KieP7tfwj3yAyyAoVwR5BRL8mPiu PQDyDHEU+CaANDP+7DFFD83vw95L7HbaHSJAwIdDX30hgXRN1OGWOGh4yzsFg3wC/3dI pNHbVHX/TrDJhruR4uXzuSzELmnPShU1WxS4Yfb9951Gm0vHg6QIS0yXOasTeQRkjDAA j+921jiW/gufPoQxCm8cAEIIntASh4j7MmQ68CBhn2TAHzO5fPZHgCYwCtQL10e2C7U5 BotkLydzCt/OvnJmXmfuMJkZrGOLfb+F2akYH+i66GlYpPuKy5919z+p55qCqjPpbmTo gDpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=sLVqeBRh5elHWn0gHPAgxPLvw65UAgT8c+8Sy02nuHw=; b=vGjIPB9mIs2vQo9buEb7cWZnFxDuNuhjhorj7U7IC7TC8h3BSAVduPbrXhHmpU5MvG HF9JORh2Rl36IMPst3+CRGjRaXjuKEwd7JDup05CzyYNwBeWuL7om7arYAMsin8Vr852 sIOsV6bztx2P4httLhjCPo95f8/xatuLADyMAroTmr//WT8FrlxeCr6tsF3cq3YF4vBA 4mjtqyz9YeaQ001EwrzugT8jFg5iOCWhefQS93nox2RoKOZKRtOkDLyWvwIJEM2RJqGj Z6LAW1N749nvOATUl5FmacY4YfxB4BFiCR8Ns2o5kI+SFAGIFC7mrykpHqKgFxlfUhda vMww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lo14si4962972ejb.244.2020.06.24.08.18.28; Wed, 24 Jun 2020 08:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404583AbgFXPQy (ORCPT + 99 others); Wed, 24 Jun 2020 11:16:54 -0400 Received: from foss.arm.com ([217.140.110.172]:32964 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404564AbgFXPQx (ORCPT ); Wed, 24 Jun 2020 11:16:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3EECF1FB; Wed, 24 Jun 2020 08:16:52 -0700 (PDT) Received: from [10.57.9.128] (unknown [10.57.9.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DDDE13F73C; Wed, 24 Jun 2020 08:16:49 -0700 (PDT) Subject: Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types To: Mark Brown Cc: Andy Shevchenko , Andrzej Hajda , Greg Kroah-Hartman , Jernej Skrabec , "Rafael J. Wysocki" , Jonas Karlman , Bartlomiej Zolnierkiewicz , Linux Kernel Mailing List , "open list:DRM DRIVERS" , Russell King - ARM Linux , Neil Armstrong , Laurent Pinchart , Daniel Vetter , linux-arm Mailing List , Marek Szyprowski References: <20200624114127.3016-1-a.hajda@samsung.com> <20200624114127.3016-4-a.hajda@samsung.com> <2203e0c2-016b-4dbe-452d-63c857f06dd1@arm.com> <20200624150434.GH5472@sirena.org.uk> From: Robin Murphy Message-ID: <381de683-df5e-4112-5690-13dd9272ae22@arm.com> Date: Wed, 24 Jun 2020 16:16:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200624150434.GH5472@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-24 16:04, Mark Brown wrote: > On Wed, Jun 24, 2020 at 03:25:33PM +0100, Robin Murphy wrote: > >> And yeah, anyone who pipes up suggesting that places where an ERR_PTR value >> could be passed to probe_err() could simply refactor IS_ERR() checks with >> more uses of the god-awful PTR_ERR_OR_ZERO() obfuscator gets a long stare of >> disapproval... > > We could also have a probe_err_ptr() or something that took an ERR_PTR() > instead if there really were an issue with explicitly doing this. Yeah, for all my lyrical objection, a static inline _ptr_err() helper to wrap _err() with sensible type checking might actually be an OK compromise if people really feel strongly for having that utility. (and then we can debate whether it should also convert NULL to -ENOMEM and !IS_ERR to 0... :D) Robin.