Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421AbbFYLcZ (ORCPT ); Thu, 25 Jun 2015 07:32:25 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:41471 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbbFYLcS (ORCPT ); Thu, 25 Jun 2015 07:32:18 -0400 X-AuditID: cbfee691-f79ca6d00000456a-a8-558be6c0938c Date: Thu, 25 Jun 2015 11:31:46 +0000 (GMT) From: Maninder Singh Subject: Re: [PATCH 1/1] staging/comedi: remove unnecessary check around pci_dev_put To: Dan Carpenter Cc: "abbotti@mev.co.uk" , "hsweeten@visionengravers.com" , "gregkh@linuxfoundation.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , PANKAJ MISHRA Reply-to: maninder1.s@samsung.com MIME-version: 1.0 X-MTR: 20150625112748464@maninder1.s Msgkey: 20150625112748464@maninder1.s X-EPLocale: en_US.windows-1252 X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-MLAttribute: X-RootMTR: 20150625112748464@maninder1.s X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N X-ConfirmMail: N,general Content-type: text/plain; charset=windows-1252 MIME-version: 1.0 Message-id: <1130498471.248131435231903435.JavaMail.weblogic@ep2mlwas07c> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCIsWRmVeSWpSXmKPExsWyRsSkTvfgs+5Qgy/rGS0u75rD5sDo8XmT XABjFJdNSmpOZllqkb5dAlfGlWfVBRe4Klr2nGJtYFzB1cXIySEkoCaxaO9jNhBbQsBEYtaf 6SwQtpjEhXvrgeJcQDVLGSWe/HjB3MXIDlZ0wQ8iPIdR4v78y2C9LAKqEv1v/4L1sgnoS5zd u44ZxBYWCJW4t/8IE4gtIqAncefEURaQZmaBi0wSC//+ZII4QlFi/Y0njCA2r4CgxMmZT6CO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UMwehajQlumdfZYOw+STWLHzLAlO/ 69RyZphd97fMheqVkNja8oQVxGYGun9K90N2CNtA4siiOazofuEV8JRYPbmbaQKj7CwkqVlI 2mchaUdWs4CRZRWjaGpBckFxUnqFsV5xYm5xaV66XnJ+7iZGcBJ6tngH4//z1ocYBTgYlXh4 L1ztDhViTSwrrsw9xCjBwawkwtt1ECjEm5JYWZValB9fVJqTWnyI0RQYbROZpUST84EJMq8k 3tDYxNzU2NTCwNDc3ExJnPf/udwQIYH0xJLU7NTUgtQimD4mDk6pBsZeoXXMU2XY1BKf/WuX Pvzs/JXQgPc/4wxq59mF37lr/i7DJOmqS8T0/G8xXu56H/I3rF7e3eJ+pZVx0dnCu5xRirM+ 6q5guc7/Ksa2Qtz5t4pZocndSf8udGvn1M5VD9a7k/4vuj+81f1F2fFlv5ZePrN2Wc/M+Khf 2tIXk/+ubTh4YcFrpmVKLMUZiYZazEXFiQBEZbExWAMAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t5PBWTtZ023488 Content-Length: 1128 Lines: 23 Hi, >This patch is correct but the motivation is wrong. > >The check in pci_dev_put() is like a sanity check. There are many >functions which have a sanity check and many which do not, it is >impossible for a human to remember the complete list of each. When we >remove explicit checks for NULL and instead rely on the sanity checks >it sometimes makes the code more subtle and difficult to read. > >In this case, "pcidev" can never be NULL so the check is misleading and >makes the code more complicated. Removing it is a good thing. Also >the attach function does not have a NULL check so when we remove this >check we make the code more consistent. > >But in other cases, if "pcidev" could be NULL then we should keep the >check so that the code is easier to read. Yes agree, I also sent this patch because there is only one call for pci_dev_put in adl_pci9118.c, and i thoguht its good to remove check around that one. Thanks for your feedback. ------------????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?