Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5752631ybp; Tue, 15 Oct 2019 04:37:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHnr7qd9DBesFcivUJQe94kmPUYWrgXFHJzkPORmbNgjwpAF17LpOQlvr6TdSlt9G7vOuj X-Received: by 2002:aa7:d8c6:: with SMTP id k6mr33171964eds.87.1571139460100; Tue, 15 Oct 2019 04:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571139460; cv=none; d=google.com; s=arc-20160816; b=y+7nzzZDdFfeYMU+7JCy4p8srUf/msZ8YErb9DSw3cDgoTUcjQ4Kww4fLrDshpgxZO DI/CGlce24SiHG2nRPNb7qsqtuqZeMdV/vkfskDJ5JXq+prY+mwwlhenEUvbEO4ZuwH1 lSdFdoG6Vs5X36zHjFqnm/JeRZ5ZEUQzzZyPU5KvIxTIUuF3ecMUnjprhkoXI+a1EdHm LJ/r9Z9vVMf39RryIHuAlqN1zCqFZrSXKKXuZgW4cVhqBZ90NjZSwFSbz0ofAlwJoqrl 1JBGNLNM3DgnFxj7kG+ez5b8BMBu1vytmI0HOepCeRWwWlwEZuyNvoOfwBFhPQmDvqQ0 VwoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1PaVYAUM628D4zLZyM73JJUgK0ePTSTLpO0OytJQgNc=; b=awTkDM8RDnjnDA+PLoWsguIVwKG2ocD2sFVakoLFL+EorcutWfFqvchTq4H4zBE5Hd e8TPZ74T8fbc/FfOL4KsvKwQZz+GJnOI+EWdMcFb6hthM8ht8z12ByyH3scbfZKwlHoX 4Mu04K+Jy5atCFKBHMWAeyeiWAfJOBGzWRJ9ucMVW7ypxn3HFQurIJInODsrSI1xiYk5 XKwlEr0C/S93kHsf2BCK76XewqhQTFNflgxL6Jb7V+1WYlRnQ8zfmRmwLnsCiX9o0t0F QChi/Q5/lJvrbkILwEvLbX8ukihxWogvvYbLPlmItj0HYBLOoA35epePP4mKbjhYhDPj PTEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dv21si13261939ejb.241.2019.10.15.04.37.16; Tue, 15 Oct 2019 04:37:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730596AbfJOK0W (ORCPT + 99 others); Tue, 15 Oct 2019 06:26:22 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:41113 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726508AbfJOK0W (ORCPT ); Tue, 15 Oct 2019 06:26:22 -0400 Received: from [167.98.27.226] (helo=rainbowdash.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1iKK1w-0006RM-62; Tue, 15 Oct 2019 11:26:16 +0100 Received: from ben by rainbowdash.codethink.co.uk with local (Exim 4.92.2) (envelope-from ) id 1iKK1v-0002zJ-OZ; Tue, 15 Oct 2019 11:26:15 +0100 From: Ben Dooks To: linux-kernel@lists.codethink.co.uk Cc: Ben Dooks , Dennis Zhou , Tejun Heo , Christoph Lameter , linux-kernel@vger.kernel.org Subject: [PATCH] percpu: add __percpu to SHIFT_PERCPU_PTR Date: Tue, 15 Oct 2019 11:26:15 +0100 Message-Id: <20191015102615.11430-1-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SHIFT_PERCPU_PTR() returns a pointer used by a number of functions that expect the pointer to be __percpu annotated (sparse address space 3). Adding __percpu to this makes the following sparse warnings go away. Note, this then creates the problem the __percup is marked as noderef, which may need removing for some of the internal functions, or to remove other warnings. mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:385:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:385:13: got signed char * mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:385:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:385:13: got signed char * mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:385:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:385:13: got signed char * mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:385:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:385:13: got signed char * mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:401:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:401:13: got signed char * mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:401:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:401:13: got signed char * mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:401:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:401:13: got signed char * mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:401:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:401:13: got signed char * mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:429:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:429:13: got signed char * mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:429:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:429:13: got signed char * mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:429:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:429:13: got signed char * mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:429:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:429:13: got signed char * mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:445:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:445:13: got signed char * mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:445:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:445:13: got signed char * mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:445:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:445:13: got signed char * mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:445:13: expected signed char [noderef] [usertype] *__p mm/vmstat.c:445:13: got signed char * mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:763:29: expected signed char [noderef] *__p mm/vmstat.c:763:29: got signed char * mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:763:29: expected signed char [noderef] *__p mm/vmstat.c:763:29: got signed char * mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:763:29: expected signed char [noderef] *__p mm/vmstat.c:763:29: got signed char * mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:763:29: expected signed char [noderef] *__p mm/vmstat.c:763:29: got signed char * mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:825:29: expected signed char [noderef] *__p mm/vmstat.c:825:29: got signed char * mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:825:29: expected signed char [noderef] *__p mm/vmstat.c:825:29: got signed char * mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:825:29: expected signed char [noderef] *__p mm/vmstat.c:825:29: got signed char * mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces) mm/vmstat.c:825:29: expected signed char [noderef] *__p mm/vmstat.c:825:29: got signed char * Signed-off-by: Ben Dooks --- Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: linux-kernel@vger.kernel.org --- include/linux/percpu-defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index a6fabd865211..a49b6c702598 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -229,7 +229,7 @@ do { \ * pointer value. The weird cast keeps both GCC and sparse happy. */ #define SHIFT_PERCPU_PTR(__p, __offset) \ - RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)) + RELOC_HIDE((typeof(*(__p)) __kernel __percpu __force *)(__p), (__offset)) #define per_cpu_ptr(ptr, cpu) \ ({ \ -- 2.23.0