Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3284831pxf; Mon, 15 Mar 2021 06:16:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMgPic5Aodu2VH1fU6ffssn00s58/jDjlHqZTBTaJOP3yXRgPieQTNipYV2ICOUH0Q4iNu X-Received: by 2002:a50:ee18:: with SMTP id g24mr30044886eds.267.1615814206568; Mon, 15 Mar 2021 06:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615814206; cv=none; d=google.com; s=arc-20160816; b=U0uzzRWP2SJkC0KlskxzNQHcQ6swuA7Lhx0EbFeKU9HbDO2DfbT2Y5wnduO3lm2Vx6 b6hIzIWQTLE/1Y5X5Ps3W2rTKMGqUBBrLgmUTNYI8B8EIPI62RbdHdnhGEVUoQbTO8IC SKXRv9aFDApYJwaJ0HYQzgeWopOkxLEqpzK2cIocrnaF1d1Ol4E42sbh+NeBLtuQtcyD tnKXSP7A4TMuMb5Z+87wDe2io94m/AafnesvbV/0RpeTJVTIrtyCixqLoHUVB7yqh+7V IiJOSyNP7BV5aGlDU3343wcYm+ReSbkkNEPqcbTfiDV0bEtMwmrq1pkm5HzBvQOLZJVH 2BdA== 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=IAYZu6pYNTgoovgG+PWSC33UZkXPmtUjYnkD4gsCc+M=; b=BVPLukGutK8PKNhXnbMjTqm1y6tUzzVV1WKzG0Wd4kezkdWm06Y5JEaJD5cTpKbZao Ue9B+pi9AactdHys1KFPnzb+xm+I6H+FfUAhWaNznjEKED6JKqtsLyOZqjMv7ddCfpEn M411x4/Qx1wIz8iYJVghRvOcyyN9JADuuiHp2l9L2O9nxpv0QrLHxCpNC3j9vm0ELJJp Z3NEhGeq1Jd2AD1vUlwlftTm8OznSAZjawvYtgfrj8kUFbUedNyh0Qyq+GwCREfvf/h3 8TXEEd4ykuQdBvqv2qpmhi4niFmThVc/FhxdbisNdWhktBIOwN/aNfv3xy606g68/9F+ jvnA== 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 gb27si10707393ejc.448.2021.03.15.06.16.21; Mon, 15 Mar 2021 06:16:46 -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 S230186AbhCONP0 (ORCPT + 99 others); Mon, 15 Mar 2021 09:15:26 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:43151 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhCONO4 (ORCPT ); Mon, 15 Mar 2021 09:14:56 -0400 X-Originating-IP: 79.22.58.175 Received: from uno.homenet.telecomitalia.it (host-79-22-58-175.retail.telecomitalia.it [79.22.58.175]) (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 5804FFF810; Mon, 15 Mar 2021 13:14:51 +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 Subject: [PATCH v2 01/18] media: i2c: rdamc21: Fix warning on u8 cast Date: Mon, 15 Mar 2021 14:14:55 +0100 Message-Id: <20210315131512.133720-2-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210315131512.133720-1-jacopo+renesas@jmondi.org> References: <20210315131512.133720-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. Reported-by: Hans Verkuil 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 dcc21515e5a4..179d107f494c 100644 --- a/drivers/media/i2c/rdacm21.c +++ b/drivers/media/i2c/rdacm21.c @@ -345,7 +345,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