From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2A87C433FE for ; Fri, 11 Feb 2022 04:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243255AbiBKE2W (ORCPT ); Thu, 10 Feb 2022 23:28:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbiBKE2S (ORCPT ); Thu, 10 Feb 2022 23:28:18 -0500 Received: from conssluserg-01.nifty.com (conssluserg-01.nifty.com [210.131.2.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 959642655; Thu, 10 Feb 2022 20:28:17 -0800 (PST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 21B4RiCx007739; Fri, 11 Feb 2022 13:27:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 21B4RiCx007739 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1644553664; bh=RlpxWh2Mu1l8iL7mBcRuNEMC5R3LGI3pTx/23psC1Mc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=b499rrOFKuO5a8Iaz2kyPibcaoGaOvRrMeKIMj4KqjqktHMyHRl19kQzCbcAfdDk2 cCk2JTh0K6LbABqrN8pw0t/OZ6mQvk6huipJSWfb/3YwQy+zZ6PtrrFDQC8xaB2z4b VaqmBxq90NjGA8iAc0r+BCXBSdt8SYiT91MKjf2p5dAVJZL4S0Nx7LT6c2aMfZwG0E hmSPwyQxFgKJcQWqZNI5fmWB3ru87mLgjp8EhbSR7OwEaj4iqRKfqDUmX94quNIv0V h3hsAndEM7W9xWr/yxgeX9UiT6wzVqIN7vuKxw1kTOlFMemaM18tchEg7tVZFhXxF0 8RoubFfB/GLAQ== X-Nifty-SrcIP: [209.85.214.169] Received: by mail-pl1-f169.google.com with SMTP id w1so3690649plb.6; Thu, 10 Feb 2022 20:27:44 -0800 (PST) X-Gm-Message-State: AOAM533vC3sL111IibCTVlfG+GSc+fiYAVAUNAIuXF6pZqXgrY7UYcAQ R/49l2+ghVI1CgWL5Z/QLOh5d9au0zADctBrMG4= X-Google-Smtp-Source: ABdhPJzRF/OHWiPVKjd5NDzPVATAyiKpTGDXouwzX7kNnv7ghxNgM/Nf/zSA71ifM6Lq8b25FRTmEypz28n1O/aBvCw= X-Received: by 2002:a17:902:6948:: with SMTP id k8mr10720087plt.136.1644553663556; Thu, 10 Feb 2022 20:27:43 -0800 (PST) MIME-Version: 1.0 References: <20220210062953.21285-1-3090101217@zju.edu.cn> In-Reply-To: <20220210062953.21285-1-3090101217@zju.edu.cn> From: Masahiro Yamada Date: Fri, 11 Feb 2022 13:27:07 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kconfig: fix failing to generate auto.conf To: 3090101217@zju.edu.cn Cc: Linux Kbuild mailing list , Linux Kernel Mailing List , Jing Leng Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 10, 2022 at 3:40 PM <3090101217@zju.edu.cn> wrote: > > From: Jing Leng > > When the KCONFIG_AUTOCONFIG is specified (e.g. export \ > KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of > include/config/ will not be created, so kconfig can't create deps > files in it and auto.conf can't be generated. > > Signed-off-by: Jing Leng > --- > scripts/kconfig/confdata.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c > index 59717be31210..800ecf9934bc 100644 > --- a/scripts/kconfig/confdata.c > +++ b/scripts/kconfig/confdata.c > @@ -994,14 +994,15 @@ static int conf_write_autoconf_cmd(const char *autoconf_name) > > static int conf_touch_deps(void) > { > - const char *name; > + const char *name, *tmp; > struct symbol *sym; > int res, i; > > - strcpy(depfile_path, "include/config/"); > - depfile_prefix_len = strlen(depfile_path); > - > name = conf_get_autoconfig_name(); > + depfile_prefix_len = ((tmp = strrchr(name, '/'))) ? (tmp - name) + 1 : 0; > + strncpy(depfile_path, name, depfile_prefix_len); > + depfile_path[depfile_prefix_len] = 0; > + > conf_read_simple(name, S_DEF_AUTO); > sym_calc_value(modules_sym); > > -- > 2.17.1 > Thanks. I wanted to pick up this patch, but could not find it in the patchwork (https://patchwork.kernel.org/project/linux-kbuild/list/) despite you apparently CC'ed the kbuild ML. Do you know why? (I do not know if the kbuild/kernel ML requires subscription...) If you have a chance for re-submission, can you change the code like follows? depfile_prefix_len = ((tmp = strrchr(name, '/'))) ? (tmp - name) + 1 : 0; tmp = tmp = strrchr(name, '/'); depfile_prefix_len = tmp ? tmp - name + 1 : 0; Too many parentheses make the code unreadable. -- Best Regards Masahiro Yamada