Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1557993pxf; Fri, 19 Mar 2021 09:43:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDuIWP2fM2ZKD6eUYSFdXZsgDrw7fmW30xBGbw234ojb+HKhxsVesDZgMRgHlFgp1/ilTV X-Received: by 2002:a17:906:6d8e:: with SMTP id h14mr5423850ejt.410.1616172220829; Fri, 19 Mar 2021 09:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616172220; cv=none; d=google.com; s=arc-20160816; b=ZZPeAfedcIsU7rkV2/90m7KdTG53ebZ30iaNZ8254E2FDYXM8jwAcrFFEKSQ3MyPUy 6nq6VYzX78d6Fpo71UU0qBw7xwahMtM8ulRbdgX7YdvCihtH/TOJ00O5meL9KTFnMJ1g aeyl05hJ9ICAdTZ8c9S7Xd7hJRv3ZGMXkILsi0rQPd8dre0PyBLlYcqQAylvxp6ss+B8 iuobf2NZQpH73c7i6KDv+9gnI8JnKwc7CRpeugLYVR7aO1fRaRI7puHg22KmXLm5v4Hs SYSHbYmnS7eZJdZ4QQKdVSgWElUhQHmHbrugyK87SvMh1gHqOxj3WVi4MM24lP3X83k/ fTWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fLGDa3bjkp4KKEo0K5rwhimZ2AjegV6kwmoW4ItIVL8=; b=JNs84FIahopY/KSTU/HgNgmlbvT6mi/99JX74AySp4y1kMQqc1K3owUYHhbGq/LT4v eFankIjAr0LMTvfVW4DrbffdAcirhqyWgeRuApgp8Z1oEd/1VCj/pjKoZiLuG9Pn4aBu fH4jCNs6JgnegpjqTi2t4zcEEmui9awHm6aAGQZCzeK8zVbVVctd5ZaO3W5jHO4UvHKi kRIKh/zFdTQYtPWa4pWioV+IPxcSyvfG11EmLTU8t3rkOnH8k5329qUba3wHrRz5pa4M Mcev8jBf2pFODWS3fFIJ7Cl2DD/KSKavlvbzsqnrLxK/LJMbvaj2un3cvK9/LMADT5m3 GtaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h20si4593453ejc.687.2021.03.19.09.43.17; Fri, 19 Mar 2021 09:43:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbhCSQma (ORCPT + 99 others); Fri, 19 Mar 2021 12:42:30 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:59209 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhCSQmF (ORCPT ); Fri, 19 Mar 2021 12:42:05 -0400 X-Originating-IP: 5.92.35.220 Received: from uno.localdomain (mob-5-92-35-220.net.vodafone.it [5.92.35.220]) (Authenticated sender: jacopo@jmondi.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id D9C04C0007; Fri, 19 Mar 2021 16:42:00 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org Cc: Jacopo Mondi , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Laurent Pinchart Subject: [PATCH v3 10/19] media: i2c: rdamc21: Fix warning on u8 cast Date: Fri, 19 Mar 2021 17:41:39 +0100 Message-Id: <20210319164148.199192-11-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210319164148.199192-1-jacopo+renesas@jmondi.org> References: <20210319164148.199192-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse reports a warning on a cast to u8 of a 16 bits constant. drivers/media/i2c/rdacm21.c:348:62: warning: cast truncates bits from constant value (300a becomes a) Even if the behaviour is intended, silence the sparse warning replacing the cast with a bitwise & operation. Fixes: a59f853b3b4b ("media: i2c: Add driver for RDACM21 camera module") Reported-by: Hans Verkuil Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- drivers/media/i2c/rdacm21.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c index 1706a59bfd58..babd14b21252 100644 --- a/drivers/media/i2c/rdacm21.c +++ b/drivers/media/i2c/rdacm21.c @@ -330,7 +330,7 @@ static int ov10640_initialize(struct rdacm21_device *dev) /* Read OV10640 ID to test communications. */ ov490_write_reg(dev, OV490_SCCB_SLAVE0_DIR, OV490_SCCB_SLAVE_READ); ov490_write_reg(dev, OV490_SCCB_SLAVE0_ADDR_HIGH, OV10640_CHIP_ID >> 8); - ov490_write_reg(dev, OV490_SCCB_SLAVE0_ADDR_LOW, (u8)OV10640_CHIP_ID); + ov490_write_reg(dev, OV490_SCCB_SLAVE0_ADDR_LOW, OV10640_CHIP_ID & 0xff); /* Trigger SCCB slave transaction and give it some time to complete. */ ov490_write_reg(dev, OV490_HOST_CMD, OV490_HOST_CMD_TRIGGER); -- 2.30.0