From patchwork Thu Jun 3 18:06:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12297791 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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 16655C4709B for ; Thu, 3 Jun 2021 18:05:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02977613F5 for ; Thu, 3 Jun 2021 18:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230049AbhFCSHX (ORCPT ); Thu, 3 Jun 2021 14:07:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:46280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230443AbhFCSGz (ORCPT ); Thu, 3 Jun 2021 14:06:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1BF15611ED; Thu, 3 Jun 2021 18:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622743482; bh=GiWzfqYEzX2F0/jFV2TExFGPGu9sc/IZ3x02HUPS5/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EPza7oWfxszpZxXWBBAWxDmI3Sq5Uv1q/kNMAnEnDqwsysCTzKv2djKe8glZNFjzI 97AuxH1mM2fpE+3a1JUfFDeQHq5kDo9nS3aMCg5+Qs2OABDuWGpCQ+uzzHQof2sW2b IARIjUF4sOe0UGQha5HXlpiZO2EYJq7DH/8w2shMLPSAFk7mRNpLxzQuznOOhu18xg IKK4Unfaz6+U2X4evg3vo9hZn4cpghPsVBbwmr3iL/IVW1TkN2lizAAtPnosuaOW/z wFbCrQGuADFERTp6ZFUOZUaCuTxXRgU3UPJwVjttzAEgz1FBnK+xhocu7KDilSqbqS 5RTGx5t5iPhQw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Arnd Bergmann , Andy Shevchenko , Joe Perches , Arnd Bergmann , Nathan Chancellor , Jonathan Cameron Subject: [PATCH v2 1/4] iio: si1133: fix format string warnings Date: Thu, 3 Jun 2021 19:06:09 +0100 Message-Id: <20210603180612.3635250-2-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210603180612.3635250-1-jic23@kernel.org> References: <20210603180612.3635250-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Arnd Bergmann clang complains about multiple instances of printing an integer using the %hhx format string: drivers/iio/light/si1133.c:982:4: error: format specifies type 'unsigned char' but the argument has type 'unsigned int' [-Werror,-Wformat] part_id, rev_id, mfr_id); ^~~~~~~ Print them as a normal integer instead, leaving the "#02" length modifier. Use the 0x02x form as the length specifier when used with # includes the 0x prefix and is very unlikely to be what was intended by the author. Fixes: e01e7eaf37d8 ("iio: light: introduce si1133") Signed-off-by: Arnd Bergmann Cc: Nathan Chancellor Signed-off-by: Jonathan Cameron Reviewed-by: Nathan Chancellor --- drivers/iio/light/si1133.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c index c280b4195003..0accea7090ee 100644 --- a/drivers/iio/light/si1133.c +++ b/drivers/iio/light/si1133.c @@ -978,11 +978,11 @@ static int si1133_validate_ids(struct iio_dev *iio_dev) return err; dev_info(&iio_dev->dev, - "Device ID part %#02hhx rev %#02hhx mfr %#02hhx\n", + "Device ID part 0x%02x rev 0x%02x mfr 0x%02x\n", part_id, rev_id, mfr_id); if (part_id != SI1133_PART_ID) { dev_err(&iio_dev->dev, - "Part ID mismatch got %#02hhx, expected %#02x\n", + "Part ID mismatch got 0x%02x, expected 0x%02x\n", part_id, SI1133_PART_ID); return -ENODEV; } From patchwork Thu Jun 3 18:06:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12297785 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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 D70E4C47082 for ; Thu, 3 Jun 2021 18:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCBE2613E3 for ; Thu, 3 Jun 2021 18:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbhFCSHW (ORCPT ); Thu, 3 Jun 2021 14:07:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:46294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230412AbhFCSGz (ORCPT ); Thu, 3 Jun 2021 14:06:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 91CCE61168; Thu, 3 Jun 2021 18:04:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622743486; bh=hsvluWMjRK9V+JojbfAuZixzXGd2ri/U860X/FrZ+a0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IE7FqO7Fu72Bd9vN8PmJ1EKFBI/ypeC0tZLSFIIUKxRu4oXBFA48ZUVmFHxxPmVFR waO2yTJywSd8nGJfCdYHe04Qt8W446isgq40Oh7zdC3NDopfw7wMiA4Fn1rYyEdPDm 6QZi7Z4Jy/fxwtr1RIOq/7C+hoQmkMIEn6pufj+wySHHDui9ufnQMprKsUN8Lc0i+L 7j0rYBwurb+atjA37LFpwizhtVScYuedmwgbjpV87n1szI21f1a8F+MAKftU8MYqUU lMIdvMYh3Hr1jtoiPvbFsWeyvXWAXZiMk0feBOgVbyfDya/CPLCmT/nvGQ+7qtTErY ZC7HMfdx4NQ2w== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Arnd Bergmann , Andy Shevchenko , Joe Perches , Jonathan Cameron , =?utf-8?q?Maxime_Roussin-B?= =?utf-8?q?=C3=A9langer?= , Nathan Chancellor Subject: [PATCH v2 2/4] iio: light: si1133: Drop remaining uses of %hhx format string. Date: Thu, 3 Jun 2021 19:06:10 +0100 Message-Id: <20210603180612.3635250-3-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210603180612.3635250-1-jic23@kernel.org> References: <20210603180612.3635250-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Since: commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") use of these format strings has been discouraged. Use the 0x02x form as the length specifier when used with # includes the 0x prefix and is very unlikely to be what was intended by the author. As there are not that many in IIO, this is part of an effort to clear them out so we don't have any instances that might get copied into new drivers. Signed-off-by: Jonathan Cameron Cc: Maxime Roussin-BĂ©langer Cc: Nathan Chancellor Reviewed-by: Nathan Chancellor --- drivers/iio/light/si1133.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c index 0accea7090ee..f8c9b2cc322e 100644 --- a/drivers/iio/light/si1133.c +++ b/drivers/iio/light/si1133.c @@ -352,22 +352,22 @@ static int si1133_parse_response_err(struct device *dev, u32 resp, u8 cmd) switch (resp) { case SI1133_ERR_OUTPUT_BUFFER_OVERFLOW: - dev_warn(dev, "Output buffer overflow: %#02hhx\n", cmd); + dev_warn(dev, "Output buffer overflow: 0x%02x\n", cmd); return -EOVERFLOW; case SI1133_ERR_SATURATION_ADC_OR_OVERFLOW_ACCUMULATION: - dev_warn(dev, "Saturation of the ADC or overflow of accumulation: %#02hhx\n", + dev_warn(dev, "Saturation of the ADC or overflow of accumulation: 0x%02x\n", cmd); return -EOVERFLOW; case SI1133_ERR_INVALID_LOCATION_CMD: dev_warn(dev, - "Parameter access to an invalid location: %#02hhx\n", + "Parameter access to an invalid location: 0x%02x\n", cmd); return -EINVAL; case SI1133_ERR_INVALID_CMD: - dev_warn(dev, "Invalid command %#02hhx\n", cmd); + dev_warn(dev, "Invalid command 0x%02x\n", cmd); return -EINVAL; default: - dev_warn(dev, "Unknown error %#02hhx\n", cmd); + dev_warn(dev, "Unknown error 0x%02x\n", cmd); return -EINVAL; } } @@ -400,7 +400,7 @@ static int si1133_command(struct si1133_data *data, u8 cmd) err = regmap_write(data->regmap, SI1133_REG_COMMAND, cmd); if (err) { - dev_warn(dev, "Failed to write command %#02hhx, ret=%d\n", cmd, + dev_warn(dev, "Failed to write command 0x%02x, ret=%d\n", cmd, err); goto out; } @@ -425,7 +425,7 @@ static int si1133_command(struct si1133_data *data, u8 cmd) SI1133_CMD_TIMEOUT_MS * 1000); if (err) { dev_warn(dev, - "Failed to read command %#02hhx, ret=%d\n", + "Failed to read command 0x%02x, ret=%d\n", cmd, err); goto out; } From patchwork Thu Jun 3 18:06:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12297787 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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 982F6C47097 for ; Thu, 3 Jun 2021 18:05:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F2EA613F3 for ; Thu, 3 Jun 2021 18:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbhFCSHX (ORCPT ); Thu, 3 Jun 2021 14:07:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:46306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbhFCSGz (ORCPT ); Thu, 3 Jun 2021 14:06:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 12D29613F3; Thu, 3 Jun 2021 18:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622743489; bh=5gkUpB1HmKpVb9n8exFBH8wL/MEoltrA/LPiGOV6pDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mtW81ksRtyTGC0+AgYyWLMxHH+G4cOItOLCNzmIm88gJ2bSB3OqpOa4lZAUP5hI91 15nry/7Jwh1OtTVWrmZ2yuGCl6fsnWw4DU0cZnz3mjFTlXJnixRlkvPmxtyk7RG7JW zCfSiy5AdjTOAEEk+AG0P9gFP4zb8n8fWdNjwhMa2b9xDIRdlUHj2ypl6DXjgdL9vb s/4aOrlhSldnLHqDoo0vJFb/TxYUv3qt4A7tnD2Dy5upUg4fPOCdSY5q8YsSM+OBXg 5vK2aOgKDjATgS6ClwdLSQ5P/7MEVXIwBv+4KyKEF1QC7lNovNexkWEeWaW8n4uDBg 81t65S1AFsBeQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Arnd Bergmann , Andy Shevchenko , Joe Perches , Jonathan Cameron , Nathan Chancellor Subject: [PATCH v2 3/4] iio: imu: inv_mpu6050: Drop use of %hhx format string. Date: Thu, 3 Jun 2021 19:06:11 +0100 Message-Id: <20210603180612.3635250-4-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210603180612.3635250-1-jic23@kernel.org> References: <20210603180612.3635250-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Since: commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") use of these format strings has been discouraged. Use the 0x02x form as the length specifier when used with # includes the 0x prefix and is very unlikely to be what was intended by the author. Part of a series removing all uses from IIO in the interestings of avoiding providing bad examples for people to copy. Signed-off-by: Jonathan Cameron Cc: Nathan Chancellor Reviewed-by: Nathan Chancellor --- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 64704b55f6eb..b7254d9e0fe2 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -1314,8 +1314,7 @@ static int inv_check_and_setup_chip(struct inv_mpu6050_state *st) for (i = 0; i < INV_NUM_PARTS; ++i) { if (regval == hw_info[i].whoami) { dev_warn(regmap_get_device(st->map), - "whoami mismatch got %#02x (%s)" - "expected %#02hhx (%s)\n", + "whoami mismatch got 0x%02x (%s) expected 0x%02x (%s)\n", regval, hw_info[i].name, st->hw->whoami, st->hw->name); break; @@ -1323,7 +1322,7 @@ static int inv_check_and_setup_chip(struct inv_mpu6050_state *st) } if (i >= INV_NUM_PARTS) { dev_err(regmap_get_device(st->map), - "invalid whoami %#02x expected %#02hhx (%s)\n", + "invalid whoami 0x%02x expected 0x%02x (%s)\n", regval, st->hw->whoami, st->hw->name); return -ENODEV; } From patchwork Thu Jun 3 18:06:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12297793 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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 A049EC47096 for ; Thu, 3 Jun 2021 18:05:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88EBC61168 for ; Thu, 3 Jun 2021 18:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbhFCSH2 (ORCPT ); Thu, 3 Jun 2021 14:07:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:46418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231277AbhFCSHW (ORCPT ); Thu, 3 Jun 2021 14:07:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2461C613F8; Thu, 3 Jun 2021 18:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622743492; bh=sCgkhFJT5hJ+XQpNk+ukwvirPMhO36VsOe5Orh2RRPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9vP4ybV5PasGdmjiX+0gqENpg3r8bpDB9ggYrmJoKpnTp97eRWQI8XUJC64jxOwq DpbHofkuFoxpWLc/0qNzP07Rlr4Z5jQh4xIJQCewdO8wUbpKb6QbrvgSvZPT8ytzvF hd5X3Yz6C3R8eBPN8SBtzx6mA1O2OV8g66/9lHAt1Pu5jFgDJcLoXidEcFRgwBMHIQ +U6DMYS2K+ul0t/B9ukyEpwToI4fcHB2MtEVANAtydheSo06uWH8IYq+Zbnr1FabjI +52W3yQLknwUIprYt2PlC0lsiZlxOIYrJrxhK14bx/cHfGbj2Rz8Lv8K2uJdbWhcz5 j7tEak1jw/84w== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Arnd Bergmann , Andy Shevchenko , Joe Perches , Jonathan Cameron , Nathan Chancellor Subject: [PATCH v2 4/4] iio: light: si1145: Drop use of %hhx format specifier. Date: Thu, 3 Jun 2021 19:06:12 +0100 Message-Id: <20210603180612.3635250-5-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210603180612.3635250-1-jic23@kernel.org> References: <20210603180612.3635250-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Since: commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") use of these format strings has been discouraged. As there are only a few such instances in IIO, this is part of a series clearing them out so they don't get copied into new drivers. Use the 0x02x form as the length specifier when used with # includes the 0x prefix and is very unlikely to be what was intended by the author. Signed-off-by: Jonathan Cameron Cc: Nathan Chancellor Reviewed-by: Nathan Chancellor --- drivers/iio/light/si1145.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/light/si1145.c b/drivers/iio/light/si1145.c index 3fb52402fcc3..e2abad48b9f4 100644 --- a/drivers/iio/light/si1145.c +++ b/drivers/iio/light/si1145.c @@ -271,7 +271,7 @@ static int si1145_command(struct si1145_data *data, u8 cmd) if ((ret & ~SI1145_RSP_COUNTER_MASK) == 0) { if (ret == data->rsp_seq) { if (time_after(jiffies, stop_jiffies)) { - dev_warn(dev, "timeout on command %#02hhx\n", + dev_warn(dev, "timeout on command 0x%02x\n", cmd); ret = -ETIMEDOUT; break; @@ -291,12 +291,12 @@ static int si1145_command(struct si1145_data *data, u8 cmd) ret = -EIO; } else { if (ret == SI1145_RSP_INVALID_SETTING) { - dev_warn(dev, "INVALID_SETTING error on command %#02hhx\n", + dev_warn(dev, "INVALID_SETTING error on command 0x%02x\n", cmd); ret = -EINVAL; } else { /* All overflows are treated identically */ - dev_dbg(dev, "overflow, ret=%d, cmd=%#02hhx\n", + dev_dbg(dev, "overflow, ret=%d, cmd=0x%02x\n", ret, cmd); ret = -EOVERFLOW; } @@ -1299,10 +1299,10 @@ static int si1145_probe(struct i2c_client *client, SI1145_REG_SEQ_ID); if (ret < 0) return ret; - dev_info(&client->dev, "device ID part %#02hhx rev %#02hhx seq %#02hhx\n", + dev_info(&client->dev, "device ID part 0x%02x rev 0x%02x seq 0x%02x\n", part_id, rev_id, seq_id); if (part_id != data->part_info->part) { - dev_err(&client->dev, "part ID mismatch got %#02hhx, expected %#02x\n", + dev_err(&client->dev, "part ID mismatch got 0x%02x, expected 0x%02x\n", part_id, data->part_info->part); return -ENODEV; }