From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mout.web.de ([212.227.15.3]:52018 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933505AbcLLRQM (ORCPT ); Mon, 12 Dec 2016 12:16:12 -0500 Subject: Re: [media] bt8xx: One function call less in bttv_input_init() after error detection To: Daniele Nicolodi References: <5560ffc2-e17d-5750-24e5-3150aba5d8aa@grinta.net> <581046dd-0a4a-acea-a6a8-8d2469594881@grinta.net> Cc: linux-media@vger.kernel.org, Alexey Khoroshilov , Hans Verkuil , Mauro Carvalho Chehab , LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Mon, 12 Dec 2016 18:15:45 +0100 MIME-Version: 1.0 In-Reply-To: <581046dd-0a4a-acea-a6a8-8d2469594881@grinta.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: >> I suggest to check return values immediately after each function call. >> An error situation can be detected earlier then and only the required >> clean-up functionality will be executed at the end. > > Which improvement does this bring? * How do you think about to avoid requesting additional system resources when it was determined that a previously required memory allocation failed? * Can the corresponding exception handling become a bit more efficient? > Why? Do you care for any results from static source code analysis? Regards, Markus