From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A3BAC433E0 for ; Thu, 21 May 2020 10:31:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1107220721 for ; Thu, 21 May 2020 10:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728635AbgEUKbx (ORCPT ); Thu, 21 May 2020 06:31:53 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:56471 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbgEUKbw (ORCPT ); Thu, 21 May 2020 06:31:52 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MVMNF-1jRW2T0fNn-00SMTz for ; Thu, 21 May 2020 12:31:50 +0200 Received: by mail-qt1-f178.google.com with SMTP id v4so5064288qte.3 for ; Thu, 21 May 2020 03:31:49 -0700 (PDT) X-Gm-Message-State: AOAM533Z57TNnwl/J4/kriK/3tIwGaGtKiKOEqi202qIL8P/rtB/3y6g ejCo3Xkts8WInmPIyWR9k1NNU2qf6UA1+hurCYQ= X-Google-Smtp-Source: ABdhPJwchc6f5+9k206SLSnfoFenzvhxDbq6spSQmMaQz2Elq2egNsF2fR59Bs9Mydr7En0Lzg2n4asxBiotUtGD9yc= X-Received: by 2002:aed:2441:: with SMTP id s1mr9921937qtc.304.1590057109012; Thu, 21 May 2020 03:31:49 -0700 (PDT) MIME-Version: 1.0 References: <20200518091222.27467-1-sudeep.holla@arm.com> <158999823818.135150.13263761266508812198.b4-ty@kernel.org> <20200521070629.GB1131@bogus> <20200521075755.GA4668@willie-the-truck> <20200521081055.GD1131@bogus> <20200521101422.GO1551@shell.armlinux.org.uk> In-Reply-To: <20200521101422.GO1551@shell.armlinux.org.uk> From: Arnd Bergmann Date: Thu, 21 May 2020 12:31:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 0/7] firmware: smccc: Add basic SMCCC v1.2 + ARCH_SOC_ID support To: Russell King - ARM Linux admin Cc: Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , Catalin Marinas , "linux-kernel@vger.kernel.org" , Steven Price , harb@amperecomputing.com, Will Deacon , Linux ARM Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:5QEY1jlnWSAcO6isBmAiH/9bRt7OMve8PYThQnbaPI0W8GV5wH4 ZZUkI3q413DxNPpFlwglYLxLwbSf54eAO08AsT7HIB/37caTNUxCtKLRpI05Za423g/KoL2 yJRpj4H3tOR9dtlZM30tVXu+Mk5waeOpXuPeHh/8/+YTAjH7s9m7MfTv91PHrafdd9R7zMT Zd7qTtK3gTe7js9z/Vz1g== X-UI-Out-Filterresults: notjunk:1;V03:K0:EldDG6czeqU=:2rFrIWMYPM+OTUi1TrbETw LZEmTNaVLtLeePFFpOf0tahsMnJTqUsQsm037ZBT8cnGJvK+sNsSY3qh1fjYYwTL/6KrpXbmY LU/RZydiSsc5n1RYyS+WOi/pWXoOZr1gfM2OchKw4BnFysQTQZOYNfJf4Apil0llRZcOUyvvz l1ScT8e/jZW80h7PtrJUmaLZIx+hb+gPw9qgqtSTU3HFycCi4u9rntVkJte4lcO1F9EbYVYjD v/I34xJRLjqzoEH2yBbcRFZfM/+h9uXQMnr1ODNNLVPo/i4AQZZNLHFXYP0tGwz9Rr5IF5t7A z8qg427POp5vLo3g6CEjL8s7TR/icHK7BGwCkqTUvKgBALlzSfS92rzlUtPzD/t/FjLgEz38y sMPi/Q7oNauFAI+/0H4eXiRbkB7JhLImMYwruWqHyBktyz4vrHnEsJMF2iIACsNikIHs/k9W3 DtYi0X7uG2RV1DVWK5jix400K93ekA/nNqnsZkUoM82n3xL7xIjfKj75jkpl3PTTWp92k2XxP pVYqR4gzojk76Oz+3qm0wKzMxLYp46LYTftKQt0jgKL/2dWVkvQuB/cGcNdid9G4FjbGklxYX M3UTxeYA1w1RZsHf4xavEVv2wXXKhSP1M6j3A3B9Vzg/kpdgrF5+7zZ2CBzgODJ+lYqTxONy8 a9flxjQ/YdxHiIuDXj9ApRPgJliB+rH69yC2hbj3XTQeLklD7aA/6sAmD2KFjrMKe6EMR4u6i d0O+2M6S4kIZZ6fjLe0ND+aSVpnfCz6uCDB4gOAzBbmceE3Xx0sosnxBa4ubboxdZb6US2Ew9 DXRFtDZWz3DwsqEENSegWVf1BkjxNqClnjAmZ6lZ1awzua2t3Q= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 21, 2020 at 12:14 PM Russell King - ARM Linux admin wrote: > > On Thu, May 21, 2020 at 11:06:23AM +0200, Arnd Bergmann wrote: > > Note that the warning should come up for either W=1 or C=1, and I also > > think that > > new code should generally be written sparse-clean and have no warnings with > > 'make C=1' as a rule. > > No, absolutely not, that's a stupid idea, there are corner cases > where hiding a sparse warning is the wrong thing to do. Look at > many of the cases in fs/ for example. > > See https://lkml.org/lkml/2004/9/12/249 which should make anyone > who sees a use of __force in some random code stop and question > why it is there, and whether it is actually correct, or just there > to hide a sparse warning. > > Remember, sparse is there to warn that something isn't quite right, > and the view taken is, if it isn't right, then we don't "cast the > warning away" with __force, even if we intend not to fix the code > immediately. > > So, going for "sparse-clean" is actually not correct. Going for > "no unnecessary warnings" is. > > And don't think what I've said above doesn't happen; I've rejected > patches from people who've gone around trying to fix every sparse > warning that they see by throwing __force incorrectly at it. > > The thing is, if you hide all the warnings, even for incorrect code, > then sparse becomes completely useless to identify where things in > the code are not quite correct. Adding __force is almost always the wrong solution, and I explictly was not talking about existing code here where changing it would risk introducing bugs or require bad hacks. However, when writing a new driver, sparse warnings usually indicate that you are doing something wrong that is better addressed by doing something different that does not involve adding __force. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE22AC433DF for ; Thu, 21 May 2020 10:31:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AEE2620721 for ; Thu, 21 May 2020 10:31:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qrTi4hSD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEE2620721 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CpS0q6BpbVxWEyv2vzMvXOIpYRyTk/5DPxdlXRt2978=; b=qrTi4hSDlT75hI tOsdHJ0ojgjVG5Jw4I2Sb3w162h5zFlYDvuop33i3HFA8YEbyf6Zf5Ixk6p6tpGriZCFsVtxEAVAh fuAE2DHEFR7jSvSTkRXjdzZfu8ZnkAe9QzsQZpVZq2M6LeefclFf/UkfdFg9V9LZP56RTCpvJl1ns XBEWWY72PJh2cITUkQXr2MxCGbcu8sca1ssC1Lj9pnTkPIRMhGqjPOVZgpwwDahxEnI4HxFEDrWBS PkCputGQw1EFXupstJnmBjMHkCYYXK331arwK8ceGxFjIAq3imq74CHmDgFW0aYB3VsaqJM4stJ5l 2t6RsIMc6YZHXBemQ4lw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbiUW-0004sD-A3; Thu, 21 May 2020 10:31:56 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbiUS-0004re-KW for linux-arm-kernel@lists.infradead.org; Thu, 21 May 2020 10:31:54 +0000 Received: from mail-qt1-f177.google.com ([209.85.160.177]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MOiLp-1jPFuL1k6x-00Q9ff for ; Thu, 21 May 2020 12:31:50 +0200 Received: by mail-qt1-f177.google.com with SMTP id t25so5086497qtc.0 for ; Thu, 21 May 2020 03:31:49 -0700 (PDT) X-Gm-Message-State: AOAM533Ikleo3qoKOj6Vr1fxG8IAMRbeSbPvPzkWta09/WcAITWh339w vR0LvZJW3JofcjAT9igvUgPdwLH5QpTKQSQCJro= X-Google-Smtp-Source: ABdhPJwchc6f5+9k206SLSnfoFenzvhxDbq6spSQmMaQz2Elq2egNsF2fR59Bs9Mydr7En0Lzg2n4asxBiotUtGD9yc= X-Received: by 2002:aed:2441:: with SMTP id s1mr9921937qtc.304.1590057109012; Thu, 21 May 2020 03:31:49 -0700 (PDT) MIME-Version: 1.0 References: <20200518091222.27467-1-sudeep.holla@arm.com> <158999823818.135150.13263761266508812198.b4-ty@kernel.org> <20200521070629.GB1131@bogus> <20200521075755.GA4668@willie-the-truck> <20200521081055.GD1131@bogus> <20200521101422.GO1551@shell.armlinux.org.uk> In-Reply-To: <20200521101422.GO1551@shell.armlinux.org.uk> From: Arnd Bergmann Date: Thu, 21 May 2020 12:31:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 0/7] firmware: smccc: Add basic SMCCC v1.2 + ARCH_SOC_ID support To: Russell King - ARM Linux admin X-Provags-ID: V03:K1:6JSvxpMgf24HQMaa7zhr7ZYErROv29dIHE5AZ3+uF7GwfMb5vk4 bW/IPXClLPI/41jhAOcM5deTUJV0Egwa1V1U1D26wXn5wb/DN95FBjI7wAhplwgw99eLZP8 9Qor/U/txDLuFi1kH831DF9Rwqo42o0g2aHMBm0sAKvwGlKDVyGr0mHi/gWtj4hsib7umLC ArV0cK7ped+PbytRAPcVg== X-UI-Out-Filterresults: notjunk:1;V03:K0:SvgOx8yGtYw=:cztsDb/AKbv0rfcjGUzmbE zjcswka+K+8vWtB+8pxYp12ye5W4cc8JvXRwCr7vakye+Z51YN3v1P6YUwp+wptwPBLrj39A0 1KmmezkOpgP2WXWgZYDEVw7XH5HNJiiwbc6lMPRPU3LElcDIB0vh7xhHlEFib6gUch/0dxaEE GI79SoTNsFEaMjH/z27Pc7bi/K7cBZge9khnHRel7Ps6d7ByTn81BdehaeljJbCPZBzJTIPRk errkdTncnWSZeZQ94ZVdzLEPXbQ38P0TXsan66BfMAbEx5HY+vedc87cDXmNI4gOyeqigCcIJ 3xx9FRhGwnF+SEWQc42XdAWxT9E0GU4TF4PKChdLsS1vXP24SY+RkSWynthbzxDR4cmnOERgP KuOY0XhFM/mmiK+Mpi1oYthAYf2o6bcL+3Sr7cflSJuJieMVUPsY+dWI65KgYVKic0h6t2zkp ZiL3kdQodMBx0YA7y2HerFktm+lQ32QnuvaBMJakJ9yT66pagpdz3WnSnJKt+vcYqRJYD/SNw pHM71Hy2uZa8YEKxDxPLIHRtZKy8M05jTzdiXL7ERinU8OaqQBkTLoOXQseMn1MSKHcmJ6fHA rVGoAGIwCZ6OAcrNz6sOXG8KAgDFzHAJJ54VCB5y6el7yao4bG29NZmJLP1zuHFKOrKeTD9cK 4yJm8grTqaOsaqgYwO4ovV/eode1pTe95Z4BWX0oi2sn2Pt9LvndTuPJU8DO7chDY78Q3WDQH VFNIoC10WsmWblBu7Bc9a9ycfxg2IYwn4w36cPaGvl0klpvLmd173sS4hT/Nu4xfQQHzDJCxU sekZmINw2p440ltUNk9uW6fHanPD0wUN8ZW9P0nmtwGt5hzJ14= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200521_033152_968663_BDEBBFDB X-CRM114-Status: GOOD ( 20.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Lorenzo Pieralisi , Catalin Marinas , "linux-kernel@vger.kernel.org" , Steven Price , harb@amperecomputing.com, Sudeep Holla , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 21, 2020 at 12:14 PM Russell King - ARM Linux admin wrote: > > On Thu, May 21, 2020 at 11:06:23AM +0200, Arnd Bergmann wrote: > > Note that the warning should come up for either W=1 or C=1, and I also > > think that > > new code should generally be written sparse-clean and have no warnings with > > 'make C=1' as a rule. > > No, absolutely not, that's a stupid idea, there are corner cases > where hiding a sparse warning is the wrong thing to do. Look at > many of the cases in fs/ for example. > > See https://lkml.org/lkml/2004/9/12/249 which should make anyone > who sees a use of __force in some random code stop and question > why it is there, and whether it is actually correct, or just there > to hide a sparse warning. > > Remember, sparse is there to warn that something isn't quite right, > and the view taken is, if it isn't right, then we don't "cast the > warning away" with __force, even if we intend not to fix the code > immediately. > > So, going for "sparse-clean" is actually not correct. Going for > "no unnecessary warnings" is. > > And don't think what I've said above doesn't happen; I've rejected > patches from people who've gone around trying to fix every sparse > warning that they see by throwing __force incorrectly at it. > > The thing is, if you hide all the warnings, even for incorrect code, > then sparse becomes completely useless to identify where things in > the code are not quite correct. Adding __force is almost always the wrong solution, and I explictly was not talking about existing code here where changing it would risk introducing bugs or require bad hacks. However, when writing a new driver, sparse warnings usually indicate that you are doing something wrong that is better addressed by doing something different that does not involve adding __force. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel