Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp202953pxf; Thu, 8 Apr 2021 00:40:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFNCg4hlXnuD538cUVNdOfnneVyOqDc2cTpq6UwI4cZOlEKbCIQJ+rm0m8iuBeCbLvB0m7 X-Received: by 2002:a63:ba1c:: with SMTP id k28mr6870219pgf.328.1617867654611; Thu, 08 Apr 2021 00:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617867654; cv=none; d=google.com; s=arc-20160816; b=w4tH5SUr15BF6hlKtCBBX6xvVlrunpFPD9sAMUq8uH7c2u5YY58oBpQu7rW4lTiNug gjon3yu/hUJnPu/6Pqsh9oLuzD1W/hB2vGXs4WZ5eF5Fka93oaZHgsupAKvZJheMM+H5 a6XYywMDnC0Q1UjSVXQNINICbRkRQOkXtHA+vhxIvkv+KawkbADFzM2G3psmq726mut3 SboF+8fmRdj1g3Y+MJ8cR2AHaB5yzssZNFO4B4bsRR/ms/VQRCXzuq1OKDAyJIQjKXBG pQUupHfmwqNnxU19Kylm+9rXa7yxrIDw+sCz40x9znznqFpt9nUV84+cJFpPep62fIdx 5JEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=06hU2gxyYOBpnzrGOzHI/zCrFQqWbBVfSYs3H4KP4Ug=; b=MT6Ec+z37A99PTGgGfw/IWGuzJSELaat4S8OwKAwMDgDvZ4JP8egOgQ0Rt+DAiPwSX 1g6bu6N+2AZoCPuNGKwer4pM/TuqI6qFS+R9C58ryJU0Mu+odbVMHvsu3JNGv1DZX5FB +44U2Zcc60Tl1Hm7JLLouZM1prs5rmuooDVM51keNJWJaxIAgEIp00/tRjaaiqvf0iYP 2IH2L6ZdrE+6rnty8Y2I4JCyiFDlDMieLDkukMo43ZC6ERZlhmAPMK+3eJwtHzQDex9A p8VYbnvetpuLkQxi6smM4pmefmDMV9D1zu1b8uvvJ50sFkYLbjDjGsulK6DgE4QTQeYJ p8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=jY6qUnRl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si9464100pjf.0.2021.04.08.00.40.42; Thu, 08 Apr 2021 00:40:54 -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; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=jY6qUnRl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229877AbhDHHkV (ORCPT + 99 others); Thu, 8 Apr 2021 03:40:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:53596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbhDHHkT (ORCPT ); Thu, 8 Apr 2021 03:40:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 537676113A; Thu, 8 Apr 2021 07:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617867608; bh=wapQTnSFiV1ZtG9q0iplLDk1SJVcJTFJRTo/iVI10D8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jY6qUnRldNElEAzowUqgaGbn3nss6H995XeWKFHfCivqJw5fC+mo3agAPVF6BzVTU esWgX7Vlx/edCn0aXgEITCTtDQYhVRo/xV927aCJcWB7JqN3kOof8zU/3wajQR2FM1 9b9IchiOQV9AZJ4LTUxi1vKWKPLRKzv9ZW5mT/INyOrWxtGYfOdG9I/QObX7Oij3lL AVxDbg9jB0GO/dWsNtSh3VBnrp/yTB44CGhOR9k4Xipux2QLC4EGWBuhSDjMM78dQb l8cWsme+uXUxK/W48W3NZQh0ySry6PYTyxBXIimZPgSNLK4ufND+bWKs+iECzTgm8U daEIo7482tFgA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lUPGn-000jTz-VS; Thu, 08 Apr 2021 09:40:05 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 2/3] media: rdacm21: describe better a truncation Date: Thu, 8 Apr 2021 09:40:03 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As warned by sparse: drivers/media/i2c/rdacm21.c:348:62: warning: cast truncates bits from constant value (300a becomes a) the intention of the code is to get just the lowest 8 bits. So, instead of using a typecast, use a bit and logic. Signed-off-by: Mauro Carvalho Chehab --- 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.2