Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp266986ybt; Fri, 19 Jun 2020 01:12:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/FFwYCXdUkj2s7+6yqB1qqZOFKuojMyaO6e03dpRN7R51LfGUBhyyAjdghBGQtXJUevaM X-Received: by 2002:aa7:c245:: with SMTP id y5mr2103417edo.189.1592554363749; Fri, 19 Jun 2020 01:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592554363; cv=none; d=google.com; s=arc-20160816; b=crAmw5R0gw429/0K5Rw4Fd8NE7yi8mF64IY/4eR6E9mrwb4yjNdZsAWABw23DzLKsU UpcliLj6EquGPTuD1TRx+2Z8col9vew1hZwBy8OEC8kfVPnuJYM4z738erwR1vRBRARE gEdwsa14RxXrbjIONX5L0f8c4NcWCz7gOOHgBlKpqvEl+GOziq+ced3P69B0KpYWye6V XoDwj92qsOUrnhMjW3xek++BFw/y/4e/NmAL+IqIFC5eB8F7x+04Zx/UPWSkvAkw/w01 oYh5hTMdYW2eSocW4w3DOC85fj81k5ilxDbz+F7fhqVO4krVcMiAWOKUWgKycpjOk4BV QTnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=A9QLwr/gThP6fd0GJQ39gaT5PlOnHllX1baIFXtwLyU=; b=feGVYd14Xubn4wnJrs+jSfSmcV4H9gVu3HOC4jngWMaiS2Hqsc1Zrfcx7Xe33lR6ou cZKpym1t5zwaKeB/NWfvCWG+6gEYSOxLy4K3vl7BN8ngiuh0kiaQHodGIFcOeBYlIUYZ WerEPXJTEEQoQT43aFKm2mGShaz/RxjPTJYZrVizT4pt78bXejHzveWIzvCMk7X5jBj+ zvyiUo8Lbl1p4vhiZu292Mhg+OiNEWnXvF5+aIXbEYtF5JH23SokBTOhIygjZFnDcMLv jiR06WuCfrXrD1eFBM0sIq//WeyclvrQwKKyAL0TN8qF1aKJgBqT6KDo7SFWB/9MsjHb Lblg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si3281118ejo.692.2020.06.19.01.12.21; Fri, 19 Jun 2020 01:12:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731181AbgFSIH5 (ORCPT + 99 others); Fri, 19 Jun 2020 04:07:57 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:37232 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731048AbgFSIHq (ORCPT ); Fri, 19 Jun 2020 04:07:46 -0400 Received: by mail-oi1-f195.google.com with SMTP id a3so7741090oid.4 for ; Fri, 19 Jun 2020 01:07:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A9QLwr/gThP6fd0GJQ39gaT5PlOnHllX1baIFXtwLyU=; b=ARwyL1u8b2INHIDkSNiyNO7IL7f668sXq1o1B8yL/9hVYPTljgkE9/Mc3btaOqD2VY zLSCrfXcxNWuUEnaUMWFkRmqmAplsGr1Twq1pMlvTeGh5o9NyzrbKYU048Jx/IiBeBv4 hi76s81dJkTT/2GsyP7zK5Pu3vvZ/NWm+eypdwUu344C66eyEtcY8/KVZo/2m/MmkhZ6 ruwBm2/fF7QY8taUHSuxmWwfxdOgaAoEUjGQLbFAXuYRSrYlfaI9kDA74QIS5Y36dT7P iHGz9zAtEvGQkKzAbOZLaQ1IUa+W7+gGJaJcoVRzw/5cvvP93DNH2K582ElR3EBo3fT1 oHJQ== X-Gm-Message-State: AOAM532EUbUnYhY8inZCNFwE5pWWOF8ig4wdSqcP0iuSIvLu88SDm5r1 T4G6HiAZAbIeUfbZJfqSgJsQAHqHuB5xe6oWDE0= X-Received: by 2002:a54:4006:: with SMTP id x6mr2087593oie.148.1592554065970; Fri, 19 Jun 2020 01:07:45 -0700 (PDT) MIME-Version: 1.0 References: <20200617220226.88948-1-luc.vanoostenryck@gmail.com> <20200618050249.lqwznznltm3lcykr@ltop.local> In-Reply-To: <20200618050249.lqwznznltm3lcykr@ltop.local> From: Geert Uytterhoeven Date: Fri, 19 Jun 2020 10:07:34 +0200 Message-ID: Subject: Re: [PATCH] sparse: use identifiers to define address spaces To: Luc Van Oostenryck Cc: Miguel Ojeda , Linus Torvalds , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Luc, On Thu, Jun 18, 2020 at 7:05 AM Luc Van Oostenryck wrote: > On Thu, Jun 18, 2020 at 03:22:15AM +0200, Miguel Ojeda wrote: > > On Thu, Jun 18, 2020 at 12:02 AM Luc Van Oostenryck > > wrote: > > > > > > diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h > > > index 21aed0981edf..e368384445b6 100644 > > > --- a/include/linux/compiler_types.h > > > +++ b/include/linux/compiler_types.h > > > @@ -5,20 +5,20 @@ > > > #ifndef __ASSEMBLY__ > > > > > > #ifdef __CHECKER__ > > > -# define __user __attribute__((noderef, address_space(1))) > > > # define __kernel __attribute__((address_space(0))) > > > +# define __user __attribute__((noderef, address_space(__user))) > > > > I guess `__kernel` moves to the first place since it uses the first > > address space? > > No, there is no really an order between address spaces. Even before > this patch, the number were only used as an ID to distinguish them > from each other. > > I just moved __kernel above because it is quite different from > the others because it's the default one, and so: > * it's never displayed > * it's normally not needed, nor in type annotations, nor in cast > between address spaces. The only time it's needed is when it's > combined with a typeof to express "the same type as this one but > without the address space" > * it can't be defined with a name, '0' must be used. > > So, it seemed strange to me to have it in the middle of the other ones. Indeed. It looks like this whole list is completely unsorted, and was created by appending new definitions at the bottom. So perhaps all the address_space ones should be grouped together? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds