From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753396AbdJaOYj (ORCPT ); Tue, 31 Oct 2017 10:24:39 -0400 Received: from mout.web.de ([212.227.15.14]:65327 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751779AbdJaOYh (ORCPT ); Tue, 31 Oct 2017 10:24:37 -0400 Subject: Re: [PATCH] Sony-laptop: Use common error handling code in sony_nc_setup_rfkill() To: Andy Shevchenko , platform-driver-x86@vger.kernel.org Cc: Andy Shevchenko , Darren Hart , Mattia Dongili , LKML , kernel-janitors@vger.kernel.org References: From: SF Markus Elfring Message-ID: Date: Tue, 31 Oct 2017 15:24:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:qvpYLe+fQu+m0CVsCZs+yxBObA4XVXtiQ7xqp/CtOCqrGu2bDWI 8ba3OdPOGgADvZnCW80d0t0w7NETsyohAP811j01Iffmh66QNt8IHqLR5GM5BH3hg1pgt7H 4UOkLRdggZf9X/WoMQqqL14RVCcx88mjFn2vZYTtT4XDzhd7HHGIVAWJoNw+78fGhwGbsP/ lfBmiuhZFjp2E3Wnw+cyg== X-UI-Out-Filterresults: notjunk:1;V01:K0:zYBOoM2n+IA=:gDUezAgaoRCUlxCIZkbttC s4UbLdGMywAHB+QBVkri0NiqU/2kE19dPDnzITxa3mIdqLKHjWMUmOGi1v2VvtgdssWUKxcVI VYepuUyoCp+WfMyc8nteBPTmYrm6shzZW8Tp66UFEhh4uBwA9zV3T0eV/4K/sm3SiaxXTL45b plxMziDPqlZD1ojgJ77FyeMqGWXJMm0Uyb9us4ZSm8WA9n/iDhiXKcl/lWGf/qlI8GdYTQr3P 475JnduHDk8bgSB0ZWm4LsZJXOk5poqvTKcKZm7pjEIKwgBs7RuDntGmJGIPRXWbSpzD0NbmA yK6nPhjcW172zlmc/I+YiOMn6k/+dGGJHl2/LSecNwYMwJU+S48u0N433SBRCegXY3vHy5gjR cnDXQMrf/mpjVw3Qs0KetvQpkZgLq/qt6Tcw3xrNLf51uS1ATkX7J2EouwZOF/19c7DLL5bas eETwx1s2DKj9dQcbKCQS3fKkkIW//WSA7Vh8geIP+FDoUll/tV8X6F7c6xKd5hgDlvb0QKQ/+ kpc7WEl5w/3SLdZWlc7AqIdUOu8wiSQ7m/hkpzorN+iSuhk9ttkYKPyKbhBKHtvV3DKw8CT5P SNcLtPL7ANbDeNjaoiyUUaocX3jSlx7RMVQQWnqaLBIBVC6n519au6fzmj0GZm3zHH03EWjuu 9GUhYVXbUmHYO42SEhE5g29wbGI20ms0nEQGoqglrQ9gSPTPxH1tr3rsjk47lFqwFoqwT6s2k s10IDAtShu10fj78vkLUjUVr7BLZs/FsnOYTqSPGsyaB8VaCefdEVTW9/5VmtVtQDFSVjXAZ9 hPJrWA2LOdlO3UybEH7x13YxMFFERLku3VB0MvxS25Bu1xltFM= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Apparently this patch done without reading the actual code. I performed another simple software refactoring. > NAK. > > -1 is EPERM which sounds wrong here. If you would like to fix it, > propagate a real error codes from sony_call_snc_handle(). I do not know at the moment why an error code which you find questionable was suggested by Marco Chiappero on 2012-05-19 and committed by Matthew Garrett on 2012-05-31 (according the commit d6f15ed876b83a1a0eba1d0473eef58acc95444a: use soft rfkill status stored in hw). >> if (!rfk) >> return -ENOMEM; > > Okay error code. Can any other identifier make more sense there? >> - } >> + if (sony_call_snc_handle(sony_rfkill_handle, 0x200, &result) < 0) >> + goto destroy_rfk; >> + >> hwblock = !(result & 0x1); >> >> if (sony_call_snc_handle(sony_rfkill_handle, >> - sony_rfkill_address[nc_type], >> - &result) < 0) { >> - rfkill_destroy(rfk); >> - return -1; > > Not okay and it might be different from previous case. The shown function call was repeated with an other parameter. Which error reporting would you find more appropriate then? > P.S. Don't bother us with patches on which you didn't do your home work. Do we occasionally need to distinguish better between an ordinary refactoring and the adjustments for additional software improvements? Regards, Markus From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Tue, 31 Oct 2017 14:24:05 +0000 Subject: Re: [PATCH] Sony-laptop: Use common error handling code in sony_nc_setup_rfkill() Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andy Shevchenko , platform-driver-x86@vger.kernel.org Cc: Andy Shevchenko , Darren Hart , Mattia Dongili , LKML , kernel-janitors@vger.kernel.org > Apparently this patch done without reading the actual code. I performed another simple software refactoring. > NAK. > > -1 is EPERM which sounds wrong here. If you would like to fix it, > propagate a real error codes from sony_call_snc_handle(). I do not know at the moment why an error code which you find questionable was suggested by Marco Chiappero on 2012-05-19 and committed by Matthew Garrett on 2012-05-31 (according the commit d6f15ed876b83a1a0eba1d0473eef58acc95444a: use soft rfkill status stored in hw). >> if (!rfk) >> return -ENOMEM; > > Okay error code. Can any other identifier make more sense there? >> - } >> + if (sony_call_snc_handle(sony_rfkill_handle, 0x200, &result) < 0) >> + goto destroy_rfk; >> + >> hwblock = !(result & 0x1); >> >> if (sony_call_snc_handle(sony_rfkill_handle, >> - sony_rfkill_address[nc_type], >> - &result) < 0) { >> - rfkill_destroy(rfk); >> - return -1; > > Not okay and it might be different from previous case. The shown function call was repeated with an other parameter. Which error reporting would you find more appropriate then? > P.S. Don't bother us with patches on which you didn't do your home work. Do we occasionally need to distinguish better between an ordinary refactoring and the adjustments for additional software improvements? Regards, Markus