From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15034C43331 for ; Sat, 28 Mar 2020 14:18:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE4372074F for ; Sat, 28 Mar 2020 14:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585405112; bh=J7PzmXWOCYSbZWhlJbd49wJlyF0RYCui/3rt6HUSipc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=GhDYOjlCqGu1clmX73Ba4HyJtY2r1dls23ssCQzjyWNg7x2UWop/DyhWNcf3eVati IU1PxtGM+z2dioZjA+LMe8B70R75L7Jh21+qZU0pAaoqsk7dtLvDCrMs0DX3KFDQTg E6rKmjPpkgBYVWBcGwPcboYjQdXBEDOo0jB5mrj4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726403AbgC1OSc (ORCPT ); Sat, 28 Mar 2020 10:18:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:52664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbgC1OSc (ORCPT ); Sat, 28 Mar 2020 10:18:32 -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 45B62206DB; Sat, 28 Mar 2020 14:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585405111; bh=J7PzmXWOCYSbZWhlJbd49wJlyF0RYCui/3rt6HUSipc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ujy9iRpJ0Jfd82m0dQVS3NGOI/EVtc0d8l3EOMsP9BHqHTtJqLv8JM0N7nVdF15Sb bfiL/wA57by7LoYWb/WeT4TBBRAjg1sLhy+9ca5aheTYp9nbuh0k0VIIGypAd34lgf BTngN6gclDG3duxCmVh4SbJKQ6r/NRcW+bO7uboA= Date: Sat, 28 Mar 2020 14:18:26 +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 06/13] iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name Message-ID: <20200328141826.0873f398@archlinux> In-Reply-To: <14680ac5ac651c53f050b3f6d2d9a6bd863d5e14.1584897364.git.nish.malpani25@gmail.com> References: <14680ac5ac651c53f050b3f6d2d9a6bd863d5e14.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-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Sun, 22 Mar 2020 22:53:08 +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/mpu3050-i2c.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c > index afa8018b9238..ef5bcbc4b45b 100644 > --- a/drivers/iio/gyro/mpu3050-i2c.c > +++ b/drivers/iio/gyro/mpu3050-i2c.c > @@ -51,8 +51,8 @@ static int mpu3050_i2c_probe(struct i2c_client *client, > > regmap = devm_regmap_init_i2c(client, &mpu3050_i2c_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); > } >