From patchwork Sat Aug 6 07:05:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 85259 X-Patchwork-Delegate: sakari.ailus@iki.fi Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1oKDzZ-005uJc-Mq; Sat, 06 Aug 2022 07:13:03 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237969AbiHFHM6 (ORCPT + 1 other); Sat, 6 Aug 2022 03:12:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbiHFHM5 (ORCPT ); Sat, 6 Aug 2022 03:12:57 -0400 X-Greylist: delayed 451 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 06 Aug 2022 00:12:56 PDT Received: from smtp.smtpout.orange.fr (smtp-12.smtpout.orange.fr [80.12.242.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D1C8D17042 for ; Sat, 6 Aug 2022 00:12:56 -0700 (PDT) Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id KDsAokBsU9RnzKDsAo3rnw; Sat, 06 Aug 2022 09:05:23 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 06 Aug 2022 09:05:23 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: Daniel Scally , Mauro Carvalho Chehab , Sakari Ailus , Jean-Michel Hautbois Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH] media: ov5693: Simplify some error message Date: Sat, 6 Aug 2022 09:05:21 +0200 Message-Id: <2937ae40c2043cff0eee238877da9656475b18df.1659769500.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,FREEMAIL_FORGED_FROMDOMAIN=0.001,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no dev_err_probe() already prints the error code in a human readable way, so there is no need to duplicate it as a numerical value at the end of the message. Fixes: 89aef879cb53 ("media: i2c: Add support for ov5693 sensor") Signed-off-by: Christophe JAILLET --- Sometimes, some people complain that dev_err_probe() calls should be limited to probe functions and functions called from probe. So maybe this should be converted to a plain dev_err(). Personally I don't fully agree. dev_err_probe() also has the advantage of not being a macro and avoids some inlining. So it can help to prevent the filling of the instruction cache of the processor with things unlikely to be needed. --- drivers/media/i2c/ov5693.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 82a9b2de7735..8cf9516b6d57 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -403,8 +403,8 @@ static int ov5693_read_reg(struct ov5693_device *ov5693, u32 addr, u32 *value) ret = i2c_transfer(client->adapter, msg, 2); if (ret < 0) return dev_err_probe(&client->dev, ret, - "Failed to read register 0x%04x: %d\n", - addr & OV5693_REG_ADDR_MASK, ret); + "Failed to read register 0x%04x\n", + addr & OV5693_REG_ADDR_MASK); *value = 0; for (i = 0; i < len; ++i) {