Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp210106pxf; Thu, 8 Apr 2021 00:55:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/flIb8h8m6eLaDtPxwVZrC8cVpS/WeO5ogzx//A61kSJzzKnbHbmggMrdJc5Ixh0cBxCo X-Received: by 2002:a63:b59:: with SMTP id a25mr6883465pgl.235.1617868530241; Thu, 08 Apr 2021 00:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617868530; cv=none; d=google.com; s=arc-20160816; b=B/L/2/j2LxbykgzfV5M4l38ua4ZYKK6Ytl3Lnb3zMUXGH4YBTySdy1Y6dJkRT1ygnh yi9pYiWTiiAUm8YIjqaBDBtUh2Yx0iT1uL7hogBS4+nEhn5hXoh0btfo3PLBJYCFBtWU Zd3z+R8hRSHBZ6PsijR8XdXvQqSByH+xp0EqioFP7SyK4WHvS7fuFmb5zDyoiFI62tNV 9md54v2yVqpdFTWfzSkYjR1rbG6t+p6m4ZbeKDrYBTSudjyUtE63FqXIE9fd7nI4Jcvz MRTtvwLKi6HvWyYnQSxaEXNVylP+MAbRg8RUZVmOb1KqacROWKPoUG6bucR2l42Uwr6g GV6Q== 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; bh=KNguKa18yICEOzBL+wxTcmzM+IrqVff6MMkii7/tz3Q=; b=ipk1mRCMxRBj02hio7vsloInIDAWAjKNxmk+970mtAjdc8sqzdwB3l25SniOgdR9mp QLYnCbJlp0DesVDyl6QrxT6bWxfHF4P0ECBqmclKhuYtIm+HIvr5z1sq/Ee9ZO46521U kvFRnesmUt8QoXJCZnAKYNrmr5kiD0szWGWQ5OgZUangLzKq0hinHE1zDCSsH6sgWrPV h1xIQd5P2ubtjOk/CS6qzmFvHGv57SrkzjhljNMjQ+j2ASvo4cqPlwhPDOvFhDKSre6O 3IJGugBLDS5BM23F82VgPRyKttCDF7hTNllNDwleGcaZrUszrsjleF+Mh6RA5DbIzmm2 p4tw== 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 x185si18697897pgx.575.2021.04.08.00.55.18; Thu, 08 Apr 2021 00:55:30 -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 S230402AbhDHHyd (ORCPT + 99 others); Thu, 8 Apr 2021 03:54:33 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:56347 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbhDHHyc (ORCPT ); Thu, 8 Apr 2021 03:54:32 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.localdomain (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 923ADC0004; Thu, 8 Apr 2021 07:54:18 +0000 (UTC) Date: Thu, 8 Apr 2021 09:54:55 +0200 From: Jacopo Mondi To: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Niklas =?utf-8?Q?S=C3=B6derlund?= , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH 2/3] media: rdacm21: describe better a truncation Message-ID: <20210408075455.42ym6cd2sdpfziqk@uno.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mauro On Thu, Apr 08, 2021 at 09:40:03AM +0200, Mauro Carvalho Chehab wrote: > 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 Please see https://patchwork.linuxtv.org/project/linux-media/patch/20210319164148.199192-11-jacopo+renesas@jmondi.org/ Whatever gets in first it's fine, so you can add my Acked-by: Jacopo Mondi to this one too Thanks j > --- > 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 >