Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3650397pxf; Mon, 15 Mar 2021 15:01:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2leOrJ6H3O+jdqefSlYGdYjnB/FZXwHOtFf5+7CqQFL/p4w7BL+yd5h5bvNMesgny0iIk X-Received: by 2002:a17:906:3882:: with SMTP id q2mr25677359ejd.540.1615845705986; Mon, 15 Mar 2021 15:01:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615845705; cv=none; d=google.com; s=arc-20160816; b=MmVzw+Qg5XUIg9RoXZWq/qpyS3k+MSQetl41Crt7vluFrpinZXHsAT31vIsMS20D5d UrwnpantPx3NVjivbI/MNjI+lMU43IsghCH5F9jUMhBMSRfFNSHuUpU5s6T9dzeGQ4XJ rI5MUA54b/21Wxz0it3uMtJMhM1QmNviQUSyB4PAk5RmOyWJrVDe5QQdShC9dtV6vmB/ bz1VnTuZy/S9O3vBYlrbSWhURc3JGbR9mE/yRP2OE01kSQJ4pMw3e+N0GpmIXXtLQ3a4 B2f1Wao0tAY1piE8uPgo7bxQpjnduHSh6Ff5q0wTgwt3nwBY2YWVpfEUTnu8kZOTrAzy wi1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OgOrBAlFNjlIba5fN5FivLMRnWuE7qRo8HbGMn8cKD8=; b=snrVT1jRfF2CjscPW/CJ2nCdr3R/No8Y8T7f2qBnje6NIEA9C3kmlTXUfd/Zrw7ITt GA6P5mX9i4UwHE2bVF2SgSj/4xKSmthyPEi8zIUb6lGoS59RQ8hUmkd31jmoN0C/BB2w IYVB8y2pslXbyLrz7IRxSjCu0YXP88ETkzfJd9j/jRGN7bQopj+B7i9Xp8gmzNxRkiEr ngbIRvveuTyTRx8MOikQQcRqshW8Mm8WoGybL0kWFM6VkY89/XvBgIyGMg6eVOLcAkA2 gajWGSuRZUBqdWSfK7xpcr3s1EujCXFmKHcyWycUZJ56WQDjaI6rqAGevfPia779sah+ qAbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=TT5z+dzq; 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 y18si11193563ejj.628.2021.03.15.15.01.20; Mon, 15 Mar 2021 15:01:45 -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=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=TT5z+dzq; 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 S233043AbhCOVgd (ORCPT + 99 others); Mon, 15 Mar 2021 17:36:33 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:41514 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbhCOVgF (ORCPT ); Mon, 15 Mar 2021 17:36:05 -0400 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C7458316; Mon, 15 Mar 2021 22:36:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615844164; bh=OKXwsoWOva8CxqYRDjKdME5vOD+J25qkJxxU4SMQlRw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TT5z+dzqbN+kSqrKB4gPE0Q36f1t7Otr+QqkcU3YWh1gUCJS3UqC50BCLAduEqMnf cRiiOY/G+dWXKGGiJiFLexDZTGjPlQmJAaVrH4vwTC3OGSv/ogWqIhg4k/pUSlQbP2 yMqU2+svWPz8ToXvmHnQThMKOm2Jru96O5JKsWPo= Date: Mon, 15 Mar 2021 23:35:28 +0200 From: Laurent Pinchart To: Jacopo Mondi Cc: kieran.bingham+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil Subject: Re: [PATCH v2 01/18] media: i2c: rdamc21: Fix warning on u8 cast Message-ID: References: <20210315131512.133720-1-jacopo+renesas@jmondi.org> <20210315131512.133720-2-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210315131512.133720-2-jacopo+renesas@jmondi.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacopo, Thank you for the patch. On Mon, Mar 15, 2021 at 02:14:55PM +0100, Jacopo Mondi wrote: > 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 Reviewed-by: Laurent Pinchart > --- > 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); -- Regards, Laurent Pinchart