Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752859AbdLDTWV (ORCPT ); Mon, 4 Dec 2017 14:22:21 -0500 Received: from dd39320.kasserver.com ([85.13.155.146]:34918 "EHLO dd39320.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbdLDTWR (ORCPT ); Mon, 4 Dec 2017 14:22:17 -0500 Subject: Re: [PATCH 4/6] staging: pi433: Rename enum optionOnOff in rf69_enum.h To: Dan Carpenter Cc: =?UTF-8?Q?Simon_Sandstr=c3=b6m?= , devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, linux@Wolf-Entwicklungen.de, linux-kernel@vger.kernel.org References: <20171203151726.16639-1-simon@nikanor.nu> <20171203151726.16639-5-simon@nikanor.nu> <20171204101737.xv4eyglsrbmiagtn@mwanda> <20171204103719.7talcb3dqu3yfns2@mwanda> <401fb0b7-48a9-dfc9-481b-d4e31f0ed9b5@smarthome-wolf.de> <20171204191522.dcwclu7v7fig65nc@mwanda> From: Marcus Wolf Message-ID: <9e438a22-4371-551d-5e71-9803e3f06a44@smarthome-wolf.de> Date: Mon, 4 Dec 2017 21:22:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171204191522.dcwclu7v7fig65nc@mwanda> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1905 Lines: 62 Am 04.12.2017 um 21:15 schrieb Dan Carpenter: > On Mon, Dec 04, 2017 at 08:37:51PM +0200, Marcus Wolf wrote: >> >> >> Am 04.12.2017 um 12:37 schrieb Dan Carpenter: >>> On Mon, Dec 04, 2017 at 01:17:37PM +0300, Dan Carpenter wrote: >>>> Perhaps choose different function names if you want? You could do it >>>> as several patches: >>>> >>>> patch 1: change types to bool >>>> patch 2: sed -e '/ == optionOn//' >>>> patch 3: split the functions into two functions >>>> patch 4: delete optionOnOff enum >>>> >>>> patches 1 and 2 could be merged together (your choice). >>>> >>> >>> Markus says that optionOn is used by user space so my you won't be able >>> to remove these entirely. But as much as possible we should internally. >>> >>> regards, >>> dan carpenter >>> >> >> Hi Dan, hi Simon, >> >> I think, it's a pretty nice idea to remove th optionOnOff and replace it by >> bool. >> >> >> In former times, the variables in the config struct had very different names >> - not containing "enable". Therefore optionOnOff was used to make absolutely >> clear (in user space), wheter something was switched on, or off. >> Now the variable have nice names, so bool is fine, even better now :-) >> >> >> I would suggest not to split the amp-functions but to rename them, to also >> contain an enable: >> rf69_set_amp_X_enable() > > That's a bad name, because it doesn't just enable it also disables. > Please split them. > > regards, > dan carpenter > > Same applies to all other stuff, that's using optionOnOff: rf69_set_sync_enable(optionOn/Off) enables and disbales sync, rf69_set_crc_enable(optionOn/Off) enables and disables crc, ... In my opinion, if we want perfect clarity, we should stay with optionOnOff. If we are ok, if rf69_set_sync_enable(false) disables sync, in my opinion, we also have to be ok, if rf69_set_amp_X_enable(false) disables the amp. Cheers, Marcus