From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EB9EC38142 for ; Tue, 24 Jan 2023 10:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233205AbjAXKmU (ORCPT ); Tue, 24 Jan 2023 05:42:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231921AbjAXKmT (ORCPT ); Tue, 24 Jan 2023 05:42:19 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF7A73584 for ; Tue, 24 Jan 2023 02:42:18 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10599"; a="353538951" X-IronPort-AV: E=Sophos;i="5.97,242,1669104000"; d="scan'208";a="353538951" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2023 02:42:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10599"; a="990829864" X-IronPort-AV: E=Sophos;i="5.97,242,1669104000"; d="scan'208";a="990829864" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP; 24 Jan 2023 02:42:16 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pKGko-00EIP5-0Z; Tue, 24 Jan 2023 12:42:14 +0200 Date: Tue, 24 Jan 2023 12:42:13 +0200 From: Andy Shevchenko To: Hans de Goede Cc: Mauro Carvalho Chehab , Sakari Ailus , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH 38/57] media: atomisp: ov2680: Fix ov2680_enum_frame_interval() Message-ID: References: <20230123125205.622152-1-hdegoede@redhat.com> <20230123125205.622152-39-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230123125205.622152-39-hdegoede@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Mon, Jan 23, 2023 at 01:51:46PM +0100, Hans de Goede wrote: > Fix and simplify ov2680_enum_frame_interval(), the index is not > an index into ov2680_res_preview[], so using N_PREVIEW is wrong. > > Instead it is an index indexing the different framerates for > the resolution specified in fie->width, fie->height. > > Since the ov2680 code only supports a single fixed 30 fps, > index must always be 0 and we don't need to check the other > fie input values. Reviewed-by: Andy Shevchenko > Signed-off-by: Hans de Goede > --- > .../staging/media/atomisp/i2c/atomisp-ov2680.c | 15 ++++----------- > 1 file changed, 4 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c > index 09c260ac93bf..75d09c44202c 100644 > --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c > +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c > @@ -718,19 +718,12 @@ static int ov2680_enum_frame_interval(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_frame_interval_enum *fie) > { > - struct v4l2_fract fract; > - > - if (fie->index >= N_RES_PREVIEW || > - fie->width > ov2680_res_preview[0].width || > - fie->height > ov2680_res_preview[0].height || > - fie->which > V4L2_SUBDEV_FORMAT_ACTIVE) > + /* Only 1 framerate */ > + if (fie->index) > return -EINVAL; > > - fract.numerator = 1; > - fract.denominator = OV2680_FPS; > - > - fie->interval = fract; > - > + fie->interval.numerator = 1; > + fie->interval.denominator = OV2680_FPS; > return 0; > } > > -- > 2.39.0 > -- With Best Regards, Andy Shevchenko