Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1073990ybp; Fri, 11 Oct 2019 08:36:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyF9VU/p21ujnkqoZe+R5ZbaVcdlMb+y85dZZkJjPhxptPpfZO8r0s+RbocBusXmihOLCCD X-Received: by 2002:a50:e71a:: with SMTP id a26mr14047237edn.265.1570808171874; Fri, 11 Oct 2019 08:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570808171; cv=none; d=google.com; s=arc-20160816; b=xReuhfqgNvVHGC6fW0jq7S+OVOQnPkrGve/eTlVhyJAifS7QQEdnIduvCaubrzKB3J a4AYjSOsl5GLyC6eUSJyGj6/nOxOOS/ykC8lHX+/tHkM4eqCUgPa5pAQky81t0cexEEu uy8H6Kbg8YgHm+CzZRKbzgxz1N146YiwPHGwbP+Y832bxbP1F2/j/5/IU+MMij/g8C0o /A4eoCVYXAgOFJgLfxGgsoBnkZoj2yowmxXi3ZHWN6S67RTNLgp7Iww+H6C7Yjz5QkPo 8u2+4PKzxkIRKUispi3zewIpDpp3FiAdiuB7ptPGN5276bHdKyoi7gl1/63CHTqw1qq8 1Zng== 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=s74FPEPDf0glAKIatkU2qFQSLWrNzs0IMviXYD0/ytk=; b=gCgCvvCAJJ5d9kt3ZQsi5tGLEMkDQlxphz3f76E98g0LLi5YuSwzqqHW9MkQkXVOCh pRPPHUu7C1O0FXFKwnRXaUr1EtX07aT1v/MlHXt5/idwJmobIS2zwGi036u1eu1WFDBl cG7Rj8txPyg9eFVEdPvqkKfT9RE+3FhSzOq+rjV2pxM7frjWY02yJyTZxKG3umMB5dnN 9QMNbmt1louwUPyAITyZOlb4Zwe8vvWq70I2V+cDqF/5zzo7HxE4J9J+7hbGALNrH7KN JF38QLMJcNERve18974wbr5ejltfh3oJuwFu/mR9VTPxI+ZmjQp79qdPdkzdiGYlhC1x uShA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="IIxhbo/m"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id op4si5448943ejb.77.2019.10.11.08.35.47; Fri, 11 Oct 2019 08:36:11 -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=@kernel.org header.s=default header.b="IIxhbo/m"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728250AbfJKPc5 (ORCPT + 99 others); Fri, 11 Oct 2019 11:32:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:55808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726705AbfJKPc5 (ORCPT ); Fri, 11 Oct 2019 11:32:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 54A9F206A1; Fri, 11 Oct 2019 15:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570807975; bh=a5aI9kGd8914ij1xkvqBnSj8mL4+xJaBSyyLL2y1qdo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IIxhbo/m1o0kKegJEDiscNOcWjdlAh2zAfP4a0otj9vJI80QjghL+p9Bv/ovVriia OFJlqvxutMFm+Q1cLz5l07hohok5rYNdIgPaOToeKJPgWiyzJJ+qKL2xOds8QaJcvQ YfgcfHSXtPRAbnrrruxkjyH6y5zHCtDV4iNbB+X8= Date: Fri, 11 Oct 2019 17:32:53 +0200 From: Greg Kroah-Hartman To: Matthias Maennich Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Jessica Yu , Masahiro Yamada , Martijn Coenen , Lucas De Marchi , Shaun Ruffell , Will Deacon , linux-kbuild@vger.kernel.org, linux-modules@vger.kernel.org Subject: Re: [PATCH 1/4] modpost: delegate updating namespaces to separate function Message-ID: <20191011153253.GB1283883@kroah.com> References: <20191010151443.7399-1-maennich@google.com> <20191010151443.7399-2-maennich@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010151443.7399-2-maennich@google.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 10, 2019 at 04:14:40PM +0100, Matthias Maennich wrote: > Let the function 'sym_update_namespace' take care of updating the > namespace for a symbol. While this currently only replaces one single > location where namespaces are updated, in a following patch, this > function will get more call sites. > > The function signature is intentionally close to sym_update_crc and > taking the name by char* seems like unnecessary work as the symbol has > to be looked up again. In a later patch of this series, this concern > will be addressed. > > This function ensures that symbol::namespace is either NULL or has a > valid non-empty value. Previously, the empty string was considered 'no > namespace' as well and this lead to confusion. > > Signed-off-by: Matthias Maennich > --- > scripts/mod/modpost.c | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > index 4d2cdb4d71e3..9f5dcdff4d2f 100644 > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -362,6 +362,22 @@ static char *sym_extract_namespace(const char **symname) > return namespace; > } > > +static void sym_update_namespace(const char *symname, const char *namespace) > +{ > + struct symbol *s = find_symbol(symname); > + /* That symbol should have been created earlier and thus this is > + * actually an assertion. */ Do we care about checkpatch issues in tools? If so, you need a blank line before the comment :) Anyway, not a big deal Reviewed-by: Greg Kroah-Hartman