Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp645059ybl; Thu, 22 Aug 2019 02:38:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8qjeYsz3ih01LlfTb56zGydAubLC7RGfFcmEC+LdtPbAtDXWIOt+Lf5HhMgflHbDZqnAr X-Received: by 2002:a17:902:8488:: with SMTP id c8mr34975366plo.164.1566466737311; Thu, 22 Aug 2019 02:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566466737; cv=none; d=google.com; s=arc-20160816; b=aPTr5VyJ8iALHJ89YDPdF2JlpN+cBgx8QVMX2E6CC4Zus8493/9ixiXpolVllhh/yC 9ddAFWFO7zNKbEeRH39ixmBSdLsIl7CPgDV86DOTbgn6HgZccUfJU0suB+8KhE0u+rLy gjeZkKHKl3NadX1YKJDSC0iALwSzI7qaftU6qj7lvWOf2Lk+RFBuHiYHj2OYYaKCgM6D 0LTrJFQUiWmdmoQPxLLtPOmMw40VPNjYqTBrxOiUv/oLISHc2jarCyJUCdUr9yq8WHFi MPnDB3mQnqQwwbZcfzY52bCf42edXcjg4CnCNRa6y5idoD04at5QF28Xvb3EjZfygdpr ZpTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4b70yh01yux8LseDePSC/DiDISC+4IVFYV73p/rz2+o=; b=gKOWS8kkbYLBuA4TcVu9ohP1YfONJcDqx1qXVLRWJQ6+YNdXj4MLtQEfSzTPnpgbi6 A/ViLWuFExP7YHbx2eA41zYelosPH1Raix7heOjd5PYzQId5s2A6UkLuXnOP5OEqwBLY dpiY4ogSQOIvntvImogXifBaPsljKZ1bBxqM9hIuwhjNtnIL26tEH/dqhSDIvBxFEQpY iQb5mMBSmx9k0YqdRiilZDjF7v2ndQeqCvTWOh6s/XXuzYleIu0Q/IHrVjZ85G9b0pbC KF5+FzVyRwmGOb1hgryPWB/W6NLqbmctOCgVRr6G0xRMjSudORDl+qlz0CH5DpshqMMx jJXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=E8c1BVe7; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si1996514pjn.71.2019.08.22.02.38.42; Thu, 22 Aug 2019 02:38:57 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=E8c1BVe7; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731375AbfHVIcb (ORCPT + 99 others); Thu, 22 Aug 2019 04:32:31 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33986 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727484AbfHVIcb (ORCPT ); Thu, 22 Aug 2019 04:32:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id s18so4572023wrn.1 for ; Thu, 22 Aug 2019 01:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4b70yh01yux8LseDePSC/DiDISC+4IVFYV73p/rz2+o=; b=E8c1BVe7EBu6yhtFK7db335Fb1S6eHZXaT/G0r9s6o7yCfITCEzNdfIuD0wirYp7vb MjBwnsVUgiHDSiSTUkyjG1wIB9iwROJpD58qta21td0tKHQDUmwhpZdduxFB2zp6sebi jvUrA8A2D58nA2kFTgHoHam8Ya25z0Z5isgC5uLEVljRxOWdTmXYFCNu7V4jDwDYcxXO Tn/AhSkcu56p/oJC8gZNa9b0VNYEfc0WGmMiTJsmx6lTnUJ/u4ugOnZ+1Lqv9VyOuAkr NNngborlwcNM9CtXvqO9XoNQpVYvf7o4NuBeerxAGsY42aYL3eOxwqRmbKc320uBtg6u wCNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4b70yh01yux8LseDePSC/DiDISC+4IVFYV73p/rz2+o=; b=WqbzcC4BpPhkW8OIdjhNMBRfcym4WlaabmJ2oWC84EMiZMrMfHHX8XSqp6Fl4WiM8/ UUpcc/gd6mL7pIGfK2OosaOoXmiRNKGougc8xK20Xsh6DRa+F8IN1OVLa4E/oUIyGPyK R967GgklpH3XEkqQ6oUJb8pY0Cb7yBsmTchFuLfwFyZg5SB+EHbKuH5lt8XzRfOJUq0V 0OCvL/CPtLPM2Ef2teFU/k9xptmRDfXF2V1EDzZqpCEfJnNSU3Dj3zS3VbgEYv9BkGiu ZQmqUbh5IDPwsLO/dvHWH/XOY1wRW0fV2BM9zoI6pi/7nicXXqjRHjF3jRL9JOGcb+Rd 1CSA== X-Gm-Message-State: APjAAAV2sXZCCiS1cnf77VNmwQVESMi1x3kT9dwlrB7hqW+gVQKFqAZw DjOAmcOfmY6Fvuv4nsOT7BEuuLTqbUsbAJZO X-Received: by 2002:a5d:4ec6:: with SMTP id s6mr7356600wrv.327.1566462748883; Thu, 22 Aug 2019 01:32:28 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:e8f7:125b:61e9:733d]) by smtp.gmail.com with ESMTPSA id p4sm22917436wrs.6.2019.08.22.01.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2019 01:32:27 -0700 (PDT) Date: Thu, 22 Aug 2019 09:32:23 +0100 From: Matthias Maennich To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, arnd@arndb.de, geert@linux-m68k.org, gregkh@linuxfoundation.org, hpa@zytor.com, jeyu@kernel.org, joel@joelfernandes.org, kstewart@linuxfoundation.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-modules@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, lucas.de.marchi@gmail.com, maco@android.com, maco@google.com, michal.lkml@markovi.net, mingo@redhat.com, oneukum@suse.com, pombredanne@nexb.com, sam@ravnborg.org, sspatil@google.com, stern@rowland.harvard.edu, tglx@linutronix.de, usb-storage@lists.one-eyed-alien.net, x86@kernel.org, yamada.masahiro@socionext.com Subject: Re: [PATCH v3 10/11] RFC: usb-storage: export symbols in USB_STORAGE namespace Message-ID: <20190822083223.GA15709@google.com> References: <20190813121733.52480-1-maennich@google.com> <20190821114955.12788-1-maennich@google.com> <20190821114955.12788-11-maennich@google.com> <20190821231329.GA369@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190821231329.GA369@infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 21, 2019 at 04:13:29PM -0700, Christoph Hellwig wrote: >On Wed, Aug 21, 2019 at 12:49:25PM +0100, Matthias Maennich wrote: >> Modules using these symbols are required to explicitly import the >> namespace. This patch was generated with the following steps and serves >> as a reference to use the symbol namespace feature: >> >> 1) Define DEFAULT_SYMBOL_NAMESPACE in the corresponding Makefile >> 2) make (see warnings during modpost about missing imports) >> 3) make nsdeps >> >> Instead of a DEFAULT_SYMBOL_NAMESPACE definition, the EXPORT_SYMBOL_NS >> variants can be used to explicitly specify the namespace. The advantage >> of the method used here is that newly added symbols are automatically >> exported and existing ones are exported without touching their >> respective EXPORT_SYMBOL macro expansion. > >So what is USB_STORAGE here? It isn't a C string, so where does it >come from? To me using a C string would seem like the nicer interface >vs a random cpp symbol that gets injected somewhere. To be honest, I would also prefer an interface that uses C strings or literals for the new EXPORT_SYMBOLS* macros: EXPORT_SYMBOL_NS(mysym, "USB_STORAGE"); or const char USB_STORAGE_NS[] = "USB_STORAGE"; EXPORT_SYMBOL_NS(mysym, USB_STORAGE_NS); The DEFAULT_SYMBOL_NAMESPACE define within Makefiles would get a bit more verbose in that case to express the literal: ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE="\"USB_STORAGE\"" The main reason against that, is, that in the expansion of EXPORT_SYMBOL_NS, we define the ksymtab entry, which name is constructed partly by the name of the namespace: static const struct kernel_symbol __ksymtab_##sym##__##ns ... ^^^^ For that we depend on a cpp symbol to construct the name. I am not sure there is a reasonable way of getting rid of that without ending up constructing the ksymtab entries completely in asm as it is already done in case of PREL32_RELOCATIONS. But I am happy to be corrected. For reference that is done in patch 03/11 of this series: https://lore.kernel.org/lkml/20190821114955.12788-4-maennich@google.com/ Cheers, Matthias