From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753909AbbGPGk7 (ORCPT ); Thu, 16 Jul 2015 02:40:59 -0400 Received: from mout.web.de ([212.227.15.3]:50911 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753849AbbGPGkz (ORCPT ); Thu, 16 Jul 2015 02:40:55 -0400 Subject: Re: ARM: OMAP2: Delete unnecessary checks before three function calls To: Paul Walmsley References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <54705EC3.90708@users.sourceforge.net> <55928739.5040809@users.sourceforge.net> Cc: =?UTF-8?Q?Beno=c3=aet_Cousson?= , Russell King , Tony Lindgren , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring X-Enigmail-Draft-Status: N1110 Message-ID: <55A751DE.5080301@users.sourceforge.net> Date: Thu, 16 Jul 2015 08:40:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:oUag2KFgFukvKh/MijE9cDyFSwcpaZPweWHSbLO4vnDDLZ4cpO6 xmaCV+qlh4yt96Q+vQVr8FeXQaPmRbRaF+B4DRTBpEnepmM5rC5wqb7ZnUhhKClppeeJT+k uMT0NoFB9pnSVT5ZUSIsxk1Ik1iUW25MUWFQkFtVMhAYGJmG5+HhdIjHSaov1iGIXG4cvmF XYLPElysOs3ekk1zZ2EFA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Dto53fF4SJA=:wPxQ+I14N/t9BKvmWlW/Mm wb5Bwlw8K2HaAoUpIqIRe/0Ao/RPFCjjnJRCMAYTg5vEjt5OOByzkvMli8BafTs2zWzX8oOMn F4FQGsK79lZ3SJqVyrEbu1PW1+9KFS1WvKgNxDSh2YknkrVR1euRY1gFH2lrY7TZkDrQTtNTq Rxtt6dSoXRKr+8Lk3Necj5Dzo1lsKxYWkyvm7Hg5JnsB2Qkpl2ZtNEZTqLtSYSDtEsBNDlFjm ieDTBeEGd8z4twaBsB2DQ23ILYMFaf4tvUsR2eE80Nz96+KGzLV2sl4+X9Po9uPWC+7cO4oY5 jZRR75hUJxxSqIW5+NLNzoV+Scgl78X7VPiIdpJGtRE/AuYRBd3ffi9a3tD9HkP/dK3xBizjN kskiMMrarh+nXjUTYCh3TMiFDrTDNuwvnGC+Xr9niToxAsC4v/KmlumE5kxHTq06I8k+5tv6l mZHoe9xF831OqRkvOGkG1eSh4bMIF4sonz/cwK9hZNIpizQYk3BRqpdRxmZUE56BAKLT81Nar Z3LCSjLGsA773AaEJT6dwEksH/9zhvsZExAyXT9cl6SRCemJGVQ3c2JgpDZvihqSzu0979M50 t8IRinbNGbyLU3m882JLjX3ZXfXkKI/uT9EPk7tpMEDIddHq+c/C1dH/4kkYiJOlpxZmkbh8d TMUm7kQ26RcIqUofrm1ZSejxEbtW9Uv7hErQXHnCJiHDowne7zpxpGZ01ttoWVwEcQ1w= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I have to say, I am a bit leery about applying the omap_device.c and > omap_hwmod.c changes, since the called functions -- omap_device_delete() > and clk_disable() -- don't explicitly document that NULLs are allowed > to be passed in. How are the chances to improve documentation around such implementation details? > So there's no explicit contract that callers can rely upon, to (at least > in theory) prevent those internal NULL pointer checks from being removed. Are there any additional variations to consider for source files from different processor architectures? > So I would suggest that those two functions' kerneldoc be patched first to > explicitly state that passing in a NULL pointer is allowed. Should my static source code analysis approach help you any more to clarify further open issues? > So I'll apply that change now for v4.3, touching up the commit message accordingly. Thanks for your constructive feedback. >> arch/arm/mach-omap2/omap_device.c | 3 +-- >> arch/arm/mach-omap2/omap_hwmod.c | 5 +---- >> arch/arm/mach-omap2/timer.c | 3 +-- Did Tony Lindgren pick a similar update suggestion up, too? https://lkml.org/lkml/2015/7/15/112 Regards, Markus