Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp654929ybb; Sat, 28 Mar 2020 07:16:57 -0700 (PDT) X-Google-Smtp-Source: ADFU+vta+2zHkNSFxG5Jpo6WjDZraKvQLnegYyv7hK1qGP3NxeEKtKyPjyQvrMSaccCyyGjwynOe X-Received: by 2002:a9d:943:: with SMTP id 61mr2858209otp.3.1585405017207; Sat, 28 Mar 2020 07:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585405017; cv=none; d=google.com; s=arc-20160816; b=rXqrqoZskLu6RyfRsfgBROzCeKGeAwgPY9iHO/hsjIQcxFYRm83uNMZxaiOR83QfPN eGHaZ6/0VX2CW+eC6RiE/AGe9F7TYDEcMvvCRSLGqe7Ik40ZcTLDeniEI9B6ZZ/DbsiV 1LV6fsN1KLqjhgPD4vcZ7VStoqbyavVjVRJoogBYnRSLpHFncg/PP0p+Ct7FQgSMNE+P 6Uem2jjDWrbLb0oWlrqEHSOHfZHbTWI8pfN9I74P25EVZnd8c95/xu2TVyuu14d2OPsA XqaZl2//JPIDZA5L+KdVXrQfVkkEn4AeFbfwGbeOyzQ+ebw+oCfJ2fBfDW0Mm1Ra+Tmm mvEQ== 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=OFo27nfhqdB+FditzlpNhBCSjpQBRPfI45aCqlcmuy8=; b=Pv0S383MTthFaGNf6N6Tf7yrhVybT9EuJnhCD1gMmlH3NmojVhg7GjhHi6zl8i+gKE HrgVgQus8jYJWn8GWUJ0REzspnDACW6YmPSq4A9ZMV2xOn5kp0M5UW9ZERdFpcaSvWx6 JpKYONPnKEHyQnOumS2FkgEYMl9EqxY5N2IdiTMr+1zCkqiF/KOkK797HokcpIS355Ks MnMh6vzNY7ZtNjmxKBbu1smRMcvUINKbHqWRupKGSiv56v79fbbq3VQ+dNMr02S2T7li 5WZ28pLU5HEdI4qFBU3qMtOxPWhVvPhF/KWsJNQCS9Svpo2PjWJcG+dfaD6xdvlS7ybh M+sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dk2s4KYD; 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 e8si3896421oif.218.2020.03.28.07.16.44; Sat, 28 Mar 2020 07:16:57 -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=dk2s4KYD; 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 S1726661AbgC1OQX (ORCPT + 99 others); Sat, 28 Mar 2020 10:16:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:50950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbgC1OQX (ORCPT ); Sat, 28 Mar 2020 10:16:23 -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 5F956206DB; Sat, 28 Mar 2020 14:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585404982; bh=gU5OU/1nQ9lCMlTw2P7p3BfBd6ofZMOkQTbkOv23oSA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dk2s4KYDeSsj1FaInWmHPaoppFv6WriwY0KV2SJW0fX6iwDaKYlHdISk4K/yb59EE sMwQ/4U3RNMX7liOxMvD/RNIqNcdGavRBqp9DKaxDToqFWvmfwnTIc3dJtaUnl0Z52 7EcEeBZJQqD1P8JStI2B9GgocILPiONIs3/DUUJQ= Date: Sat, 28 Mar 2020 14:16:18 +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 05/13] iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error name Message-ID: <20200328141618.64938f3e@archlinux> In-Reply-To: <5f2c696ab083108b18898bcead8489f46d000114.1584897364.git.nish.malpani25@gmail.com> References: <5f2c696ab083108b18898bcead8489f46d000114.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:07 +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 Side note on this one. Would have made sense to combine the two patches for the bmg160 gyro into one, but doesn't really matter. Applied. Thanks, > --- > > 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/gyro/bmg160_spi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c > index 182a59c42507..6f82bbe0ae92 100644 > --- a/drivers/iio/gyro/bmg160_spi.c > +++ b/drivers/iio/gyro/bmg160_spi.c > @@ -19,8 +19,8 @@ static int bmg160_spi_probe(struct spi_device *spi) > > regmap = devm_regmap_init_spi(spi, &bmg160_regmap_spi_conf); > 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); > } >