From patchwork Sun Mar 22 17:23:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451955 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 610761744 for ; Sun, 22 Mar 2020 17:23:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F29520736 for ; Sun, 22 Mar 2020 17:23:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qZ2nehnj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbgCVRXe (ORCPT ); Sun, 22 Mar 2020 13:23:34 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35960 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbgCVRXe (ORCPT ); Sun, 22 Mar 2020 13:23:34 -0400 Received: by mail-pf1-f195.google.com with SMTP id i13so6270727pfe.3; Sun, 22 Mar 2020 10:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yk81mErZFCEgDMsuaSaTdhcTiK3cd7/BpAVh8FBcQdI=; b=qZ2nehnjv+2gCtyyn9gCzXpY0kEwRKvLdO1lGZS20r1Kizc/kGTmx63fu3vkp3LbSW a/QW1NAbozM6qZs40S75WgGmHQpfU57U3m+UPis8QuJ2lH8M4PwvzUhtH3iGQXSeMN5u qpidVeN8Z6d/x4ZtdIxE1yxAbSLVKzYeE4yTmh9dYfY0d4CMyBkRuDnxasiMHWWjGXW5 +uArhV1EgXL3OR+LIw7HIdo7TZrjSyLyDRtB/cDo+Pe67cykRwq69xwZ9CrQVPytAN7T iG1TwBMYnhHfouge5DgdBsslMUNZOamgP0mdt14fBI2WOhQ5KL5SW83DMghUKWinpLvH eENQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yk81mErZFCEgDMsuaSaTdhcTiK3cd7/BpAVh8FBcQdI=; b=PYe7LKxj7C6eNnDirm6lEzoz29yllKOatQDKviEyexQsgKPcIqgMV1gnA5JS8VEZS1 mF0QrGcSvo8/nxJxw3hdSllymUKmSXw59dMvtuYI9RoAKtg49JgJeKMUd5Pk1IsFGohU jy9I/urGm4GzYh/rhSDmOMs3M8D1qblTWFOSgVVVPq1CwNQNg8xZpv/fLShWHw0LYlq4 2YlEbmI5dyNntYIijGhwBUt3jJMKo0V7XclpCVX2UCWdj/Wc9ux6pTAYcnUVvn4lpooT +ux3wIiiCArETVVn3ASPEmHWZXx5gyOCuzpKyQbA6hi6R43Dio/3UikuZ/Fd8x5Cf4lK hKDw== X-Gm-Message-State: ANhLgQ2S85/2eyZmAtq9VfG+DFvLsn8s3jWilPv5gspEkdBqj9qDp3W/ O2i3Xtck/6WaiS6g6vujZn9tLU7r0TY= X-Google-Smtp-Source: ADFU+vuecAdf9WbLOP2y4B7fzlEFGqZXDooDGiyEesPGMxX3AwZ3d/PphdRY3HsiBCTdhE2V9fwCtA== X-Received: by 2002:a63:ce42:: with SMTP id r2mr19145525pgi.106.1584897812737; Sun, 22 Mar 2020 10:23:32 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id 8sm11196331pfv.65.2020.03.22.10.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:23:32 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/13] iio: accel: kxsd9: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:03 +0530 Message-Id: <9fcebba578c1fe0b02bd1053e5b4d0ba4299452d.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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/accel/kxsd9-i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/kxsd9-i2c.c b/drivers/iio/accel/kxsd9-i2c.c index 38411e1c155b..b6f3de7ef8ea 100644 --- a/drivers/iio/accel/kxsd9-i2c.c +++ b/drivers/iio/accel/kxsd9-i2c.c @@ -21,8 +21,8 @@ static int kxsd9_i2c_probe(struct i2c_client *i2c, regmap = devm_regmap_init_i2c(i2c, &config); if (IS_ERR(regmap)) { - dev_err(&i2c->dev, "Failed to register i2c regmap %d\n", - (int)PTR_ERR(regmap)); + dev_err(&i2c->dev, "Failed to register i2c regmap: %pe\n", + regmap); return PTR_ERR(regmap); } From patchwork Sun Mar 22 17:23:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451957 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 919481744 for ; Sun, 22 Mar 2020 17:23:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 709F720724 for ; Sun, 22 Mar 2020 17:23:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pSAliulK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726137AbgCVRXi (ORCPT ); Sun, 22 Mar 2020 13:23:38 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40797 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgCVRXi (ORCPT ); Sun, 22 Mar 2020 13:23:38 -0400 Received: by mail-pg1-f195.google.com with SMTP id t24so5914866pgj.7; Sun, 22 Mar 2020 10:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3BqIOjfEqFOKLNKbBxzb895osWZYr0nQui1/0tSkFmQ=; b=pSAliulKEZxtRaGdwL2yaJHOhLBdQcfY446rT8OF59P23os5kU61bRSY/rQKcGAkuw hrACLdvvleLTm9zJ9jWsvsywkQDA1VqK2oxFIn6EdPM91ly5bbp1ihG2VNqDlgJ5a0dD iJMZGCw95XY3mtx7YkWKfjSYbtxcPW7/+ZwOIBRCJUXFIitg6E26HTHrhP8m0KTbRfWS S0XhlGrnGc89ckHNZXl1ZoZLcxxnjPfBGfV5n/3CQ8hfy7Mxy9r8DSgKZD8OH7Y1klu2 hZ3fWnULgleBuxmYctlltQhMOsVkIRwfMdolAZrIKbzXG4eLbfK4FS7XIyBZdjwNfB3E B7xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3BqIOjfEqFOKLNKbBxzb895osWZYr0nQui1/0tSkFmQ=; b=t5jk6Oo/+wIPzTC1L8axXNRg1wDxI/Aq/ndaCHCSEARFa3HV9LwyEx47UB5zGUXW1M 0UsRoy9BFd4IppjvqA2pXrTVMiAEA+PgrwF5oEqScLCQ9cyh6FwlczalR4+VfUmwz7jV 9z91yc/726OHVPKHNakSMKsYYZnCPoB9qXGGDinvPgA17vTOaBT19aTktYUh/1SBtW7p GHL2lHETF2zzH2TT3HYo5dvsy2ttZpSdcTP0p89NGmYsjzsujgMJU/sL3FVWj2SNHuO6 5MPFl8w1ir8k2sw1PRSqeRSP+iZlGJo3gRn+8oUgwqhJIG6ttPhW5hMxerR4oEeM276C 9WWw== X-Gm-Message-State: ANhLgQ30bUi1WgCE6bF26GFLvEzg4SKy5R3b99yndDrEbg65Y1RgugrY new/eCIP7BPPJDYd1ZXMniHGc9VMTNA= X-Google-Smtp-Source: ADFU+vsFhACvvTD967TNgSX83kYpy6sN7HReH0xa7VW1S87hMkGzZ8HZ6GEIfEbbYeQido8i8IvTeA== X-Received: by 2002:a63:e20d:: with SMTP id q13mr17764613pgh.6.1584897816847; Sun, 22 Mar 2020 10:23:36 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id o14sm6848768pfh.147.2020.03.22.10.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:23:36 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 02/13] iio: st_sensors_i2c: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:04 +0530 Message-Id: <1ac10121b5bd95fbba59d27482a77d55c2461230.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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/common/st_sensors/st_sensors_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c index 286830fb5d35..4f7ae273ac98 100644 --- a/drivers/iio/common/st_sensors/st_sensors_i2c.c +++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c @@ -49,8 +49,8 @@ int st_sensors_i2c_configure(struct iio_dev *indio_dev, sdata->regmap = devm_regmap_init_i2c(client, config); if (IS_ERR(sdata->regmap)) { - dev_err(&client->dev, "Failed to register i2c regmap (%d)\n", - (int)PTR_ERR(sdata->regmap)); + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n", + sdata->regmap); return PTR_ERR(sdata->regmap); } From patchwork Sun Mar 22 17:23:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451959 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8AB86CA for ; Sun, 22 Mar 2020 17:23:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8A7B20736 for ; Sun, 22 Mar 2020 17:23:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LqaFDxG0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbgCVRXn (ORCPT ); Sun, 22 Mar 2020 13:23:43 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33462 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgCVRXn (ORCPT ); Sun, 22 Mar 2020 13:23:43 -0400 Received: by mail-pf1-f193.google.com with SMTP id j1so3563031pfe.0; Sun, 22 Mar 2020 10:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=76TwRjRKJI+gH0FRwyhrG+QsrYGl4l8tRg46jH9R0kA=; b=LqaFDxG0/wxR7NtrwEQg/cHEmNo7flL0qP/UA58ljUOFvTuOxwFZyjGo809rCZhRMk g7a9kzsV6woYRqIIkcDeBMJpb8gPUKmsntpqOb8fK2t+XFg6QdbNiczT/rGpd/3jYGKv 5LjWHq3h8PHwE7syi336tEf8GqA6Rb58Y0mF1anPYlGGY2fA4/ZbsFflhjDeB/TmR2OF Rlj3gVJ0GJuvq32F+nG7ww+mt887U1tEtqu1RRPWpeft3saiZ0aTfRe5b8fdjRPxm+sb cByDBHaItmCjp/lVve/PLj7RKYKe5DzrMoUTRoTvlhjHQCW2IsDQTTMMkSioyeaRKE3f Sg+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=76TwRjRKJI+gH0FRwyhrG+QsrYGl4l8tRg46jH9R0kA=; b=qn0x7Cirpla5W5u5wA36mbOpm7H6Mi7Rh6H0/bAgqaFDX76qgtsTKGBy7bT5fcnJVN IXd9sa/gLETUyq7nj9HWaGQBJsAJDUJwmOpZr/4MsPo8x063fCSMUSOiDzQeMaMWIuOO aKPIWWogvfOiTSBInXkq3DJwXcnmoZX4emZsILqXANqwakdXUsLaDepq6rAMgbOTUD8w BawLIp0Ltg5WXk3AF6w+jBJa5Vo/Gu2Nxbdcw9ioCaPkEYKs8caN3/wuz0DdO9NtPySi OXiasN9C1YVtO5Nd4kGInLbBH/0v+EQSV0abR/V3WSkumG6F710IbpR5rpn0UjYdE5on GyYw== X-Gm-Message-State: ANhLgQ1P046aECf/spAB0WsUAN6mMd4tNg7jZBv5ipYORn2kqguATGU8 80fb087r5REyFWqVDfb7nyWB5UqxjcY= X-Google-Smtp-Source: ADFU+vu7BgIPeAFmXmkg25HJEQFzMDfFvDCfi4aLJBjtG3innZRrow8yoflmXhvRSQulLtttoym97w== X-Received: by 2002:a63:794d:: with SMTP id u74mr5797759pgc.15.1584897821646; Sun, 22 Mar 2020 10:23:41 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id 63sm11087191pfx.132.2020.03.22.10.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:23:41 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/13] iio: st_sensors_spi: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:05 +0530 Message-Id: <944c9c32f38a46e9c8589e5297866faa12b2d4ed.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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/common/st_sensors/st_sensors_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c index 1275fb0eda31..efa93928b498 100644 --- a/drivers/iio/common/st_sensors/st_sensors_spi.c +++ b/drivers/iio/common/st_sensors/st_sensors_spi.c @@ -101,8 +101,8 @@ int st_sensors_spi_configure(struct iio_dev *indio_dev, sdata->regmap = devm_regmap_init_spi(spi, config); if (IS_ERR(sdata->regmap)) { - dev_err(&spi->dev, "Failed to register spi regmap (%d)\n", - (int)PTR_ERR(sdata->regmap)); + dev_err(&spi->dev, "Failed to register spi regmap: %pe\n", + sdata->regmap); return PTR_ERR(sdata->regmap); } From patchwork Sun Mar 22 17:23:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451961 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83E191744 for ; Sun, 22 Mar 2020 17:23:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62BD420736 for ; Sun, 22 Mar 2020 17:23:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FPdMitor" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726756AbgCVRXr (ORCPT ); Sun, 22 Mar 2020 13:23:47 -0400 Received: from mail-pj1-f67.google.com ([209.85.216.67]:50746 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgCVRXr (ORCPT ); Sun, 22 Mar 2020 13:23:47 -0400 Received: by mail-pj1-f67.google.com with SMTP id v13so4996939pjb.0; Sun, 22 Mar 2020 10:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PBNDYvC6Ev7OAYWK0OL9zj6qOnU1gEAJkfPXlmTSuiw=; b=FPdMitorrYAb+ZmiVorDTEnesTF0mnBB3k3Ist8wGUmcqhYrwgRIn/J6pQKORKkOoN cSx/bIXgm9K7AMD5yiSbOy8tbmmz3fWP3yjZeykXEK/DUAnV1g/ukjB7L1fLeOZb21l4 zDZQrnCEJeFTACIyOUxEe5kXuRWjnDIJPoel4LTaM2g7xpp9L/gkZkrnWIvw6XkoOBMX igevwSqJaZvkwltILXpxVF8iAAHceEZXrVA6P0IyKRwbNCY/Q7U/JqL4NEgotbOZ/FIX oPRrC9pgfVrmzKD5BCiJVfUJXCLPGu7t2wxBWPIpgJmMBHweQaHO7xr0LS0xQtKChY3l fPdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PBNDYvC6Ev7OAYWK0OL9zj6qOnU1gEAJkfPXlmTSuiw=; b=Qkcbz4ZcPhojb4fVTTX56mzjwJDvnaf7bjYPttjhEJ0TG6rfrorfqmSzfNoy4jK9IR TPAjyEVfSbk18d9puQOS5SG/eV1JIMnpgGCcfUYjlX7zm0cKbmpQtIaRc/OKhlYBvxFo gsTKo5uUw3LRaZ0d1L2d7s2IUfOShlTtdFWndv6p/KlJ7DCsdmfW2IldGuLSEQbt3Ac5 9mrVt0giPW6+WrIuMAP6J7V0qrbdihNTw4AqjExvT82gGRM3tr8mE7QplGPeMLnPgmZd RwwJmm/Fy7Mn96Z88lZBgYYbgRVVcVURZ2gnXyArBBD1DeO1jIXaWLQ1nRKI3UEhC3aN im6A== X-Gm-Message-State: ANhLgQ1yt/VrjKdgVLgutOrogGRz9cKdQLUFWDg2Qf3vLpool2iUoMP1 n3XRIZrElhnZUv+Efh0DIQTio8acEgQ= X-Google-Smtp-Source: ADFU+vuq5X8Yd0plpiI9zuabaDurqSWHxxEjAcJVCtBAqOBcv+8xGq4+U8uVJMqi3a/i8uUBTGLDWA== X-Received: by 2002:a17:90a:25c6:: with SMTP id k64mr20638700pje.9.1584897826181; Sun, 22 Mar 2020 10:23:46 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id j17sm11035078pfd.175.2020.03.22.10.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:23:45 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/13] iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:06 +0530 Message-Id: <5b9a92dee27f406556b4c945f773ef9b5eea825c.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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); } From patchwork Sun Mar 22 17:23:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451963 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17EB76CA for ; Sun, 22 Mar 2020 17:23:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBDDA20732 for ; Sun, 22 Mar 2020 17:23:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mc8mwqJb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726982AbgCVRXx (ORCPT ); Sun, 22 Mar 2020 13:23:53 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40999 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgCVRXx (ORCPT ); Sun, 22 Mar 2020 13:23:53 -0400 Received: by mail-pg1-f194.google.com with SMTP id b1so5914693pgm.8; Sun, 22 Mar 2020 10:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dzqTOr/Ct0ew4Gio7wT8ChawKW/oH3zTwumYAtCINQ0=; b=mc8mwqJb2tph04UnQuNmIi0xUe4aSfZZdRsIl93kigK0ytTr8nWtm6atNVmlhUEZZk s8GYyH4rxj1IiV2Z2LXsl9LHVfzxbGqDQWjuctTFTEqULoVe8oLJryuCeNGYnL1xyuk/ bxu0xd1hStFFwutqyHEh4NfxXkH4bRp3SUcZqikiAonpPKKs8I75qXunFo9GDQETTERt ePhHVfCpNZBVjVLFp4XNL6VCGeIL3GBIfjDgZ0FLFNs6fjX6G3IMzxisCJ+R0dhA0MWH 3j57UXC8T1TzQnHIivIThCrxxxayQ7t9GHkIW9UogByzu3eVtdlun19CE6vcLg7QeLpw NHqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dzqTOr/Ct0ew4Gio7wT8ChawKW/oH3zTwumYAtCINQ0=; b=fecmxBD6PhCtLt/NGY1llscU8X12CqEfeyB0HGTDitbyvEB3ZnoGMvPVmLGF6012gg kTuc+OQ6BITqlLQPVlxIe9OtNHGhCLBXQZ/rdRD7yz4ze0jmUv3rGI2exW+lEJgX0v+3 N7jmimShB2IB3tezr9pg/JytyNHy+ULWgj632JGVS+yAxZL5eTfjbX3GbCuCVafdGuad cfYrzK0SKjqzXEsCOuEtYNd371jQLuWzjgW2K93PMbbphvHcLYvqaarmIc143uBnY4b5 3IB8WpStV+ywzPRc4ewqU+bM87HkdISU8Zc6aW4q7Ku1tMmnadC8luUhSKw4Ont9UEL0 fy1Q== X-Gm-Message-State: ANhLgQ0w09aO5+jl3y67LNnGoC8tvitTJI4tzQdmRCZLYfpREJ5oNyJC +vyVMFJ35wavRF5hEjNZXmZSV2aw8nQ= X-Google-Smtp-Source: ADFU+vt/tKO9GaS+ii8hHVtciw/r02L0CC3VXZY06TFWTcEUl69vfrk8Gtp2PIbXs0dzzE+WetvJ4Q== X-Received: by 2002:a62:8342:: with SMTP id h63mr20064246pfe.24.1584897831394; Sun, 22 Mar 2020 10:23:51 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id 1sm9945022pjo.10.2020.03.22.10.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:23:51 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 05/13] iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:07 +0530 Message-Id: <5f2c696ab083108b18898bcead8489f46d000114.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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); } From patchwork Sun Mar 22 17:23:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451965 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06B3F6CA for ; Sun, 22 Mar 2020 17:23:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB61B2076F for ; Sun, 22 Mar 2020 17:23:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jZaatfz3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbgCVRX5 (ORCPT ); Sun, 22 Mar 2020 13:23:57 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33477 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgCVRX5 (ORCPT ); Sun, 22 Mar 2020 13:23:57 -0400 Received: by mail-pf1-f196.google.com with SMTP id j1so3563224pfe.0; Sun, 22 Mar 2020 10:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1XoxW2Qz/sPmq4hkeA1eCu1we+XWlGoqcKYyelXiH0E=; b=jZaatfz3o6jPeyPpY5w98ezu2H1KszAkM6VlMeW1RpFLBVmlZTU3Em2iyL74M5QrDW lDGwuCA3e1nH4El72kpAPOLRMJkPoI04zKucF8BDfe8ut/eLd4K1jog5aU7YTZJz+0sH vgV2sfZ7WEXxzRzCffU0RclRWsZuR8aLD7K1IhX7/NJCS6UvXnJLH1D57lwhuNyg4W+K tV0xgQ9dnM0LJrOlVOFT7MGb0WTcC1Kkj1IwZ6eUgh/gaktV74y3HF+3WG57vRoIkyon ya1iXmq6U/mFmOlqmeerrWK7iWs8qp/HZ59h5fO/SHDeC9lmmUrzW69JltHcujHAjMOl xN3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1XoxW2Qz/sPmq4hkeA1eCu1we+XWlGoqcKYyelXiH0E=; b=dnhMAQa7yHh1pbN01fhM/r62wuCfQzYdABP3wUe+96dPMUcd4OTZ+DbD3K7CgCJazH wlheTnkuHH7Wik4UtMdGH7lxRWdSrlWE+fogDID2r8dFJqY4bpapAXKbdCU1Gogyrb3r DWzIwg8mfD43ZrGWocoEPxAF+D9saS5AXUwRy20T++aWEDhVVWfJMoKsFTHMeHN9Y/i+ g7Qkt8u1mTkkbpzDmKkZW3V3LBhNwx4B3k4zS2NgElGmlBgGkJXcHnn1V4u8TlGDUpRe BROCxiUUrURhzaBadPamcT5RnmCC/TmkOoesrdD/eKJG+Lbm6xWysOB8PAbAwluzTSse iu2A== X-Gm-Message-State: ANhLgQ33TF5OEFEBoHmAEtUbtJaGdldxPgLuiUy6KSjHK2h6PQTIiB5z I3hWs5SsBRRYdD5UQ6kXCj+PNTs30Tc= X-Google-Smtp-Source: ADFU+vsBKtlQ7hP0Py3i/H/FP4ZjfGPLa9ZQTvp0HXtEd+ZdadIOQtQAlUXmskgMZKTu00+v9pl9lA== X-Received: by 2002:a62:b518:: with SMTP id y24mr19347104pfe.261.1584897835386; Sun, 22 Mar 2020 10:23:55 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id z63sm11018751pfb.20.2020.03.22.10.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:23:55 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 06/13] iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:08 +0530 Message-Id: <14680ac5ac651c53f050b3f6d2d9a6bd863d5e14.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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); } From patchwork Sun Mar 22 17:23:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451967 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AC306CA for ; Sun, 22 Mar 2020 17:24:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59FAA2076F for ; Sun, 22 Mar 2020 17:24:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZWMFjAh/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727009AbgCVRYC (ORCPT ); Sun, 22 Mar 2020 13:24:02 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40823 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgCVRYC (ORCPT ); Sun, 22 Mar 2020 13:24:02 -0400 Received: by mail-pg1-f196.google.com with SMTP id t24so5915190pgj.7; Sun, 22 Mar 2020 10:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w5hNnGvnpIBPboxkt9ohs0mcZDvHErpE9oOT4gKmgcE=; b=ZWMFjAh/4kLC7XCS7Ew6ChOYVy2XgDxAwWjvNusQbb3+BwebchYdp9EMij2VRDn0E5 Jrjy7zyDChfmvzcsmPXrv1ug7ACiH2y5yG5aGh+8IKwBzYg9NTmn//tr5fjOXFNzt5T4 DFbseBRult7wWSxn7Lndgh/rP2Z11kyVW2YCaqDpPl2rmKJCsmwb01slUqmQyp1GRx6p zTm/Koe2YCaFbckGdOGqopmgDPL4aCSXdcpN8E/CAE9zEg3PerPW2h+D+DZ7x90Iduwh ccKzVU9SEMuiPpoeiCzc4G1XR44hJ423ffFzlWUr8H542FyBW67cvuBLl11InL6UUtEF vQkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w5hNnGvnpIBPboxkt9ohs0mcZDvHErpE9oOT4gKmgcE=; b=tgogaNOyLCnjpgvDmFAY4p6swGUIKeEog+0HUy/+LEzyRG3+bQfcDBO8qb1+vTPHZG OwxetSSpVodnIBUAm7pO+ZUtXCG0r1GMRRF0/jeV3Jzujr0y7yTVTZ8s4kpmCfjaLoAe WM4yRsw9SWcZxi+d0uxR7xG4Vyq87TySE0dYp9dn2ELsKe1JpL8ga+qoSm0ZCq9KOqHW /CFBRk0/bfOHMO5Zz8SOVeFoWrb1hv76vpVc48TAQieI3GtFSAeBO66PrPVD8/LV7c5F JedKQnb3+iHQ9eTIOAWgLeCYV7/jqJSUHRpolEKTY+Z13ay/Uj8yJ0Y99ZuUipUvgtWx iLVA== X-Gm-Message-State: ANhLgQ3iZX3kFo9iKdmu591NHwWXnFOpJcg7QxYBCzebrHX1ecBTwQT6 KeV3CFl2Y5VsygOjKt8z6QzESbNBHig= X-Google-Smtp-Source: ADFU+vsMIK9dhHMXlazDn+Qwea8VtOReSZ81jim9/nzPxPRTG/1k81p5Wtjp6J62GCqSw1hOewQpug== X-Received: by 2002:a62:7bca:: with SMTP id w193mr7312858pfc.319.1584897840880; Sun, 22 Mar 2020 10:24:00 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id g7sm9721173pjl.17.2020.03.22.10.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:24:00 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/13] iio: imu: bmi160_i2c: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:09 +0530 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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); } From patchwork Sun Mar 22 17:23:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A3931744 for ; Sun, 22 Mar 2020 17:24:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59C0020736 for ; Sun, 22 Mar 2020 17:24:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mKFA9CDY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbgCVRYH (ORCPT ); Sun, 22 Mar 2020 13:24:07 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:53528 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbgCVRYG (ORCPT ); Sun, 22 Mar 2020 13:24:06 -0400 Received: by mail-pj1-f68.google.com with SMTP id l36so4994001pjb.3; Sun, 22 Mar 2020 10:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xLrIs6rvWHh+rmiQjA6RoqzW6JxJJAgVh27Il2Ppij8=; b=mKFA9CDYuYQExPeLtFhGShyTkr3PmK5VnGjFTUS8Fkf0wo55H4lHgLBjYqXnEsfLcD dzLdwHKPYFz/ZeYY5W6Rir4wlaIs/BSEZAo31NKROIV05cwiaqhC5qrZZqHWJ3WAR2tv zXagGnRGQkbdjidkYh5OF0rgNsyMjOAKfPywjUvLp7mTgn8J9IWezbUkzW2uZswu71D9 r101qcxBpNzNP1YXcUnGU8G//UTUgWsJLO5sPxOnNhV/tKvNU9vI7j8WqAGdXVtJfjvX jGSZbT1caB07I+vB5fdg0b/QZgv/nIaoWHDEJioPDx/a1Sfhqeu7HqywjvQpeNPfO/fc hq4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xLrIs6rvWHh+rmiQjA6RoqzW6JxJJAgVh27Il2Ppij8=; b=eoH94XjhstZSI0MYThSxCaCSNMt4quFBsfKNhhjDtsGQXqAo75fY4zc6GVDVqotUFi aPNwyyY/Yas8N97ePX2p84jjZCtRlmb+tvD4D6oHL9D1aVmuCmRty1RwyoWrLNmcmPKb Beh5GTtxP1tTD8l7VCzniOpNMdV8Npt4z+jSrerDXPmh+nuLfslXvJAwYMr1Vs3Vv2RQ hGMj7aS+NkzR3+BmA2+ubo5NhCtSmGk4ANRevoSQMRLj1vS9RCEVeo0PHuC6IS5BBXcG inRibc+yC6kfeLDO7cCVnNaHpahPKMq/fWvnTRLl+mkdlX2ifCioRscxyuQl/OTXx1kF oBZQ== X-Gm-Message-State: ANhLgQ1vTz04k43UJmo4ME89WtpdzmyAQcBnb3haaYTxZ7j7JRAy98Ag QJ17rW6MsfoSmYGFqADCeRFSmb+wzes= X-Google-Smtp-Source: ADFU+vtLOf1pPAxdme/fuz2vcGwaFfTtmCfANGyHDe1MSOGjPBKAW2OgBs4ARpnNIqwhhfFk26Fk7g== X-Received: by 2002:a17:902:8492:: with SMTP id c18mr18567787plo.147.1584897845635; Sun, 22 Mar 2020 10:24:05 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id 4sm11097790pfn.156.2020.03.22.10.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:24:05 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 08/13] iio: imu: bmi160_spi: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:10 +0530 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c b/drivers/iio/imu/bmi160/bmi160_spi.c index c19e3df35559..61389b41c6d9 100644 --- a/drivers/iio/imu/bmi160/bmi160_spi.c +++ b/drivers/iio/imu/bmi160/bmi160_spi.c @@ -20,8 +20,8 @@ static int bmi160_spi_probe(struct spi_device *spi) regmap = devm_regmap_init_spi(spi, &bmi160_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); } return bmi160_core_probe(&spi->dev, regmap, id->name, true); From patchwork Sun Mar 22 17:23:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451971 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E3BB1744 for ; Sun, 22 Mar 2020 17:24:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DB5720732 for ; Sun, 22 Mar 2020 17:24:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bNO+ajqV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727053AbgCVRYL (ORCPT ); Sun, 22 Mar 2020 13:24:11 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:35229 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726979AbgCVRYL (ORCPT ); Sun, 22 Mar 2020 13:24:11 -0400 Received: by mail-pj1-f65.google.com with SMTP id g9so851073pjp.0; Sun, 22 Mar 2020 10:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8skkcssSNgdjneuaiIJV/3MteoLzOQKPwqhS0PAJwH0=; b=bNO+ajqVMOKuNqyt8Ks0pRgH46mEaQYeDU3dglfqtaZSPF/GRKj8F+gFOHQRM4XvJc 6kfTgouljG88qVHp16Dxe1Yu+n+Uf6QasnXbBGqnIB9Y5NnoL7RWwU7mXxt7W6YGguXC Dy6hmy56VOQsQCWjda8l22zj7y93zxACT0onI1A3257dLx/zhGmcMJCkCBdpSHrnBEnF KrmN0JSZygrvZwW8uhcIwEaQoIftnhHJCEXi4IueSGzAegJJBUTcT06ypXAssErsE3sm Po3UTbsOkuvKw0RaP7a7MYIa/flIisYfZIPpvqzJmBdHWAEg4Pj5uexhymgXgyrjfDXu br5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8skkcssSNgdjneuaiIJV/3MteoLzOQKPwqhS0PAJwH0=; b=Y4r3cnDZoI3Yysj7EV0nSYDpm58cYpnQRVm9fWgHHNUfqFwRm8yXODMHnqaWmfTUR8 mdmcw9T/JH0UbbjtWyPyqiH+cgblzxvk9ShHQRdDR1k3CsBHtfHKsjlBRzXpjyyGzazC N3Odt5UI6vt8CiEQVVIly9xK3FTPJLaZ5mhfINv3+ESDdw5JImounTSOSNKyiJmmJ4GP u2JexdTf9MkSFENz49RXz1ZMc0B6/HTdVYIKVRsrH72sJnVFTG0nupkM8MQVDkakfRMH p+hgSBR2Z/v2CwQMRY5pZc7ulLWxSre5TN2pe9qO20gsbHpu7bWyDDoTqNL/ZYweyvgL MRMA== X-Gm-Message-State: ANhLgQ2d7fu0CIadMuKnD5UNI4Vwp/OIPBrssSKnJkX4NzUyPHWa2sN0 tY4fnFIwxD148iwSIDUan10tVEMP3Ds= X-Google-Smtp-Source: ADFU+vtneQwBjY/P3GkO9+Nje89nzY0/DIhaFvTusi35I9wvusuuVFXYjy/0skykNeF7jmU/GvPcPg== X-Received: by 2002:a17:90b:3789:: with SMTP id mz9mr20667515pjb.43.1584897849913; Sun, 22 Mar 2020 10:24:09 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id i6sm11304108pfe.62.2020.03.22.10.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:24:09 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 09/13] iio: imu: inv_mpu6050_i2c: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:11 +0530 Message-Id: <83719d41f051774c971f5ed87ca1289849092110.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index 6993d3b87bb0..28cfae1e61cf 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -122,8 +122,8 @@ static int inv_mpu_probe(struct i2c_client *client, regmap = devm_regmap_init_i2c(client, &inv_mpu_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); } From patchwork Sun Mar 22 17:23:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451973 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF3816CA for ; Sun, 22 Mar 2020 17:24:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E15420714 for ; Sun, 22 Mar 2020 17:24:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eQv8Vxi5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726979AbgCVRYR (ORCPT ); Sun, 22 Mar 2020 13:24:17 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41019 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgCVRYQ (ORCPT ); Sun, 22 Mar 2020 13:24:16 -0400 Received: by mail-pg1-f194.google.com with SMTP id b1so5914999pgm.8; Sun, 22 Mar 2020 10:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jqDwAwDGYi3NjtIZPjj59FRaeNL8mMNiw+rFwyMaw8M=; b=eQv8Vxi5OCtu4KAToedqOkuDXWQiXchP3R10tDzmOjvd9NTfj5VaYfYVYESJdWNJjI QIkQn92i+rpHA289Hf5BB7aP78ABuCKG3tgaL1pI7pFJUeSfN+IKHsFvewpocu6wv4k8 2LO/x+JXCGK/QGhayGciV3nuOp5xbOxNY3/vs8bZmkO+LCts5e2KYqdtO/Ecuhq3fWaQ DXM/Is5ONijFveR+lZ903Rw/VTWmfwDCB523u06dUGv4GvLxtLi1WwwsmQ1X/lKedleH 45cnooWX645BgzSb4cAHefustE2bbdM3Sx2boVwfnyvfeaaoRM4N5807HSXK2zK/wYJE VQMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jqDwAwDGYi3NjtIZPjj59FRaeNL8mMNiw+rFwyMaw8M=; b=UCmG3jwg6CH0zn+Bpa969+WBIkWq/jY0UZ5bTjlbcXwEplni6GP900wcvEldZbek2S owFtrBj0YLq+sAO+AOqg9fZdIBjGY4YboIDaQwUZYsm82G5IgST3hNmAIpoJkLaLZzTG VoKdlaXeMHZAOk60GWpaAAQbRNP4Bwp0qmNFwc/uoP+PYF2xV/8HaII/IDa6AbLe2Hmm 798P1ey3wgONTH9fI7lrviQzZFdGlY+qD+JvNsp62TtVWzsi/Kmcn2rnBTre8030YyJ2 87TEI0LcHhCiHTDoGCdeyRcnIUrSmD1/ve93YpmoI7gF+UxJy4oDwJbS6ar3Zxo4/+cs HWhQ== X-Gm-Message-State: ANhLgQ1AcN6lvTUNSU/60u61eBksUDWHfO3mPlhsGWu4PHnj73eecH1K AkJ2l6ESw9G2hZRMwzfAlR5OzBe+Lkk= X-Google-Smtp-Source: ADFU+vsVQSOLM3hwr9igAdfIqoczKO9VGnvOhPOd3BRgd98WflVLEYRd3f27umnu9InNXNeqU8xvKw== X-Received: by 2002:a63:6ac1:: with SMTP id f184mr18713650pgc.212.1584897854957; Sun, 22 Mar 2020 10:24:14 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id g2sm3766422pfh.193.2020.03.22.10.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:24:14 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 10/13] iio: imu: inv_mpu6050_spi: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:12 +0530 Message-Id: <99e93b0103a6af19d8c7b85cfefb3055e5d0b06a.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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); } From patchwork Sun Mar 22 17:23:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451975 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32D0A1744 for ; Sun, 22 Mar 2020 17:24:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12E342072E for ; Sun, 22 Mar 2020 17:24:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sXZArKyx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbgCVRYU (ORCPT ); Sun, 22 Mar 2020 13:24:20 -0400 Received: from mail-pj1-f66.google.com ([209.85.216.66]:39458 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgCVRYU (ORCPT ); Sun, 22 Mar 2020 13:24:20 -0400 Received: by mail-pj1-f66.google.com with SMTP id ck23so4929114pjb.4; Sun, 22 Mar 2020 10:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zi/SimNCLHsM6Lyl/4wIByF9nvsrSbfsw/JTVRXPkk8=; b=sXZArKyx42yNHqiaaXlaEd/SVBJzNETjGFgFOgPgYMEbiB0DV8HnGx3YCUsySEbEyi 2MkD/ZzABiiqd5kjHPwsmw4AMFvTJbhy4TUD9D43mLxshBzF5stwkW0X9Sb6ubN0HB+a Vfv3H2Lt3wlr35f4pCJndRBDvTNu+2ulQgTXnTTlYcTjPsMG8bb1RUwjvNK4MrR/ICOv xhrnp3/R5uz12YI/8Rd60ssmEZv1oTNHuqnpTb+OAJmbjo0V3pnAyZypZgs9p378jzqN flg3J5TTbhkNZa2JK7hS7pTQEGzpe14kp22MS8pboKs0Et/NL/CRYxefd4HLeuXmSNfY oxlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zi/SimNCLHsM6Lyl/4wIByF9nvsrSbfsw/JTVRXPkk8=; b=EFvPsvdUufn9dTpBYfk01FwLsOyk9XVlCNZ8iWYGXJVIWaFVjdbJpFVcvEU6HOYdz1 mQV5HurKU4jUz7MRDFBytJL1OOp/4Q2oemzAxDIxnlWrxyUbc1TMDByS2WNfh+zkCeE6 9GhEJSLD+mOGcDPbtLi3PQlCg09pvNhLS26IAGKDLt+xBNYnBJ1N16ulpDWK4LMibwIN 9msFdgLs6x3frxLtEDTX8tGeYL8VSRzI1rcpQGQdQSRhFIkIOJkMJL5ecdUyk3uFmmPj 6rr9Cj65m/fYOad2v8y/KXk83+TO+eVI2gpRRixj0ijxuXOaGAaNDkkvUnVRf6rq09rP Tb5w== X-Gm-Message-State: ANhLgQ0y5PfFYZXHRHzdkrDc1abStiksWFKOrH8aCX4u5EHdcyx+pizN hTXjgvl3X5jvwxm5jtRV1GOaYaF4feU= X-Google-Smtp-Source: ADFU+vsyP223QwlrvW+Fl5bVftT8aVDmuxSaeBBLYq3SWugUTTnOK1HnO1mESTJQl6dn80VYkpBIHw== X-Received: by 2002:a17:902:342:: with SMTP id 60mr17358224pld.206.1584897858747; Sun, 22 Mar 2020 10:24:18 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id z30sm10926569pfq.84.2020.03.22.10.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:24:18 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 11/13] iio: light: st_uvis25_i2c: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:13 +0530 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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/light/st_uvis25_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/st_uvis25_i2c.c b/drivers/iio/light/st_uvis25_i2c.c index 4889bbeb0c73..801f754bc1a5 100644 --- a/drivers/iio/light/st_uvis25_i2c.c +++ b/drivers/iio/light/st_uvis25_i2c.c @@ -31,8 +31,8 @@ static int st_uvis25_i2c_probe(struct i2c_client *client, regmap = devm_regmap_init_i2c(client, &st_uvis25_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); } From patchwork Sun Mar 22 17:23:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451977 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 735771744 for ; Sun, 22 Mar 2020 17:24:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 523C220732 for ; Sun, 22 Mar 2020 17:24:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="t1++tm0e" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbgCVRY0 (ORCPT ); Sun, 22 Mar 2020 13:24:26 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36617 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgCVRYZ (ORCPT ); Sun, 22 Mar 2020 13:24:25 -0400 Received: by mail-pl1-f196.google.com with SMTP id g2so4848200plo.3; Sun, 22 Mar 2020 10:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Krx2PNpOiKc1mA54l0I3onUfFElu/EGLxiOWDjWy06E=; b=t1++tm0eML5cs8hohL+CrKoIo8MsGQbGNxMBJSrYyniaKJelGjfC08PCmkzpRoAc5H Vm4rwZHIbY5btYWsHg5vlCm+iebQCr7pdmCF57745PkB3uPPUixSsi7obwhZEZIVOZQJ Bvpl8CSD5OWrrbFh3mKqtuX9x/qZOI7cZu3EXW3H1OnwbNG2bRgdDrw7yZforRKpbJKL MKxqEfirg6o8cOCaMhm+FbHzldk0JoUaN8nBA2u9+h6GwP/TKJsGFtRy9DXCpXEQgq2c 2GVhxn3jyVg5Wg4To3Lg1mWTNG1mf1F1vfT1mgdewF4iJMdPlQLm4nMy7/TsJB8mo6bO fzyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Krx2PNpOiKc1mA54l0I3onUfFElu/EGLxiOWDjWy06E=; b=M1jw5ng1hIiY3wcX0f57caThDaI7muVpuis8T5r6nAF0lp/aZeWqFO3lKH6HulOWw+ dXiIalUCSJ4rAAQ+uxxSo9bnFalx+A8lva46jG+Vti8ZEAi+2DzjH8nn+P3g+ZZmjt7W rz1jD3Xct//Knar9MjDYCmY1dha3BXiwuM3fMd9vooMKxOm8CKhRWdEKOG9jSkbN1qDv Dqbg916PCBfnvWcjSYAH0EZJizOGcw9GxrcRhM63FFFnSQpo9RJ6Z/fDvOAZ1hKH5EsQ LkvEMEu42agFpMKMnJdes5g8pS9EqAmr694/TfVbVO7eRHXZ6e8CKptfT04GqcSlslLQ fnYg== X-Gm-Message-State: ANhLgQ1NFWpKDSx9W/HRRNM9kl87h/H5Pdo4caLEkykhrgDUVzfQ7mS7 GZ+seuoMFQNjvkHlNRGpRd9DX40GSVI= X-Google-Smtp-Source: ADFU+vvriGUJVzsQgeERmOmIQA1NZRWpuQ2s6hAiKzpCGa5l2HD4oqxZfkYPzUwEqKTVehoMph9LfQ== X-Received: by 2002:a17:90b:3656:: with SMTP id nh22mr3309015pjb.71.1584897863842; Sun, 22 Mar 2020 10:24:23 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id o128sm11422418pfg.5.2020.03.22.10.24.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:24:23 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 12/13] iio: light: st_uvis25_spi: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:14 +0530 Message-Id: <45d5a4bf468c490522d55f5c763061976804bf67.1584897364.git.nish.malpani25@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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/light/st_uvis25_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/st_uvis25_spi.c b/drivers/iio/light/st_uvis25_spi.c index a9ceae4f58b3..ae57e80a2e8f 100644 --- a/drivers/iio/light/st_uvis25_spi.c +++ b/drivers/iio/light/st_uvis25_spi.c @@ -31,8 +31,8 @@ static int st_uvis25_spi_probe(struct spi_device *spi) regmap = devm_regmap_init_spi(spi, &st_uvis25_spi_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); } From patchwork Sun Mar 22 17:23:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishant Malpani X-Patchwork-Id: 11451979 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DDBC6CA for ; Sun, 22 Mar 2020 17:24:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DA8B20724 for ; Sun, 22 Mar 2020 17:24:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Fz7Iizoy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725881AbgCVRY3 (ORCPT ); Sun, 22 Mar 2020 13:24:29 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42639 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726583AbgCVRY3 (ORCPT ); Sun, 22 Mar 2020 13:24:29 -0400 Received: by mail-pf1-f196.google.com with SMTP id 22so2661562pfa.9; Sun, 22 Mar 2020 10:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eoICbZdrd63nRhP9W5legHD2adGutvhEft5WhE/G10k=; b=Fz7IizoyXm66jwJQrY9CDambmJPHpX2RfQjmLDayM02jE0jIyj5RvCSSnmREaIK7Fn L5PXE8EIA0yCuq79kwtW0N+gslcZDeU/B0k0GcA557LG6DxvAAQUeXR3ZChek0O/lu7m Xk0Z93csBmvR27nbgF5BkuiQUcJvLvd26lRnDkVYz6W1r3enuwnCS1gcoUD2L/L6djAa 49APvurYzSK5x67lTy0IdFRFPi/QYtvjgqoMzSZHl5sv0OofKFcb88iv7ezLb3AtlECy eYkMRoUAFLt1mgMRdTmBqfTysTh2dYNYKjSgIrqU3K/9f3u/yrHRdpGna1D8bgvLGMTk Rqcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eoICbZdrd63nRhP9W5legHD2adGutvhEft5WhE/G10k=; b=j+P0USnyn+d/UZ87xJtORU9KjNS8VHFsfE9jW2diXSkuTsjwWw94IPBoxJibQh+/Au kLofeGARU9WIoC9/stsC90TRqaKQJIYpEMkZTkGAqoAsWAS6I95hvvEeHsfoPAPWB6AP ALfUmAyNEqwtVpMZTQVMwYQCFeijJwWsufiHpYP9YiKcsOz4bHslyWooPbyRtK1Ey1SK JuV+ILUxU0zQMb3bUHYfgDgbv9IxXKjGU+vNHt26QxQyRl1je+a83qm19TNj6wFWdMff JTcz8RzN5vMe5i14erwmzqaOhVpaA2REmohPBrOr1+LLg/AdQBtttCVkpfDYL58p+foi WK1g== X-Gm-Message-State: ANhLgQ1D2aewcrJwRrFTd7Qc0uUAidr3MTB9E2jOse2rYmK7DqEgW+dG RZrNj5OJ/inbunFqkvj90tvyfTT2mNs= X-Google-Smtp-Source: ADFU+vsW7XsPITe5FLiUnWASfzdCBcfCNkjvekEE0amMT97wkN7DS9h+7UUmJFDhv8qcv/qsibYkdg== X-Received: by 2002:a62:7c8b:: with SMTP id x133mr19820054pfc.229.1584897868065; Sun, 22 Mar 2020 10:24:28 -0700 (PDT) Received: from nish-HP-Pavilion ([2409:4072:992:9f95:b1e5:4cbf:6219:65ee]) by smtp.gmail.com with ESMTPSA id f15sm807449pfd.215.2020.03.22.10.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:24:27 -0700 (PDT) From: Nishant Malpani To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, joe@perches.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nish.malpani25@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 13/13] iio: magn: bmc150: Use vsprintf extension %pe for symbolic error name Date: Sun, 22 Mar 2020 22:53:15 +0530 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 --- 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/magnetometer/bmc150_magn_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/magnetometer/bmc150_magn_spi.c b/drivers/iio/magnetometer/bmc150_magn_spi.c index ed9be0490d77..c6ed3ea8460a 100644 --- a/drivers/iio/magnetometer/bmc150_magn_spi.c +++ b/drivers/iio/magnetometer/bmc150_magn_spi.c @@ -22,8 +22,8 @@ static int bmc150_magn_spi_probe(struct spi_device *spi) regmap = devm_regmap_init_spi(spi, &bmc150_magn_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); } return bmc150_magn_probe(&spi->dev, regmap, spi->irq, id->name);