Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp953322lqo; Sat, 11 May 2024 00:48:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOyDTV6cIsH4za+6zZltPM5E+t26pW8azGCg8f0nxx5jdQMS9kLn1mId763+jXzRmJngREKvnf9mucv2vLf8ktFkCUZXlAx3sC0EFKIA== X-Google-Smtp-Source: AGHT+IEmBFOx9kqpWD9A0XbsE0N58aDcLGB2McMapVWGy4DyvzXBQsL+fGe69nMrZQnYbjGrn77e X-Received: by 2002:a05:6358:9987:b0:183:f7cb:af75 with SMTP id e5c5f4694b2df-193bd00710cmr523662855d.32.1715413695263; Sat, 11 May 2024 00:48:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715413695; cv=pass; d=google.com; s=arc-20160816; b=QAQ+E2yIeb+WrkXmnwk8CV5UzRR5LelIc+FNO2aQ1UfJyPOm3RmnA9btLYuTAn7ngq ajni7o29Fw6vGkjR/WDIoE+Mrobyk1OoZUCwG+EHpvpk8mJBajugy6plNs2Fhd2u8LmJ qmlKw9r6HyOeHYyc58bYHAcj8t8yO6usuVGYL4o1zWQIONk7yUwlKSm1vo6DHt/oKZtS kP0S3WmdKcZbwWY7Vyo1CRjuh1q31lpua9wDekqQg9gNR4NiYXARSnKytQxYwTPRhOLq xFMJsj8rTpUHfgohVwTa1/uDaNMNn2K3GKQkKilhXyY6zEoj3r1PK9ETW/VtZboZkLv3 OuNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=Z3jrMWE928Q6BhVEHep/QBR94dnpPtsG7+6WCG1J7Ms=; fh=sFJdI2SNATJfb6TEfs0+zboM7EAh4HQz3DLBPl5YBFQ=; b=Y7omoiQ1LOxuow00Z0pt+8/gKrsutI4J6Aa3ZdhSDgjp6cJ6WcN8nFJHcCIJDaL167 ikHg84lvGpLVqJEfP1ezkgCvJHCDDTr5BimuaqawPG68lnt8NQR4Csrw4oG2zBC57Wkj GTX5YTBVHIhw0SfdetnUDJt/6GIDyt7NKo+YKtInFC44y0cDFBm9xRqmM5XZJvzCgCzS KOegLX5bWcnQBb1rce9sA67s9AiN+FPVYoOwuxSqGolHkoJ0YhAwcLgSkFMsLcmTlOlf qtM8CZjwjLPWqI0WkC7F5nl1SOXy2ZeicK5bg7kX+sBdl/DEt3cYGO11WTAXcqbD500F KmGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Z+0mO1Z3; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-176456-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f6edasi5299646a12.360.2024.05.11.00.48.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 00:48:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176456-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Z+0mO1Z3; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-176456-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CA04B284B13 for ; Sat, 11 May 2024 07:48:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7861E134DE; Sat, 11 May 2024 07:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Z+0mO1Z3" Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A63F2FBE8 for ; Sat, 11 May 2024 07:48:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715413685; cv=none; b=a0qM3f3Pz368i7oQ+mxOSU2MZGX9SUmBZQFLPDOlknoaq9DyKNBl5D3DRSpX93louVPp45nNvPgHusbAeSt0876UXUlIJXsDjA3J5ut14UpWk70h6s3no2af9e2CpVyzgobLpDsSUSokVaOZuiHIxmzE0SPImTMnSXRqCnDZjG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715413685; c=relaxed/simple; bh=meEYPUOj/04dXwOusDQMM9xj3Jdxdafr9sQJyUHw6mY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JJIrsgXL5k1xtW469c3GxTw373CEEJcKMEWydMrMha6rIys/U559/aTZNpBIXL/dZsosZGEVQcBxvg3nLIIFaKdrna+YeXVR6M+cdTg+XFXnnV8AnFDh+AeZ93pgwyXCeIwFgMtSxZF1kBQI1yWCX1UFdp/W/1UwM3DYM09bUkw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Z+0mO1Z3; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-792ba098eccso209502585a.2 for ; Sat, 11 May 2024 00:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715413681; x=1716018481; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Z3jrMWE928Q6BhVEHep/QBR94dnpPtsG7+6WCG1J7Ms=; b=Z+0mO1Z3EV9/NLnjERPm+2uU9Te7K9r6557Zzk+HU+ZIQxpuHzh3vPNV3g6TkvN040 tSI6p241QpyNDhLM+X4VEOAYNs5oCRTmyDYOsaQwPnb919kZHG74yENP6zTLmiMwdl+7 3+YPAbKcWc8AhUg6rBuK/VnaE80/lFQou1roI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715413681; x=1716018481; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Z3jrMWE928Q6BhVEHep/QBR94dnpPtsG7+6WCG1J7Ms=; b=NQ6Og1vqvAJ11Vo2R8VYZwu94L7pfrhAocZCcupa2M+CXYdRPDegMrHncGwh8YzVyr 42f6+/gYTLrBj9vzVWnXIJx5Ferg+9DCjEyT94drUDmBCAtPlak0GZn478QJUE+d5gxB N5iCLQp4BYCnpltcEKoPJDPylUTFQHe9eHkvvod+gVZJHyDLp/mQNykc4NVVu8GEJery ENeYe9Kq+OAOTre2VlFro58aj/ElldIHa6snRD5gZ4uRbhTeYN+knrJZTTGpaE6zpcI/ A3bzpAVfG5ATcATHeFOuOZkX5SyHgFCVEJJNBvhfClDa5bBi6y+cfynY7ra8V0sQdrHk JSlQ== X-Forwarded-Encrypted: i=1; AJvYcCUSFYhj+ADYuKQvanA8uwXunfIOtwlw8eECuiDAwHZsnzwqq3tTMpJnfKnUJo7AlVfDSWzIL7FitWa4F7KzvH3uvP7FUUnGKSZsDV+J X-Gm-Message-State: AOJu0YxJyYJRx07OppdGIw9W2zOlrX6JFhqz9h5n0dut27cD4tFQKsy/ hv+n+twtc/hqnQNxFf584HjBV1XtdsD7S4W6cpKyUnriPG/3oDcN3hV5vbha5NU7MGmwBICahI4 = X-Received: by 2002:a05:620a:815:b0:792:b91b:3588 with SMTP id af79cd13be357-792c75763a5mr504323985a.7.1715413680923; Sat, 11 May 2024 00:48:00 -0700 (PDT) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com. [209.85.219.47]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf2a401bsm254997585a.71.2024.05.11.00.47.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 May 2024 00:48:00 -0700 (PDT) Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6a073f10e8eso12766456d6.2 for ; Sat, 11 May 2024 00:47:59 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWxgMDnbDjK/XlHFzJEcOEQpBUL9jYrtJ4bIebMOVtEIb6hTremQ+rCl0L5LBqVjJkbDYvhoVBmtQBjA55V/g/pqrBJef87Z8YjQwe+ X-Received: by 2002:a05:6214:398f:b0:6a0:ada7:1ffa with SMTP id 6a1803df08f44-6a16815f8eamr48583366d6.17.1715413679256; Sat, 11 May 2024 00:47:59 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240509-fix-hi846-v1-1-1e19dc517be1@chromium.org> <20240509193900.GA32013@pendragon.ideasonboard.com> In-Reply-To: <20240509193900.GA32013@pendragon.ideasonboard.com> From: Ricardo Ribalda Date: Sat, 11 May 2024 09:47:47 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: i2c: hi846: Fix V4L2_SUBDEV_FORMAT_TRY get_selection() To: Laurent Pinchart Cc: Sakari Ailus , Martin Kepplinger , Mauro Carvalho Chehab , Pavel Machek , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hi Laurent On Thu, 9 May 2024 at 21:39, Laurent Pinchart wrote: > > Hi Ricardo, > > Thank you for the patch. > > On Thu, May 09, 2024 at 05:05:55PM +0000, Ricardo Ribalda wrote: > > The current code does not return anything to the user. > > > > Although the code looks a bit dangerous (using a pointer without > > checking if it is valid), it should be fine. The code validates that > > I think you meant s/code/core/ Yes, sorry, fatty fingers :) If you are planning to send a v5 of this https://patchwork.linuxtv.org/project/linux-media/patch/20240508214045.24716-4-laurent.pinchart+renesas@ideasonboard.com/ Maybe you could include this patch there? I found the issue when the CI tested your series (eventhough it is not caused by your series) Regards! > > > sel->pad has a valid value. > > > > Fix the following smatch error: > > drivers/media/i2c/hi846.c:1854 hi846_get_selection() warn: statement has no effect 31 > > > > Fixes: e8c0882685f9 ("media: i2c: add driver for the SK Hynix Hi-846 8M pixel camera") > > Signed-off-by: Ricardo Ribalda > > Reviewed-by: Laurent Pinchart > > > --- > > While running media-ci on the last patches there was a new sparse > > warning: > > https://gitlab.freedesktop.org/linux-media/users/patchwork/-/jobs/58524338/artifacts/external_file/junit/test-smatch.log.txt > > --- > > drivers/media/i2c/hi846.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c > > index 9c565ec033d4..52d9ca68a86c 100644 > > --- a/drivers/media/i2c/hi846.c > > +++ b/drivers/media/i2c/hi846.c > > @@ -1851,7 +1851,7 @@ static int hi846_get_selection(struct v4l2_subdev *sd, > > mutex_lock(&hi846->mutex); > > switch (sel->which) { > > case V4L2_SUBDEV_FORMAT_TRY: > > - v4l2_subdev_state_get_crop(sd_state, sel->pad); > > + sel->r = *v4l2_subdev_state_get_crop(sd_state, sel->pad); > > break; > > case V4L2_SUBDEV_FORMAT_ACTIVE: > > sel->r = hi846->cur_mode->crop; > > > > --- > > base-commit: 48259b90973718d2277db27b5e510f0fe957eaa0 > > change-id: 20240509-fix-hi846-c3d77768622e > > -- > Regards, > > Laurent Pinchart -- Ricardo Ribalda