Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2902748ybb; Sun, 22 Mar 2020 10:24:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtYU8dH8bGYwAdwIKeqyILyUBL+fzk4EFFGlhWydAyMjgqCAO3OBgdUG+QlaVypKeJwFODm X-Received: by 2002:aca:2b04:: with SMTP id i4mr14544128oik.61.1584897874402; Sun, 22 Mar 2020 10:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584897874; cv=none; d=google.com; s=arc-20160816; b=RJpeBcyiCo6593LJHUvcBW98ezGOTJ/gNtZLIHv5yt1YUjW7AcUtENX9WYmLrtuE7g lAjXZPxpL/nMHFRyEdIdTWVy07dpNgagXYCVQuOQ46AvXIjeNSaeoA0YscTGm28P9YuD 0/yl4o+9LIo+gWmBcSDMdPg2YyHGyMQXyrDnBmlmuFBH0f9BHGNtUOcJL9AKwtfO+1gn K7ti4zcG4OxWjnEektQ1p6uXziekFW5mol5yVg4CqUsdyq4oabhV9McvRSF1p69LlLfw 1W7qQCacsdNqcBe5RK0n1EfFRFchh7FDdhr9kBhebdH0tujh0by6hSch8/L+jeUYXIT7 AGIA== 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:date:subject:cc:to:from :dkim-signature; bh=PBNDYvC6Ev7OAYWK0OL9zj6qOnU1gEAJkfPXlmTSuiw=; b=J5sAK1RCkqDFKkiRWc8NMGRfNxoug1a7Tsk6fr+LwbwOGO26dK27JeDrVC6XbSXTaP okWFpXO8I8llUieARTRLlZ8W53vu+5NubGFfWemwnue4P4ocIXopm5HDkXNhayXNeGSU ghPmYM4e5WMgbxQsStWe3WMSSbHSqPaYIG1JAbJxXKsQjli+ZjEYlC7Bj81/P8ooUG0X 6dIKlJYmLASru0Shuo6dOUtms+P+QwloPRwwYyHPCf+0VoOMlD6xsoR/Ub4W4a5S0+76 aEOvChD/JIbDUhLPgtPW+VDT6y7BL87xFjgbaecPGV6+UgIIJJdYQlR30ML3cnJ0CF3K fr8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FPdMitor; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v15si6874244oth.307.2020.03.22.10.24.22; Sun, 22 Mar 2020 10:24:34 -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=@gmail.com header.s=20161025 header.b=FPdMitor; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726958AbgCVRXs (ORCPT + 99 others); Sun, 22 Mar 2020 13:23:48 -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-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); } -- 2.20.1