From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933028AbdHVOit (ORCPT ); Tue, 22 Aug 2017 10:38:49 -0400 Received: from mout.web.de ([212.227.15.14]:59825 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932647AbdHVOip (ORCPT ); Tue, 22 Aug 2017 10:38:45 -0400 Subject: Re: [alsa-devel] ALSA: pcsp: Use common error handling code in snd_card_pcsp_probe() To: Takashi Iwai , alsa-devel@alsa-project.org Cc: kernel-janitors@vger.kernel.org, LKML , Dan Carpenter References: <08ee0d6b-788b-2845-6964-e1e55c2d2292@users.sourceforge.net> <20170822121625.syvr64kwyh5xjexg@mwanda> From: SF Markus Elfring Message-ID: <139363f6-e059-defb-357e-f18645ba9768@users.sourceforge.net> Date: Tue, 22 Aug 2017 16:36:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:KP4at7AaME3UdIcf11qft1cS9hvsmWx6yeTh2zPSEdvLCVJR4g9 kjASpc9t/oGTubLetPv42AO1/IZND1aorVbwLKEwMUrGZrdG+xEf8re/rcTBURPDAaYNTq7 l1/c4DE8UzgeM3h3zoXbe7KPs5wxHaFlhmFjN1TWi6uDI9b7YogBEhTaH27CDjlXZPcFGA1 uzthcAHL45UjYd6Ov3ihw== X-UI-Out-Filterresults: notjunk:1;V01:K0:4msEmVaMvfk=:lYhze33pGjvOJ8XCy6b0fe ScDsH5qJhSHNbJVzyzxvDusifSyoCATRuXHgznYPR6wT7oVY5VOW0FB07Rtm4nTLO6phhMdxo UFGxhYSf38m3q2SLkX3R5Agi6ZM9PeNONxP6IUbUNixFq4dkqV/07JP49ntVTaRZDBqsFvKp/ 4NFIwsKJGH2tXM41D+Q33iY9UUYL1Ipr1cXjmtBUiUNdwMx/duSLYVcr0YCSa5KuWv8HnMBWn CCV+pYSU5DgLn+qTmxN1VlUbt4OpwUh6wtXef6xswYt0FN9ErT0acB2sfgEYQpStyPUNG/70b y5ahnhGJiEqUm7FFNOpiZXSONBNEVii2FChgCYrW+pEafdANvvD/phIQbIr504bB8nq+ncu80 lJ4Cpnw/zZPSXalV5xLhq1+bIi00SKxGrtKpbEuQkss0x2yFskefmKk5V5W5rw49ZAhhyyleO 401xVosuVbDtTcI36mbPqwxa4DsONuNGShAwPCYn3W3Z1Imxuz747+ptsu2IcgSUWnvX5+d// rR6557voIEXMoWqFSNoyMBIJOX1IklV0mBg2ouksvAtzd2YnGLve8jdsm8SY5bSIGsKPDLUFi 2FMTSnxZDaRHjrHlE21QvMe32jFG0yh7xJoCfCMfoQWEe4GGxGf5lutWl+hPyxrKAPZfMJUUz FgS2kdU50rmf0MDlByB3+OKD0M3F41OwsZdYz/gJBZ4fE/7ImcZf1MdnP3soo/ELHcg5RVmJO h2GMfQ6Y17etjBFa64vhpQEF0kDw0LCTwuvzH4n2QyYpUZNi9sgrb2XNpIWg1P0clzLbyK3Cc 6EDkaP2Ap6YmAdYmso1acqr/1cII+fFADevAtk7DhzKn//zeoEmvREUf+TaBkwRHeYYjr7e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> I got the impression that the functions which are called at the updated places >> by the function “snd_card_pcsp_probe” indicate a successful execution >> only by zero so far. > > You have the impression, great. This aspect is also a general programming interface issue for some functions. > And what's the reason to drop the negative check? * I find it a bit safer when the error predicate is “return value != 0”. * It is also a small source code reduction. > It's not clearer, not better readable. It seems that we have got different development opinions this time. > And, the worst part is that you've done it silently even without > mentioning in the change log at all. That's really bad. > Just don't do it. I found it not relevant enough for the commit message. > For example, the control API functions may return the positive number > when the value got changed, 0 for else, and a negative number for the > error. The functions returning some numbers may return positive > numbers, of course. Did I touch any specific function calls which belong to this programming interface category? Regards, Markus