From patchwork Sun Aug 7 23:02:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Hauser X-Patchwork-Id: 12938399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 128F2C19F2A for ; Sun, 7 Aug 2022 23:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232842AbiHGXDk (ORCPT ); Sun, 7 Aug 2022 19:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232816AbiHGXDj (ORCPT ); Sun, 7 Aug 2022 19:03:39 -0400 Received: from sonic303-21.consmr.mail.ir2.yahoo.com (sonic303-21.consmr.mail.ir2.yahoo.com [77.238.178.202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 642832AF3 for ; Sun, 7 Aug 2022 16:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1659913416; bh=RGArz7Zwo1YrpUAyYAm1grVSpdiCN8Oa/NeiK93F+nA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=DtAKcIiE8ZhVLHjOTGR/SraZcdQGMYxByzyFLwKn7TmoOAWm0E/z+swGaCfk/Oyp3z1TDKRdUanK9sTd1d5fodH8r+xzjTGA68sywsb4oR9/ftJH7RghOof0uxRaOX1HahH7SDfXyEDm5lJ3EtQ1hySbPmJ3G3iiI/9kD5HlaojW+W/PsxJv5n9VYwe8GRBGEnM9VBUM4/PUXTYbQbFSUH8u7bGtJjqID9ejglg6ypCaOIFHNa9bXBbbFfEA3PMn5AsqFVDWVGVBlAUaAalW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YSlIQap 7tU1i0GZ5B6q4Kt6AGoD8Lr1NkjbeltNpOuvb68sCJMPieM8wZHkm8u9EfXNFwhYA4WrMciyyN3E DsOJ2606KGfkpgs3Y2T3RTLwldbMdw21_.G20wbEuThpr4b7xTv8Cg4ogjYXUl2T6woUQUr0MYUE nMDx1XVTwJSoTv8Qj5UENgKcuD2AIfDT4ljrDKUiIpVFvE5UKr_5Qd5NZmlJx0BylY6uKjqeks2p ZB0uVIkDWShe.hURWpQIMKn2kUKA4xOtzVVWQTBKlLa_wnIwGGo9iZtPUpcpxprkqcHe33kWSvTA zV_r5.VvkoyQwtb23fkO5I1A4rUCxru_yMkd7Z1WZZfpQEVpj8bQzoVmM.kJoNjDNzDAphvP79jI 2YuGbatYDxU6fk0Urngq.jUXFo.iXdFcVw9fFoYfo2up6ehuqtGlTKVK5ZZWivOxwFEjgpiUefGz FdlZekW4.osuOATkfdmptFZ9WO3MgKXSZWthwd4ys1s81HzsNF_qoLqPAMLKAkJdhSt66qiG50Pc PR7M2AzTy8W_G_EMF2kGB9CPnW1Tbwqve.lHWgzpRqTrhJ.N4Zc74SgW22km8IFu5ZnsQWrW1DJX 1t4KAgeOA8JjXZ59tCwLQ_MApT1uMS8W9bVyL5DTokZ5kZG0q5kWGJgCO.bkIDTkMdjRGPstI7CT lkbBuzoDPzj7WyQTU8Wtg_v_OA6juXNSdR451RqYDmfuFRZWxMnfXr9CZ3na1kHvEOJoZT7in3lh SdSciYlEtjKpuaA-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Sun, 7 Aug 2022 23:03:36 +0000 Received: by hermes--canary-production-ir2-f74ffc99c-r76pr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 12b0bfa600682cb6edf92800aaf76d46; Sun, 07 Aug 2022 23:03:34 +0000 (UTC) From: Jakob Hauser To: Jonathan Cameron Cc: Lars-Peter Clausen , Linus Walleij , Andy Shevchenko , Hans de Goede , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Jakob Hauser Subject: [PATCH v5 01/14] iio: magnetometer: yas530: Change data type of hard_offsets to signed Date: Mon, 8 Aug 2022 01:02:06 +0200 Message-Id: <4293862b3deb526ee1163b6fc8d0786c3d9816fd.1659909060.git.jahau@rocketmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The "hard_offsets" are currently unsigned u8 but they should be signed as they can get negative. They are signed in function yas5xx_meaure_offsets() and in the Yamaha drivers [1][2]. [1] https://github.com/NovaFusion/android_kernel_samsung_golden/blob/cm-12.1/drivers/sensor/compass/yas.h#L156 [2] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/GT-I9195I/drivers/iio/magnetometer/yas_mag_drv-yas532.c#L91 Fixes: de8860b1ed47 ("iio: magnetometer: Add driver for Yamaha YAS530") Signed-off-by: Jakob Hauser Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko --- drivers/iio/magnetometer/yamaha-yas530.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c index b2bc637150bf..40192aa46b04 100644 --- a/drivers/iio/magnetometer/yamaha-yas530.c +++ b/drivers/iio/magnetometer/yamaha-yas530.c @@ -132,7 +132,7 @@ struct yas5xx { unsigned int version; char name[16]; struct yas5xx_calibration calibration; - u8 hard_offsets[3]; + s8 hard_offsets[3]; struct iio_mount_matrix orientation; struct regmap *map; struct regulator_bulk_data regs[2];