From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vps0.lunn.ch ([185.16.172.187]:35925 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbeBXCGv (ORCPT ); Fri, 23 Feb 2018 21:06:51 -0500 Date: Sat, 24 Feb 2018 03:06:44 +0100 From: Andrew Lunn To: Bryan.Whitehead@microchip.com Cc: f.fainelli@gmail.com, davem@davemloft.net, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org Subject: Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver Message-ID: <20180224020644.GA32711@lunn.ch> References: <1519240015-10263-1-git-send-email-Bryan.Whitehead@microchip.com> <1519240015-10263-2-git-send-email-Bryan.Whitehead@microchip.com> <2461f47f-1a5b-ed46-116b-35f683ab0206@gmail.com> <90A7E81AE28BAE4CBDDB3B35F187D2644071DF4F@CHN-SV-EXMX02.mchp-main.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90A7E81AE28BAE4CBDDB3B35F187D2644071DF4F@CHN-SV-EXMX02.mchp-main.com> Sender: netdev-owner@vger.kernel.org List-ID: > Ok, but it seems to me that what I have is an example of "specific book keeping > private information". Can you clarify the style you prefer? > > In cases of allocation where I can just compare a pointer to null, I can easily remove > the flags. But in other cases I need a record of which steps completed in order to > clean up properly. In cases where I need some sort of a flag would you prefer > I avoid a bit mask, and have a standalone variable for each flag? Hi Bryan Often you know some thing has been done, because if it had not been done, you would of bombed out with an error. In the release function you can assume everything done in probe has been done, otherwise the probe would not be successful. In close, you can assume everything done in open was successful, otherwise the open would of failed.... So probe does not need any flags. open does not need any flags. Andrew