Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1100607imu; Thu, 20 Dec 2018 10:06:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/X5Rhvi1PWgjSp6X/Nt3jQXAQrKKGaqm9jNfC+02d6ayUKQlgN3a2JKcgUVsOM/dqx0wQEF X-Received: by 2002:aa7:8354:: with SMTP id z20mr24880906pfm.81.1545329166108; Thu, 20 Dec 2018 10:06:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545329166; cv=none; d=google.com; s=arc-20160816; b=cJ4MNyGEgOFOeBbQRHpz5odqM0MtcpsaxGfZn4RroApMMwFu8IVN8Tycy5SYgkN9od Xnw1WryDVPLq9suriySqx9IFzlUjf6t41jv4+ZiEC3iOxTDlgJfUVbY2klhbcx6M1okd tjar7LOpmUllLNJGjn89n2c+wyrUIy2JlWlIFnHoaqCn8OoAb7xRJt2mLWu0o9R1WV3S K3iDjMBGD1goFBZy1iTaWZGtJZ9zuHOI74XxSFn3qv1+xb0bWeMln3pzczZ0HIh5AgIa zcuAUltEVba2zktSQzW4is4kCEQR0LmLpisnsg/6dNz+k1Ed1ej6BgRfnNPn4Css6Jo6 W/ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=nq8d07HAa0tURcA9JYcwKrgnNSA4HwhiWl3XqEL59Zc=; b=Sax/BZIqGpisyqhRXziz1UiLqshtqRtHDhDdQfYpDXXSwzaX95bRsX7sAz5q6jZ6Hu XBxmns3bTNR8BqCbg6ygFPfV9cTyFaa/ScH3PQPLm8IzJ2V5PSvF5YseTt3gv3wQBi3Z vEo+oMDEARv/dJwzsIGjl70gO3MWDIHzxH2RsxzYHWj+BkCWF2rKsfSCc8AmUI21TXjn P/K5DUz6sFAWjg0sK7LdISQr7tvYko0PZU98VqJDjPg6T2L6UnulYkz0ewMFz2n+apO+ cU5jb9SILQaoIfQtramPL0zj9bDUyca16Fj0jd08lzuVoZNe7A+3KnRMrI515ewAK0zE WdRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j34si16240786pgj.557.2018.12.20.10.05.46; Thu, 20 Dec 2018 10:06:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730521AbeLTLFl (ORCPT + 99 others); Thu, 20 Dec 2018 06:05:41 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:42354 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730001AbeLTLFl (ORCPT ); Thu, 20 Dec 2018 06:05:41 -0500 Received: by mail-ot1-f65.google.com with SMTP id v23so1267382otk.9 for ; Thu, 20 Dec 2018 03:05:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nq8d07HAa0tURcA9JYcwKrgnNSA4HwhiWl3XqEL59Zc=; b=oD3eX3qy5yZAjGszV2vFxiTBmvAPnJIy8ltGHO59ll04jvcVHpTe5X4uvyB+ohA4KR mV1noTjkYNyUCedGI1fIYrE9pEpojKdwx2IKEkkylzm5h18ydZhcyPvobXw7WOrSMGaw WkAR15lTwFklH0TMw7Fc5XRWEyECZtcv0QoFsMhuKwgsX7nGNdxSCdPZm9ppLIYZnwKr vXLIkgkB5Gm09TZhDsFDgG1Gmr/minFu5iSHr2hQGrxB5BGN0w8VmZoM9gShMHSQayzh Pgiv3tZz9SQFqdoagxhCiq1Qj/CIcDk1u0Uxdv5xEYWPjUFVaKsroTy+lPN0yrpDm4pf DLBQ== X-Gm-Message-State: AA+aEWa0htwcwEMUcCA+Ud6K6VRmvjkFcnG+RN02zR2fn0zas5pwoZ/6 vB6woY+NcJfYnS0rNdPQ86jR0XBzqXehQ6wNkMk= X-Received: by 2002:a9d:4c84:: with SMTP id m4mr16332731otf.124.1545303940805; Thu, 20 Dec 2018 03:05:40 -0800 (PST) MIME-Version: 1.0 References: <20181220102247.4911-1-a.hajda@samsung.com> <20181220102247.4911-4-a.hajda@samsung.com> In-Reply-To: <20181220102247.4911-4-a.hajda@samsung.com> From: "Rafael J. Wysocki" Date: Thu, 20 Dec 2018 12:05:29 +0100 Message-ID: Subject: Re: [PATCH v4 3/3] driver core: add probe_err_ptr helper To: Andrzej Hajda Cc: Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , Marek Szyprowski , "Rafael J. Wysocki" , Linux Kernel Mailing List , javierm@redhat.com, Linux ARM , Andy Shevchenko , Mark Brown , Russell King - ARM Linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 11:23 AM Andrzej Hajda wrote: > > probe_err is useful in multiple contexts where error is encoded in pointer. > Adding helper performing conversion to error value should simplify code > further. > > Signed-off-by: Andrzej Hajda Reviewed-by: Rafael J. Wysocki > --- > include/linux/device.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/device.h b/include/linux/device.h > index 2d3a1cc6f5da..50632414c363 100644 > --- a/include/linux/device.h > +++ b/include/linux/device.h > @@ -1594,6 +1594,8 @@ do { \ > extern __printf(3, 4) > int probe_err(const struct device *dev, int err, const char *fmt, ...); > > +#define probe_err_ptr(dev, ptr, args...) probe_err(dev, PTR_ERR(ptr), args) > + > /* Create alias, so I can be autoloaded. */ > #define MODULE_ALIAS_CHARDEV(major,minor) \ > MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) > -- > 2.17.1 >