Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp659786ybb; Sat, 28 Mar 2020 07:23:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtXi0VSpu2fuevloIcRzrhjSsz+v294i2UN+EaY29Z2tmvILG3+Tn+jbGrzpLnzaJ90WCp0 X-Received: by 2002:a9d:3a45:: with SMTP id j63mr2619263otc.71.1585405392974; Sat, 28 Mar 2020 07:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585405392; cv=none; d=google.com; s=arc-20160816; b=cbWBE5+YV86rzHb0DTBkgIwEerxXVDEvCPlDKONpE281o3nsAp3coDwwPm0KSM5HQ8 Zn0xDEiqJjIXXNuzhGxBDue/47VaWw6e1hYirQnZy/H/4BPZlPt2z/riGUvVo5vFv4Ki kped66JTIk0EqBvoe/eGOabF1om28iq4Vy4VpB97pxNxmfbDk0GE4uuCkm4w0O6uCoW+ ZOeKcYY5xez1yUl7AK1SlULlLwr+R9XgvHU6iQ+EA3FlLOo+fytS/RnY4aV0ctFEgGd2 shdQ9e/L3PvoNooRBTXXIC+Yuu0iwr3fLWu5043TbaWlhkC8zgdbqVBY/LC5x1JVa/Jc acZg== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XjgmqOkxMaq5TDsKuhzbE4ScaXCs05I6UGPwkvoj+GQ=; b=jyQpT5+WYuQ3Qk6B/hSs1drXHOmSZfcdO1qjAl1/+csvIaENq12IQ8C8KulvBx9t43 8Jf6aJCHWJkk7ZTCiy0tVF1GDjmKEZvDN7GPvfHXXOzfQkVj3muU1tZx4MWLBUJg1V/4 myyPDIYodCjvJSatopPpYutCQ8tnio1w+jqUr6HO83PXn2wJ0VUXcYUE+HKWyhwHRWj8 JgXbFc9vfnTVFgIGYKjpAGiHKhBWyBsFHKp6z5Dhi2uiUXWY8a/ARu1EUtPcuY/lLf63 /V017D5xJhEm1foG/nWJTmttFGHhyKC4ZRRBS4XujjBTke1xuDZJGtpUqSRzj2+T9NHl eFaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kR9a4AzB; 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=pass (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 96si4029730otm.42.2020.03.28.07.23.00; Sat, 28 Mar 2020 07:23:12 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=kR9a4AzB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727131AbgC1OWk (ORCPT + 99 others); Sat, 28 Mar 2020 10:22:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:53146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbgC1OWj (ORCPT ); Sat, 28 Mar 2020 10:22:39 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BDA7020578; Sat, 28 Mar 2020 14:22:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585405359; bh=o2RnCQfdUPRaGZ/6gkmp4YHjMGY8PkItc4XPJu9ZaCo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kR9a4AzBvPQ8DKxK6glsTWdYN8ycUzle2iqAwC8/G1CoHlKQGTF4VNqY/N4+HZhhg 8AEcg01kVSHYcGHgKYjsPiDxxFdV2+PGDk3YXvhW/ZDTp/W/18y/nN53FPOoX5HbIY Q4mgp6IW3v7SU8dlvP0uB+ZxQ56JQvIYwECPC3N8= Date: Sat, 28 Mar 2020 14:22:33 +0000 From: Jonathan Cameron To: Nishant Malpani Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 10/13] iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic error name Message-ID: <20200328142233.1fd3fdce@archlinux> In-Reply-To: <99e93b0103a6af19d8c7b85cfefb3055e5d0b06a.1584897364.git.nish.malpani25@gmail.com> References: <99e93b0103a6af19d8c7b85cfefb3055e5d0b06a.1584897364.git.nish.malpani25@gmail.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 22 Mar 2020 22:53:12 +0530 Nishant Malpani wrote: > Utilize %pe format specifier from vsprintf while printing error logs > with dev_err(). Discards the use of unnecessary explicit casting and > prints symbolic error name which might prove to be convenient during > debugging. > > Signed-off-by: Nishant Malpani Applied, Thanks, J > --- > > Changes in v2: > - Rewrite commit subject line outlining the usage of %pe. > - Add a separator between regmap and its error name. > > Based on conversations in [1] & [2]. > > [1] https://marc.info/?l=linux-iio&m=158427554607223&w=2 > [2] https://marc.info/?l=linux-iio&m=158481647605891&w=2 > --- > drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c > index 673b198e6368..6f968ce687e1 100644 > --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c > +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c > @@ -53,8 +53,8 @@ static int inv_mpu_probe(struct spi_device *spi) > > regmap = devm_regmap_init_spi(spi, &inv_mpu_regmap_config); > if (IS_ERR(regmap)) { > - dev_err(&spi->dev, "Failed to register spi regmap %d\n", > - (int)PTR_ERR(regmap)); > + dev_err(&spi->dev, "Failed to register spi regmap: %pe\n", > + regmap); > return PTR_ERR(regmap); > } >