Received: by 10.192.165.148 with SMTP id m20csp922984imm; Sat, 5 May 2018 00:57:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqRqXHdqViapvhZK4eotKFb4QRfMnTkOA6Z9U27mde6ku1U8GiaZLlh9jAyYQaWq4/wg4YA X-Received: by 10.98.149.21 with SMTP id p21mr29729347pfd.62.1525507049277; Sat, 05 May 2018 00:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525507049; cv=none; d=google.com; s=arc-20160816; b=pJSgDFZnXAExz+fJo14l/jreg+pUtNTmrbepau5iYgNGIW12L4MOLpsvTbNh3aMSIF Isp00nTmi3fB30T/rpKZ6xa1cxwZ7w7pPu4QwUXcEfK7Oh/Y70JilTy4qj4THL5fILxu dRGUqqqto78td3HufZyiVVf0QMcbfvybjMPVqL3VyhBdmmwarbDVE/88vTZGXmtKq3HG /iH+37rj6E/1lsvhoMbV8j7cz/U4Sk4YDsORzeDKB3PkTrMPTUc9JYgS5GwfjmI1r9JL 2ZRQUgZPI1qWhGXwh4/0gW+VLcPYsQg3GuOZkJ9HWrQBNH+2bHy8JGs8KROWOqfq2V19 ow/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=7doHuk9Vyx7u7RnjbQ6fERcgfovGgNocA6fDapGK0Kc=; b=nLeUpL/1jUoyqDH5lQ+ZCZ+lUrzUmNb8WSDdbVL1rPbyKe4KxrarWX0nTziO5FgJBK kb9wDYUkrPyodeRe0DZ6KfpxZXF9duzbjpEOdaR7GCZXeyu51YiF6DV4OY5s6gXZW2dq V8Wj31ZZGYSTPvryQnVu6+9PLHnW8gvGjsnZSwmhT34rN6QnQ3ZmnZ/7lqkt106IbLt2 NbP1WIXPBQD1Nn4k10w/JD/J1LsC5KMcBzYZ7qnPjJ4/GMECX+wgES3TR6UPx2jEnErU AaKTAmcJ0t0389OGmF3ygaJ0QyQ1v5HJFCUgWKYDhjKSjyXCQdcTqZ6wxUZJvxsKOwS/ 6q6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n23-v6si14696435pgc.359.2018.05.05.00.56.59; Sat, 05 May 2018 00:57:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751206AbeEEHzf (ORCPT + 99 others); Sat, 5 May 2018 03:55:35 -0400 Received: from mout.web.de ([212.227.15.3]:54073 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbeEEHzd (ORCPT ); Sat, 5 May 2018 03:55:33 -0400 Received: from [192.168.1.2] ([92.224.135.153]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LbftD-1eV3ev122l-00lI4W; Sat, 05 May 2018 09:53:26 +0200 Subject: Re: [v3] [media] Use common error handling code in 19 functions To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Al Viro , Andrew Morton , Andrey Utkin , Arvind Yadav , Bhumika Goyal , Bjorn Helgaas , Brian Johnson , =?UTF-8?Q?Christoph_B=c3=b6hmwalder?= , Christophe Jaillet , Colin Ian King , Daniele Nicolodi , =?UTF-8?Q?David_H=c3=a4rdeman?= , Devendra Sharma , "Gustavo A. R. Silva" , Inki Dae , Joe Perches , Kees Cook , Laurent Pinchart , Masahiro Yamada , Max Kellermann , Mike Isely , Philippe Ombredanne , Sakari Ailus , Santosh Kumar Singh , Satendra Singh Thakur , Sean Young , Seung-Woo Kim , Shyam Saini , Thomas Gleixner , Todor Tomov , Wei Yongjun , LKML , kernel-janitors@vger.kernel.org References: <227d2d7c-5aee-1190-1624-26596a048d9c@users.sourceforge.net> <57ef3a56-2578-1d5f-1268-348b49b0c573@users.sourceforge.net> <9e766f52-b09e-c61e-8d9f-23542d83f6b1@users.sourceforge.net> <20180504144928.566ae507@vento.lan> From: SF Markus Elfring Message-ID: <980b7bd9-b922-55f7-c2d7-2d20552ade4c@users.sourceforge.net> Date: Sat, 5 May 2018 09:53:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180504144928.566ae507@vento.lan> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:zI95rEzgt66WrwkB+0/lwtunoaylC/HUnaZNbtqRXL/AYpE5sQV wwjPfQb8SypwEp4DujLsLZaT7kmaH4qW0xYXu742PyhZvpwGJ+xLNGT4vxfor1CYAYOK6CY 67R8UrLxBxSbkPAXhot+ANFehn80TmxkuspXCisAW26UdOd9dXA1HZuWVACBKrYhlXFDRqA k7pkweaSpbOm4CfEIcZeg== X-UI-Out-Filterresults: notjunk:1;V01:K0:ASWpoSubfAc=:748bqFOPcNu2QI8hiuMWjZ kUSv3R4hPfeFoqX3dljAHNJG1KWfI4CJJHMChIHUgACY1XHfcp5Qca1h6q/LaOSZE4cYnS7WY PJIVxmKLBcZKCysDPTO+GUc+rN9oLlvnwLgfXSp6rVFoVcFnsYt5B10ZgTTTHw2NL03NUvZqu OwcbF38755bzh9fv0kbtyzeqQGQhvhvrq6X2JzLu8jvDFaTv2wigQbILl6OapvgAlRlgdH7K0 fywJjWlEL2Y6Q9ZpoeHRyA0dcZIJTdVXIi8tXB8v8OM5k8cKKFDUOuyQFWUVnPC79i3elqhGt k4IDkjduFSCzyebqSuEOIHAgtbUH2CGf96anT1p7/QcA6h4fULXIq6mCnMt7AxDKTSEOOiHPH oYAhRqqF9VdD7s8YBQgpC1tjqX1+/p6eBXhexpydmnmiqMmS121mBThPoHxmXzHSqNIjwaWwP yhJyb0jw1j7vtiq+sh+DrXGT4bGfm6dsA1v4fHjVoE9icxna71PgxeRZWCMpO7AjHiG63F1Oq 7eXgLh9Yiqe0BtPoo1iqXaiDHVtzoEp27jXgxHWKThtVB2e2+rbWd3bSPVZumbosixiwBr5eZ TTX2FQNOlYnvxMswOpUkFCrIyNndT/+KPZiO9w5+Os2H+au9KTnSuIHF/b3zxMsFgUkTknx3y k0IkOWgxoZYkl0kM53jUNPVfAq9zXb/UAQTQGz0qlD0xTX6yso1VuHPIu4hwgk59ZyTjQIqre EdsYKayj9yhPRHRHraFGA15l0KI2BzzieGGH2OnKPVTMsDqRU5Wi3gcTVtBH8Hfd4rMqQY9Yc fBliHh6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -656,18 +656,18 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev, > tsfeed->priv = filter; > > ret = tsfeed->set(tsfeed, feed->pid, ts_type, ts_pes, timeout); > - if (ret < 0) { > - dmxdev->demux->release_ts_feed(dmxdev->demux, tsfeed); > - return ret; > - } > + if (ret < 0) > + goto release_feed; > > ret = tsfeed->start_filtering(tsfeed); > - if (ret < 0) { > - dmxdev->demux->release_ts_feed(dmxdev->demux, tsfeed); > - return ret; > - } > + if (ret < 0) > + goto release_feed; > > return 0; > + > +release_feed: > + dmxdev->demux->release_ts_feed(dmxdev->demux, tsfeed); > + return ret; > } > > There's *nothing* wrong with the above. It works fine, I can agree to this view in principle according to the required control flow. > avoids goto How does this wording fit to information from the section “7) Centralized exiting of functions” in the document “coding-style.rst”? > and probably even produce the same code, as gcc will likely optimize it. Would you like to clarify the current situation around supported software optimisations any more? > It is also easier to review, as the error handling is closer > to the code. Do we stumble on different coding style preferences once more? > On the other hand, there's nothing wrong on taking the approach > you're proposing. Thanks for another bit of positive feedback. > In the end, using goto or not on error handling like the above is > a matter of personal taste - and taste changes with time Do Linux guidelines need any adjustments? > and with developer. I really don't have time to keep reviewing patches > that are just churning the code just due to someone's personal taste. I tried to apply another general source code transformation pattern. > I'm pretty sure if I start accepting things like that, > someone else would be on some future doing patches just reverting it, > and I would be likely having to apply them too. Why? I hope also that the source code can be kept consistent to some degree. > So, except if the patch is really fixing something - e.g. a broken > error handling code, I'll just ignore such patches and mark as > rejected without further notice/comments from now on. I would find such a communication style questionable. Do you distinguish between bug fixes and possible corrections for other error categories (or software weaknesses)? Regards, Markus