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 2E878C433FE for ; Fri, 11 Nov 2022 15:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233483AbiKKPcn (ORCPT ); Fri, 11 Nov 2022 10:32:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233464AbiKKPcl (ORCPT ); Fri, 11 Nov 2022 10:32:41 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15D2C623A9; Fri, 11 Nov 2022 07:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668180761; x=1699716761; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fLnnIwLCsZfQrqPlR5NOxylzjIbXc5xOOTELx1TfDW4=; b=OWtg1HfXD2TyzflDxh/pwOHn3pRl4QDz53oXnMbWVmw0tWaaSlb13MoU OWdFR5eBen/+qLQarMzkJL2BumcChETunqteeex3OzVJB3W+4LciLHg1z Y1GXCgz9Ywo1I/nq4JG5gz+l3hCTRsFUmHzCbKs/hOGbOCl6OAOYwQ0U4 RTIFjKHh95//4fqVnf5kipBRN9fMXK8wV1qYOfHDHeOfLmPHT2c+eGQdv 1Aur3HnPGN8kr5TruwCuFy4VgeZC2Rp11JwpZ0J16rdwGVjxOjiP0mufY UmHXeabbjzcWlEiS7iQFXYcg168QzlY6aqE0IEeBknvWgxCVyjvagMD4d g==; X-IronPort-AV: E=McAfee;i="6500,9779,10528"; a="299129767" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="299129767" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 07:30:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10528"; a="615516666" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="615516666" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP; 11 Nov 2022 07:30:11 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1otVys-00Alnp-0F; Fri, 11 Nov 2022 17:30:10 +0200 Date: Fri, 11 Nov 2022 17:30:09 +0200 From: Andy Shevchenko To: Sakari Ailus Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tianshu Qiu , Shawn Tu , Bingbu Cao , Mauro Carvalho Chehab Subject: Re: [PATCH v1 2/8] media: ov2740: Replace voodoo coding with understandle flow Message-ID: References: <20220726120556.2881-1-andriy.shevchenko@linux.intel.com> <20220726120556.2881-2-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Fri, Nov 11, 2022 at 05:02:22PM +0200, Sakari Ailus wrote: > Hi Andy, > > On Tue, Jul 26, 2022 at 03:05:50PM +0300, Andy Shevchenko wrote: > > Besides not being understandable at the first glance, the code > > might provoke a compiler or a static analyser tool to warn about > > out-of-bound access (when len == 0). > > I've never seen one. > > However the same pattern is repeatedly used by many, many drivers and > addressing just one doesn't make much sense. > > The proper way to fix this would be to have a set of common CCI (Camera > Control Interface) functions that all drivers could use, and then switch > the drivers to use them. > > This isn't currently a great fit for e.g. regmap but perhaps something > light on top of regmap-i2c could do the trick? So, then we can skip this one, right? > The rest of the set seems good to me. Thank you for the review, can you apply them, or should I send a v2 with dropped first patch? -- With Best Regards, Andy Shevchenko