Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp653672ybb; Sat, 28 Mar 2020 07:15:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vskvzoPkzuRBuhLGVIxHh50cY/UDZndUu+3dLERv7Ngh2MxKzdQNZMUr+yW7NTapFamHs0p X-Received: by 2002:a05:6830:22e8:: with SMTP id t8mr3025119otc.48.1585404920686; Sat, 28 Mar 2020 07:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585404920; cv=none; d=google.com; s=arc-20160816; b=RElW8wyDzFfZbLydWEQIjy+gUAaat7zKpZRLpiWRkXKjZ5kVzN7HqPyMX7EGcGJob4 6VwkWp5bdd8Snfad7Dn3IrXAwjEwJj/T40uOMg9wQI7aBTx+5G2PkwbOwJAk5lTlG/UA OdWZ3/p52+hYcwZaGUUx0GmpuSODeKvS/Hig2z0JPCFBzHLcS2MABG3qDiJXYFqsuBni 1Vza9ldQ0k3YqwVwjZ4kP8lwNK4Q4pyW1NXFLGonMiDpATreYzRGI1xlAs2puSG9T5IJ UnXPNwlXq8JCD6vFQmvCGIQtIB/KwWiDiOfGXqNkaBNxSwXksx42HOzmTLtaubvsqtdI LZFg== 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=TT8OB5YkRGb7G4VH/EzYbY2S12WEQZaHZ4+Gr6NJlJM=; b=flXh+y0T7zwberfd3dJkH8JJgIkdiOtm5UgaT/PDg2yY+1BCX+z9LRSuuYAcwHXj/1 rmindG2E9Ksq4ivXU8iPgqCxX9QQrw2p8GCftBBeN8pF6G2I7yNlKFzy31DKaBfPANIl IZVtuhFr9zxJuwYEd2uPNVYs4o6EQDfz7BpZa8P8geAhlo8cZsIdr0Y67YhUxbWWG2o4 9AcRrVIcuRAXGMyeWNpYDbhyqZYMmbaqugBqi5ir9khgR+Mz04ABjW1obpuGHgUgPT9m BAA3UTIF9wE6N4UlA/+3XnD+BTmf4aQXVaglS6o3xzVXsVrfYreblF2AixOkWkpZd1b7 4anA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xQwMYFl6; 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.15.07; Sat, 28 Mar 2020 07:15:20 -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=xQwMYFl6; 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 S1726518AbgC1ONd (ORCPT + 99 others); Sat, 28 Mar 2020 10:13:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:49302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbgC1ONd (ORCPT ); Sat, 28 Mar 2020 10:13:33 -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 271B7206E6; Sat, 28 Mar 2020 14:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585404812; bh=TK4r9TQQgWukLt0YvMfS7SVClvnijm6m+FK/7DftQmA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=xQwMYFl66lixifwm//92A4H5qqQynsfuKFsGhmju+RAxqN2TcnIMw4itmz+taGOOj 88e2tyqGN0akXnpwx3iaxbE7N0G1BhpPdNksuKaAgWJenmWnynL8j8sSgTKZAahCTU YuEaaZPupQeWP1PS2kfWDZIXyp5Ka1V0QM7xxNUE= Date: Sat, 28 Mar 2020 14:13:28 +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 04/13] iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error name Message-ID: <20200328141328.74781859@archlinux> In-Reply-To: <5b9a92dee27f406556b4c945f773ef9b5eea825c.1584897364.git.nish.malpani25@gmail.com> References: <5b9a92dee27f406556b4c945f773ef9b5eea825c.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:06 +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, Jonathan > --- > > 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_i2c.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c > index 4fc9c6a3321f..513473fb2055 100644 > --- a/drivers/iio/gyro/bmg160_i2c.c > +++ b/drivers/iio/gyro/bmg160_i2c.c > @@ -21,8 +21,8 @@ static int bmg160_i2c_probe(struct i2c_client *client, > > regmap = devm_regmap_init_i2c(client, &bmg160_regmap_i2c_conf); > if (IS_ERR(regmap)) { > - dev_err(&client->dev, "Failed to register i2c regmap %d\n", > - (int)PTR_ERR(regmap)); > + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n", > + regmap); > return PTR_ERR(regmap); > } >