Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2044876ybb; Sat, 21 Mar 2020 11:27:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu6o+0JipjH19X5fYAg+DTX34CM9WBphJ0d+hPKhZgqQXlns11DRf2z17cyLhVDYyLDFdeg X-Received: by 2002:a05:6830:1c77:: with SMTP id s23mr12049515otg.191.1584815230444; Sat, 21 Mar 2020 11:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584815230; cv=none; d=google.com; s=arc-20160816; b=UOGMS/zFJIz0JpXo6PnfBxybOn2ME6rYXQpFig1khBVjqOEo9HToqzTXMmfNRtJwE2 5sztsh7ablUnXBYSlBV3u32Jvo54jvfd0ngXIT3X35dcxNWpaIdtSbjdCvxqTr/nR362 IbyvnmYCzWK6xa5uhjKhKlFyfpPttreyf4Ga8JrTruHEYb+rc1p9qHuamEDeDUNNCIMS UBbwDmM0Z9gWwSSBLc7np/Uyb+MmbQIo5W7CMVFrJMLne01suQfWiB1RopIocDDFw/mx 7AeFwyZl/T4Zj8m6V/x8tEJaRt3fKX65TMMi2N1IDVjvZn3TLNKWWHs2aPxkkPXNjW8m Q5Pg== 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=q7P3d4bottmxnpPOnOchr0kX1G9VuQbjItV2DWo+ReI=; b=OPdE/J8FDMAM3T3fPUFRNzUx/oKwy0ZmmtnylMG2LvlNorZUJ/VWtAySn7MP9CD866 RX6ujU5InsFjUDIPYcwypLjheRs37OdCn6fCFf/KROB1dha2n28QKHkxAf8ALtJjSyVR D6YgQnETXxqM4wcZar7c/ReZ/LgxmYPJcCR8Qsv7lkn8G9CIAUcNs7/OgXmsKTkJ01wO WUfHAj2ukaj0AWTwzdAawxC+FFvB1G+cAUKj+40/cRmgQ67mZoI/q5Gg3G1lsAXSWBxd jW/hkH3qFHo8O+lb/Dgn6I1U/AZIiSvqgTI61PqyxNPKA3Lmt6qio+eHlMj4Pc9qcqA4 JwxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ck6e0qmr; 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 c4si5174591otp.218.2020.03.21.11.26.57; Sat, 21 Mar 2020 11:27:10 -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=ck6e0qmr; 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 S1727446AbgCUS0l (ORCPT + 99 others); Sat, 21 Mar 2020 14:26:41 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43199 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727015AbgCUS0l (ORCPT ); Sat, 21 Mar 2020 14:26:41 -0400 Received: by mail-pl1-f193.google.com with SMTP id f8so3953320plt.10; Sat, 21 Mar 2020 11:26:40 -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=q7P3d4bottmxnpPOnOchr0kX1G9VuQbjItV2DWo+ReI=; b=ck6e0qmrGP019nLsTNhKoxpxi5Hju4mUcMJmewHC4zXcbf8gTgVg0QapUB5ayqEw83 dVG5fzCw/iCdfp9BbXvDnUbaIrPP0sUtirLggqjJ3bsPP3IFQJ0s1TnzXzhKes9IJlw3 K0jrkLnwT8G220oscM12N/Em1SGwqEf07cnNWJqf2OPclVlK8HUmq4d4i8j2HfB9g4OA cyRVvRs0GrC5NQL52cs4UNEKWErvhLY5WoGZqhVMYQUgOrmlYMAobBZl8uUq330z2ZH/ ZsZkokYanK69CuttpAySF6x17tBOJbIeHccEIDk83EZLV0FPMEpvnzbgsBjZPB8VCohp P8gg== 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=q7P3d4bottmxnpPOnOchr0kX1G9VuQbjItV2DWo+ReI=; b=MifzuwpFwpNtxWe/CHpPVu8tDG9P7n/qChJ2+IotmFw2rraUsbZUhjv1uUUioQ/Kkf xmYA0osnhlcbDNDc8dIBnrbGvgrExTm4tVzWPECEqJFTLP4cwjQw4BsKNVzxsNdYVmvb dCeTDbjkgQaHmYEmkS06FJr1FNHs2mIN2eXNaGU4/Hu+z69+Y7c+Bs7wPwDD3e7DZcdY aIoRlEzpI1BN5/8rtDBn8Q1gVZGHyMkrmunJBKS+6hXDGK5K9JCXYhmdsSkCKd0eIWJ8 oO2G9jstathu8+ZZG1JKo/jXF8bwyMfJKUEo1QdCIpXHZ1xAxV34EMMUQxrmDYodvJRo xnpQ== X-Gm-Message-State: ANhLgQ0dKV1roUHONCKmgpiOUahgckiouQXBS7wHWrUY8h3wKMQ6cheq IwVjNLJuGE3XIxSdkNZw8UaOWkSG X-Received: by 2002:a17:902:7593:: with SMTP id j19mr14744776pll.55.1584815200085; Sat, 21 Mar 2020 11:26:40 -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 w9sm9187583pfd.94.2020.03.21.11.26.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Mar 2020 11:26:39 -0700 (PDT) Subject: Re: [PATCH] drivers: iio: Drop unnecessary explicit casting To: Joe Perches , jic23@kernel.org Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200318100754.25667-1-nish.malpani25@gmail.com> From: Nishant Malpani Message-ID: <9aa90ffd-9574-d615-0bc0-f791e51b3be4@gmail.com> Date: Sat, 21 Mar 2020 23:56:33 +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 21/03/20 5:56 pm, Joe Perches wrote: > On Wed, 2020-03-18 at 15:37 +0530, Nishant Malpani wrote: >> Provide correct specifiers while printing error logs to discard the use >> of unnecessary explicit casting. > [] >> 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 %ld\n", >> + PTR_ERR(regmap)); > > Another option would be to use %pe to print the error identifier > and not the error number > By 'error identifier' you mean the symbolic error name (as described in docs [1]), right? Yes, to me, it makes sense too, as it would be more "readable" during debugging. Jonathan, if you agree, do I send a patchset replacing with %pe specifier for all the drivers in consideration? With regards, Nishant Malpani [1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html#error-pointers > etc... > >