Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp63009lqo; Thu, 9 May 2024 12:39:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVb9yXyTrAZbAtigocu9jbYskUDRPQG7R+EjwaBNuKfACDmpBNZdSRJNOtJY4pzVef/YapR0O96CbkTVnJIpMQ534a9M7FCD0MULhRmCg== X-Google-Smtp-Source: AGHT+IEoMFNNVCeVrGOGergNEvTvyMQxfwnhlxdcbXWiYYIzZalT3+xRjgCz7s3N25i4RDaLlGYK X-Received: by 2002:a05:6358:431c:b0:18f:8613:12b9 with SMTP id e5c5f4694b2df-193bb3f7b04mr44112055d.2.1715283568597; Thu, 09 May 2024 12:39:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715283568; cv=pass; d=google.com; s=arc-20160816; b=wGZo0HqCrqvxNZnUSQITe7+kookcI2CqIGDOFhR091ySAF6gr/eY16CUtcNuub3Uv5 pQa5o0dxT5nZbp0rFV/9lrX11DZ0wCNeCdZm4QOL19FM65X1aoei1xVQsgFaH5qRTCZV aRtUvlMBJAQeV3Fjol0HTK4vN3P0rFoAlC/zL2tlAP19gA7leJAHNMxQiY90FQZwiukx VaZBriU1lGZYOY4wdNVZEKGDY1dPuQ90NM3dBE162buLKxkyMoL5r7FhDvgEC+7vLnak FgYkEGnHqO6h60S0R5LD1H2KDFYOiMRHEST0R5FYXwNvNh8BxnlvdAXEXpFkhQQVUULd QJ2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sLkr051sW6XP/inoSl21KKMaJIfslT7Fq5P/opcgHDc=; fh=LQ4uqRFHTw1ceguKMmz2YjHx7Hkv8kjNzMyTZ3BNlTA=; b=p0NfrBVdODreW7BdfplJmdhB2IWCX6xR0iedk6MJW93bKK8tjEHKrsAiETVsXMTfkb TK7FyNFywIs5PLbBlVOo9CNmKDyYlt7ii3CnliDlmksHGBZ6Qq6wC+sx0vsLjzgdyoxa V0MzuUTmYs+hXmR+EMtCi8TFUdejEqFdBA7CEDzZqscrCqbYHaUtrE04Idek/pLVG51x JL4u1/rbQ1ySQlRXzs7oYUIQAVzHWZh6GVRS7rapqqJ9f5OD2/U+uMRxu/nmcfINSncn iEh9U8M9wFu225FTDbDsgLmD3g2F3Pozz9T7RkR8myxGtLxA0bLkHaKa61dkjaH9hL1p K/xA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Df+c2loC; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-174829-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174829-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1d70b7si21549216d6.41.2024.05.09.12.39.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 12:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174829-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Df+c2loC; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-174829-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174829-linux.lists.archive=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 53D451C21EA8 for ; Thu, 9 May 2024 19:39:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7CED7FBBD; Thu, 9 May 2024 19:39:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Df+c2loC" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75A49EED5; Thu, 9 May 2024 19:39:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715283559; cv=none; b=cCKuz9Hc4+E+d/esrTFJOZw55wxFDFphaS+726+R/9lKZ4367ihOkQL5vDPmg+AxXyx1BplC2fLVwbFhRlhlsds4WnXVaD0aclifOsKCsc8JZUqvCZHjpxk5AF7hB3vzr3POq4ahlRwW6xQZYA1L8vTFwbFvpR3350cG/oXnCQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715283559; c=relaxed/simple; bh=x+qhi+MJAf6bKwSdDWFSUhP5/37H1SaN9N9PAVA+wJw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=h5pBC+5D4J5QnqJUfa09RoBVltbrbWupGjau5FAfBcY9RkjRxRFvAVBiu96YodvJofGes976AzVcP3oh2Z9rgNG+G5azdE4+w00opPRFSe7C3+wr6NlgYIiqLmtonSPKTl67ownhrCqnU6lNZr7oYClfSIYR8XQ2aGtv6WKap9s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=Df+c2loC; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4A449236; Thu, 9 May 2024 21:39:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715283546; bh=x+qhi+MJAf6bKwSdDWFSUhP5/37H1SaN9N9PAVA+wJw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Df+c2loCrpu5YmWfk3iKyCmdbPonFsGnbNsd4KsBWgsUV9MVPswCCyiIyZDD+TKfp TCqfMI+nL78mfr4H7OlnzvOq5VTEpQu5NS/r+DHFdviJUCz7Q37VBwn4CJlarUD/0/ Md2kkbANGWeNhTQIKYSk5T7ztneXZfOxZ/xj7DWI= Date: Thu, 9 May 2024 22:39:00 +0300 From: Laurent Pinchart To: Ricardo Ribalda Cc: Sakari Ailus , Martin Kepplinger , Mauro Carvalho Chehab , Pavel Machek , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: i2c: hi846: Fix V4L2_SUBDEV_FORMAT_TRY get_selection() Message-ID: <20240509193900.GA32013@pendragon.ideasonboard.com> References: <20240509-fix-hi846-v1-1-1e19dc517be1@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240509-fix-hi846-v1-1-1e19dc517be1@chromium.org> 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/ > 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