From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 741C912C7E1 for ; Tue, 16 Apr 2024 14:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713279041; cv=none; b=W+mKtve1J9eE6bQM5xKlr0p9/cywWoHA9+F5lczxU6NElJdOu1DLgXcigccislNwVJBePXHSS5z+8g5sS66IyyM/PpNL8r9T0ZH9UbiVEwyMbvRQgMOoWxhjltkih5X976LrWwNSnvVZjDPLP4s5wsnuoqjdQ7lF44b2wEYjT8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713279041; c=relaxed/simple; bh=+IniyZz110U2KrVYzUJRDath+xcu8291bnZ/MWJpfWc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uwedfJrOUxyGlwnvVtAw0CH2pn0bBuzRFOhg7YEzvyfmlBGqAaEkrtA8S3DNCl1bCWe9RSZdOHjMNHHWS+1o4OTiPPOqqjesMLK46RM9ymWzIxqfdFfAXX1l43e5OehAv5qwuDMIqg+wsD3LkTel7Br8OSZQpB9tCrwi7u1rElw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com X-CSE-ConnectionGUID: 1C/xl17kRL+oyU+H/lhdlQ== X-CSE-MsgGUID: HfN54G+BQCeBz86dgt9M+Q== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="12508517" X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="12508517" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 07:50:40 -0700 X-CSE-ConnectionGUID: UN0L0e6rQFi4U/SlsRzaIg== X-CSE-MsgGUID: seiLgdaWRv2vMZBywWjGQw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="26707105" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 07:50:37 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rwk8o-00000004j3e-3THy; Tue, 16 Apr 2024 17:50:34 +0300 Date: Tue, 16 Apr 2024 17:50:34 +0300 From: Andy Shevchenko To: Kieran Bingham Cc: Hans de Goede , Sakari Ailus , Mauro Carvalho Chehab , Kate Hsuan , Tsuchiya Yuto , Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH 11/23] media: atomisp: Remove test pattern generator (TPG) support Message-ID: References: <20240415120220.219480-1-hdegoede@redhat.com> <20240415120220.219480-12-hdegoede@redhat.com> <294058a6-72dd-4973-95ee-eaed0c908131@redhat.com> <171327825938.342316.14749757279066216268@ping.linuxembedded.co.uk> <171327844339.342316.3750832654489118780@ping.linuxembedded.co.uk> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <171327844339.342316.3750832654489118780@ping.linuxembedded.co.uk> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Tue, Apr 16, 2024 at 03:40:43PM +0100, Kieran Bingham wrote: > Quoting Kieran Bingham (2024-04-16 15:37:39) > > Quoting Andy Shevchenko (2024-04-16 14:34:45) > > > On Tue, Apr 16, 2024 at 12:25 PM Hans de Goede wrote: > > > > On 4/15/24 4:40 PM, Andy Shevchenko wrote: > > > > > On Mon, Apr 15, 2024 at 02:02:08PM +0200, Hans de Goede wrote: ... > > > > >> unsigned int hblank_cycles = 100, > > > > >> vblank_lines = 6, > > > > >> width, > > > > > > > > > > Urgh... These comma operators probably is subject to replace with separate > > > > > definitions or being grouped on a single line (as it suppose to be in this > > > > > case). > > > > > > > > That indeed is ugly, but fixing this is out of scope for this patch, > > > > so I've added an extra patch to the set to address this: > > > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/commit/?h=media-atomisp&id=48d93af9d9b0fd40a21a656cb8cd8e25700bfed5 > > > > > > WFM, thanks! > > > > > > Btw (yes, I see you tagged that already, so just FYI then) > > > (1 + (stream->config.pixels_per_clock == 2)); > > > is an interesting way of using > > > > > > (stream->config.pixels_per_clock == 2) ? 2 : 1); > > > > > > which likely can produce slightly better code (due to use of constant > > > 2 twice), although it is a pure speculation by me. > > Ooops, I didn't mean to send that. Well I wrote something but then > closed it when I wasn't going to bother and instead some how sent an > empty mail .. > > So now I guess I should actually say what I wasn't going to end up > saying? haha. > > This was too intriguing (to me) so I threw it in godbolt, and for > various levels of compiler optimsations, both options generate the same > code, even with -O0. Of course the different optimsation levels produce > different code, but the two options above always match at the given > level. Thanks for playing with this. The issue with the original code is readability and potential oddity about boolean to integer conversion. That said, I prefer my variant for the sake of clarity. > Fun with godbolt ;-) > > https://godbolt.org/z/hYjrvK6hn -- With Best Regards, Andy Shevchenko