Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2159888ybb; Sat, 21 Mar 2020 14:25:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vusKx16X9wEB89OSYWN1QCTDO7MsapM3E4mHLuajR4CnWRyITMDl4r7hpgFP5KThHK6EwCm X-Received: by 2002:aca:ef82:: with SMTP id n124mr11405509oih.73.1584825951053; Sat, 21 Mar 2020 14:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584825951; cv=none; d=google.com; s=arc-20160816; b=SZmXibtr+qrnQMR0LPOD87fc6IroMusoO5iNLAhnujxdPLDJwGGTFLYSz4GJ5X0xFm PkG+Nuy46o6BBec13VBZmXugEqU2GcFBK4BjNW40S8borNn2m2VBmhKT0rCNPCKSmSiv VmfQufZgNkGoh2iAtIcphnDYO86fIuSv+om3Ep496/x8JJln9nNHbJyDwdfMINIQuR5i mnp9uxf+KzknrkG7WSNSBjWqzS2KoJMHS8cmPosl/Sjmdy8QaeaLkf2LBRqRcpOy3QTI 91nY5D+IPgF97iEgrQIJY20AbCWV1ZvOEi53vfTPPMXF9MS9HG2eIem14QQhPmhaDrLN hshg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=vJAB8piyycoPneEfsaa7KCnqSfhPKUeLOEoPQN14swc=; b=vARkrpfZQnJU+luz2cGMFJ85V7mqeMUD3BD6XthDH/zN17JsE/lgc8zlDqZqTd6FQ0 bIogbyL+RAbxfpeEmyDYbGv1TX1ssAM9xwyxVbVvEFe8OX7QcH9n0Ss0DU5zfjG6sEqq kE2bp/uUWV6uIQE5YKVlbd77H6rj24Xa4rW7aNuBngja8GbQ0DLqWeiqeP44QO17B3xP 0bF3mqY+68/QwCWFOIcTIkJpBsHrz/qoe5ofCIznhnLBN6oX/kgHrMcT5JchdGhjdnNY dTz/eqIJTGs6W7V0ksf2CTfz+PgTNXe0eJCvxVBFg3d8YVmIvEjFqoN6DLJ6QCv6WdtY LGzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eOjzr0vW; 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 z62si5045170oiz.23.2020.03.21.14.25.38; Sat, 21 Mar 2020 14:25:51 -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=eOjzr0vW; 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 S1727296AbgCUVX4 (ORCPT + 99 others); Sat, 21 Mar 2020 17:23:56 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:34285 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbgCUVX4 (ORCPT ); Sat, 21 Mar 2020 17:23:56 -0400 Received: by mail-pj1-f65.google.com with SMTP id q16so4518266pje.1; Sat, 21 Mar 2020 14:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vJAB8piyycoPneEfsaa7KCnqSfhPKUeLOEoPQN14swc=; b=eOjzr0vWeVYbLJxeZeCZ7zZj6ahsW/SWsg8TFUBPvb22esVK/pDcmYAC8+SPflvN6J vsiyZzIQuTj98IEAU9wx83dyPQKJqoJrnsqdaqRGEdA40RNDjqXVmCkO5qTMmENjB2bf W9MVxV5K8CcMwDkNdTVwodeGvNZzyM7Kyz4qQOvynAnsDSFIpZnaNe1m4SxTt5JdStmS /sTLOpJ+ClBf2hsDilm9CuqnUW0h4ry24BBv5MJtrhAwimXXeVq4yDm2Y2/ANibqx22z j2Us4XohOj+HyjCQSpjGrifCEVc8P3BtkYTMc1nW7BAN09yjwn5RgcyLDZvVhtF7J4Qc q7Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vJAB8piyycoPneEfsaa7KCnqSfhPKUeLOEoPQN14swc=; b=p7OrGfr9+KxwB/lv/In6JJI8xiTmYeiNEF75rIogVH1srRexwdG88YByFM0usGmJf2 8t5eQqKnGuYdlRfQmDPPxBnuNRKkHUq8o53SJa92E82ger7YchSFksXGte6mncBsNr57 t+zzIUUncQplovBAXlvc6ge6Ark3yZyyGTmFZgKcFc04lL2OdjbG8AR15p6cImF2oeGy hFjGzMvhIFv2HnlanKig8rLyRu1cZau4QjqnFWK5DlwZe/Fm7q4V1BScg7HG4qbWo66o EIlaU9mZvIX58qiSAyyW7yrIkojC9rD6MjeY3bo2MEUgE9wL8/IX6kYJkEVl6lWDpONE 1a6w== X-Gm-Message-State: ANhLgQ0rXXIfNgG5Ol3QIvFr9OzyUTUVpCM2LYzD5Qfmn029qQ+FX1cU 52nvVCxl65TVyjyB+nVuGZfMzKgFb48= X-Received: by 2002:a17:90a:7184:: with SMTP id i4mr5517749pjk.40.1584825834969; Sat, 21 Mar 2020 14:23:54 -0700 (PDT) Received: from ?IPv6:2409:4072:488:8b8b:892d:8d8:1a6c:acda? ([2409:4072:488:8b8b:892d:8d8:1a6c:acda]) by smtp.gmail.com with ESMTPSA id a10sm2232031pfi.16.2020.03.21.14.23.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Mar 2020 14:23:54 -0700 (PDT) Subject: Re: [PATCH 01/13] iio: accel: kxsd9: Use suitable format specifier To: Joe Perches , jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200321210204.18106-1-nish.malpani25@gmail.com> <20200321210204.18106-2-nish.malpani25@gmail.com> From: Nishant Malpani Message-ID: Date: Sun, 22 Mar 2020 02:53:48 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/03/20 2:39 am, Joe Perches wrote: > On Sun, 2020-03-22 at 02:31 +0530, Nishant Malpani wrote: >> Provide more suitable format specifiers while printing error logs. >> Discards the use of unnecessary explicit casting and prints symbolic >> error name which might prove to be convenient during debugging. > > > 'Use suitable format specifier' is obscure and not specific. > > All the subjects should likely be something like > > [PATCH] subsystem: Use vsprintf extension %pe for symbolic error name > Agreed. I was just skeptical about that previously because the commit subject line's length was going way beyond 50 chars. I do get your point though; I'll send in a v2! > >> diff --git 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; > > And this could use a separator between regmap and errname like > > dev_err(&i2c->dev, "Failed to register i2c regmap: %pe\n", > or > dev_err(&i2c->dev, "Failed to register i2c regmap - %pe\n", > > Yes, I had thought of this but was too timid to ask, thinking it was perhaps there for legacy reasons :P I'll add a separator in v2. Thanks for reviewing! With regards, Nishant Malpani