Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1772245rwi; Thu, 13 Oct 2022 20:00:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4lOmcb6+U5pEzKx86qbRuyghVWn4nC3qEUlgwpZFQ60GvlPClZayXo2PKa7dxnXB7D9SgL X-Received: by 2002:a05:6402:5252:b0:45d:d1a:fe7d with SMTP id t18-20020a056402525200b0045d0d1afe7dmr2267763edd.323.1665716404642; Thu, 13 Oct 2022 20:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665716404; cv=none; d=google.com; s=arc-20160816; b=iBtkKUkoCngcEBfKfwEJciMY8rwup8SWNGyb0pAzX3b+rStRNlSGw/h5Y/D3AGJXVI wfF8GNKSnYla0OLMn6fekLJoe5YzY1wdye7HaFuhcXX/jJ5Xlq2hl711Xe6NIk7OkLH4 BwO83Z7K9EAL8FAcwaBKt+qVkpY/SuxvWVIk0/7umjPyioexyxK9hnMxDYUZ+gUDNttJ pVZ0QbJe+dWkanL85Am3+UxmC3hhc/w/HwySeFFyDDNL+sJ1K3jvIbyNv8Jxv7Pq3Dm1 K5KGLtCL1Uc3/ZmUBNh70nUdgy/duGzkuS5QyNX7m7AlVJLYRg7iDO+aW5ebPnC/qljg JLzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=W1NSoSq/ui76ohrJabsXNOWYo7p+amE9Ojaf1PB+jb0=; b=CtrjkZSnEl1eYFj0oAIrk8T5+QBr1RwMWv4J2lbMpzzRRwjxRH2P8QZqqpnxIjjMpx F70SlAxQXVNUc+M1WbYR8gqQzBrS3F+2U3ZUyuErqNmv8fUFEW0DCVfU9GGtMh7AJ8eJ ORFdXciv/yTl84Hb5nWL454GyavcIQQaXoyVl4UXa+ng9cUrd+azo4V/argXcf7rHDSu aMiSX075n9almlqXATR/Q3453CvFG2zs5S1sq4Ho61KiQr5c9kNPejGBRuJ1SAciSA6u vG8p9Qu7EsRm81WCbQIRW31ZL5M/SOL5570V+OfveFMdXR276sfb/ifaR4g4KXrwaCXE 2cAg== 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 gn22-20020a1709070d1600b007429f0c69ccsi1569991ejc.579.2022.10.13.19.59.40; Thu, 13 Oct 2022 20:00:04 -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 S229660AbiJNCAv (ORCPT + 99 others); Thu, 13 Oct 2022 22:00:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiJNCAq (ORCPT ); Thu, 13 Oct 2022 22:00:46 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 634337CE2A for ; Thu, 13 Oct 2022 19:00:45 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MpTxy5jV0zmVF0; Fri, 14 Oct 2022 09:56:06 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 10:00:43 +0800 Received: from thunder-town.china.huawei.com (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; Fri, 14 Oct 2022 10:00:43 +0800 From: Zhen Lei To: Russell King , Ard Biesheuvel , , CC: Zhen Lei Subject: [PATCH v3 1/3] ARM: Fix some check warnings of tool sparse Date: Fri, 14 Oct 2022 09:59:54 +0800 Message-ID: <20221014015956.2006-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.37.3.windows.1 In-Reply-To: <20221014015956.2006-1-thunder.leizhen@huawei.com> References: <20221014015956.2006-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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 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 Signed-off-by: Zhen Lei --- arch/arm/kernel/traps.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 20b2db6dcd1ced7..d455c97237e2079 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -188,9 +188,9 @@ static void dump_instr(const char *lvl, struct pt_regs *regs) } } else { if (thumb) - bad = get_user(val, &((u16 *)addr)[i]); + bad = get_user(val, &((u16 __user *)addr)[i]); else - bad = get_user(val, &((u32 *)addr)[i]); + bad = get_user(val, &((u32 __user *)addr)[i]); } if (!bad) @@ -448,9 +448,9 @@ int call_undef_hook(struct pt_regs *regs, unsigned int instr) asmlinkage void do_undefinstr(struct pt_regs *regs) { unsigned int instr; - void __user *pc; + void *pc; - pc = (void __user *)instruction_pointer(regs); + pc = (void *)instruction_pointer(regs); if (processor_mode(regs) == SVC_MODE) { #ifdef CONFIG_THUMB2_KERNEL @@ -494,7 +494,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs) } #endif arm_notify_die("Oops - undefined instruction", regs, - SIGILL, ILL_ILLOPC, pc, 0, 6); + SIGILL, ILL_ILLOPC, (void __user *)pc, 0, 6); } NOKPROBE_SYMBOL(do_undefinstr) -- 2.25.1