Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp202076rwi; Wed, 12 Oct 2022 18:38:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM58r/CMC0vyOBuoo8i/RKJCeNmTuUMn2B0mMxZNirH60mH6kxTnIYZR+Ifkb3TH3/MH/h1I X-Received: by 2002:a63:4042:0:b0:43b:ddc8:235 with SMTP id n63-20020a634042000000b0043bddc80235mr28241343pga.498.1665625133587; Wed, 12 Oct 2022 18:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665625133; cv=none; d=google.com; s=arc-20160816; b=oXwjqGhSbhhvkkfyCwkmcSSRznySbY0EglnfXhy96V3lsMoJjchLJA/8M0UQHpqQRQ dtVjCgXlCWusS+sUDpif3h3Y3RXfCxTjw9Nb9MjO8Xw+oThcfqyKPXRjyAW3GNNFkLOR X7WFHHRUf5vKC1/xM5gFji5U/qq3TYA8OzaebqmndwxIsDP2Llq9A/LA0slHkPKlpeP7 Jky+2FmZfQriZSJotAPHtsr2dpHlv5PRtBlMF6bfTw0ipW/I+GwxVnmuDSHAbwxH8dIC sDrfzmrrAGTwqrYNOOKHsG/wt3x9iU5rgCfVSLoiN5OXLwXEJIMaS8Vo6HBrMG9nRIfd tT9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject; bh=25Hd6nrZmXUBQSXdYb+vn4mc6Za+Zkm9LusrEDPfZyI=; b=GWKE4y3RDUtInpE95T78fQB6vkKsGA9Tbnw65JOJjHl9aCpOsASp9rg9Mo5es5Dter L3Qz5Zp/cMegSFB39+LpUKhz8n3zhHObn6h39hcU46f5ulJCtJ5k8elypmB1aVmGmP1H woOOXZl+RNq4JOb/YaMaFRshShk2cQL1edQsQWBZjV5B9Gp53ftdgJHc7GujKMb5WblF Zh0zJFX0dCE3ru7UZ4XcmDF+O5LklksNfybkwuQxR0fUashbEv0gYsTjBYWWVnO0hTts bk/fBQO2cugm9JvlrQL9JoxZjrEd7Zhngi7hf1OTeriJahyX7yloPwriLzyLMOur5vvN krYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my10-20020a17090b4c8a00b0020da61f84dbsi706227pjb.176.2022.10.12.18.38.32; Wed, 12 Oct 2022 18:38:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbiJMB2s (ORCPT + 99 others); Wed, 12 Oct 2022 21:28:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbiJMB2q (ORCPT ); Wed, 12 Oct 2022 21:28:46 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1F7F3C8DA for ; Wed, 12 Oct 2022 18:28:44 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MnsHV54mNzlXfL; Thu, 13 Oct 2022 09:24:06 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 13 Oct 2022 09:28:42 +0800 Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 13 Oct 2022 09:28:42 +0800 Subject: Re: [PATCH v2 1/2] ARM: Fix some check warnings of tool sparse From: "Leizhen (ThunderTown)" To: "Russell King (Oracle)" CC: , References: <20221010095346.1957-1-thunder.leizhen@huawei.com> <20221010095346.1957-2-thunder.leizhen@huawei.com> <3c8c29a8-a757-8f9d-23c6-d5790ce01611@huawei.com> Message-ID: <60f181d5-4e1e-f45b-bc94-73ec5eebb4d0@huawei.com> Date: Thu, 13 Oct 2022 09:28:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <3c8c29a8-a757-8f9d-23c6-d5790ce01611@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/10/11 10:13, Leizhen (ThunderTown) wrote: > > > On 2022/10/11 0:05, Russell King (Oracle) wrote: >> On Mon, Oct 10, 2022 at 05:53:45PM +0800, Zhen Lei wrote: >>> Fix the following warnings: >>> warning: incorrect type in initializer (different address spaces) >>> expected unsigned short [noderef] __user *register __p >>> got unsigned short [usertype] * >>> warning: cast removes address space '__user' of expression >> >> I have a general principle that not all warnings should be fixed, >> especially when it comes to sparse. > > OK, I got it. > >> >> The aim is not to get to zero warnings - it's to get to a point where >> the code is correct, and plastering the code with __force casts means >> it isn't correct - you're just masking the warning. >> >> So no, I really don't like this. And I really don't like seeing >> __force being used in open code in casts. > > OK, I will clear only the first warning and leave the second warning. Sorry, Maybe I misunderstood. '__force casts' mentioned here may include not only '(__force u16 *)', but also '(u16 __user *)'. > >> > -- Regards, Zhen Lei