Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp657662ybb; Sat, 28 Mar 2020 07:20:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvh/aUiaiiFwqnlh4/nWdC9M9avGdt3Y07W2WMFmsXGmGTz4NVb7G8Enitd/A/vYDXXThvf X-Received: by 2002:a9d:1904:: with SMTP id j4mr862299ota.37.1585405220783; Sat, 28 Mar 2020 07:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585405220; cv=none; d=google.com; s=arc-20160816; b=c5DQSkUGpQRkhlDOtZlYmJwddBomTyPAwgpx1uvx5zIKj2rb/NkPJoczm/BqkTEdSH eVbBqWuRF+Pjbp4K+wg3VmKv/3mj1h8fCwyCJbavKIc3R/z05GskjhOJfHI/rqweu7Um xyNf6FKGlnA6ng95FbCX96FIEhMKNGOvYT737wAtPg7xnxFQ6TDZ6dPHphAtgGJmMdut 3m5oQPwAciQ9D9Nm6DaGB6cVM5T3UtcV8NbSmdE0Bubrr83RgSPXb9OH5F5YVNFev8Nw NcC78Zh3NaxXmM9XR31x2AE8rsMeRrqRva5ck1BSuh3Qa9RQMxo9BQIY8KygL8gTd+rJ aneg== 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=agHfMVZgQyAzWc+xE2A3uRW+LADMSyDBRkU6dRMOtFQ=; b=N55656DxpnzjkJpictMr+2MlKBMIN+ZjZQw9zZ0YvQ36xI65b5pgu2NfTc5C00wzKH G1RRIoDTpbURa92lmGvdccJU02vtbqal9I3oKXRU/6+uUGsqOw+On5vGxKr5C/xmQpJ6 04HmafRdJDfnZXHohYsCUHm/BW07Lh1j81sCul8NyO+QHXVD3RFZwAPof1Dbc8D873Kj pzU1VCrBlK2vZAqB2Xd0kqnqZkVO2h4O2sPFpnAyw6ago15pKzVXeu/OJFJc+fnN918C PqnoezaIdexZRecWrimkuzPpDVgQ6qMWbi49qz5BWlNMLUeUlmAmN77FxvFTLilSXo9u Wf5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vyis29NC; 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 w5si1005940ote.129.2020.03.28.07.20.08; Sat, 28 Mar 2020 07:20: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=Vyis29NC; 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 S1727070AbgC1OTj (ORCPT + 99 others); Sat, 28 Mar 2020 10:19:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:52736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbgC1OTj (ORCPT ); Sat, 28 Mar 2020 10:19: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 3981720578; Sat, 28 Mar 2020 14:19:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585405178; bh=DmRm1XW1Ca7PlCzQEHXzzKOqmMJ0YhXAMURm8hKZGNs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Vyis29NCpotN072nPS6eVXuiIbhDAUhBvV0nst7vwKpQ2Mmhk40f5RI0C3RhbmczK T9RncQ5s48zZ56nCyIFgzh4iCRfC/62Qq6ZbV/njcXdKfzIzjlDUASp0rnOtna5ovB qGNVPLfc2WDaEv7zGXr+zOxZcQfq6K1jiro/9NJQ= Date: Sat, 28 Mar 2020 14:19: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 07/13] iio: imu: bmi160_i2c: Use vsprintf extension %pe for symbolic error name Message-ID: <20200328141933.24286f6f@archlinux> In-Reply-To: References: 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:09 +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/bmi160/bmi160_i2c.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c > index e36f5e82d400..26398614eddf 100644 > --- a/drivers/iio/imu/bmi160/bmi160_i2c.c > +++ b/drivers/iio/imu/bmi160/bmi160_i2c.c > @@ -24,8 +24,8 @@ static int bmi160_i2c_probe(struct i2c_client *client, > > regmap = devm_regmap_init_i2c(client, &bmi160_regmap_config); > 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); > } >