Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp304490pxm; Tue, 1 Mar 2022 21:34:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7jcUBiUk6QvSNHEQC/llRFQMsQfh8QAcdGeXiITYoOYlI3sxkDEYqA1WAk8NesjqvqB3D X-Received: by 2002:a05:6402:2747:b0:415:c252:f5e7 with SMTP id z7-20020a056402274700b00415c252f5e7mr272682edd.347.1646199259111; Tue, 01 Mar 2022 21:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646199259; cv=none; d=google.com; s=arc-20160816; b=DwfUPp121+FUEmK9mheWKo20fsKcr7MRTtRG0JrITvw7HzO4b2kAb7UrzTH8jVUUB3 x6dUHthykk44sau3pNhYLmKMUyNFpMcfs9a2GwX3sVNHGXtYDsq8kmHaDVbT7wz6zfMR +POp/0dT9TNJ2zdqV9o6EjJu4LtCt6nSSbvlqi1do9HPmV+oSuOG7pSdJYUmPV/p8ryj 1fn0tSch1ErTvH2cW12X3GYA6VCv4ZiFSYcRzkMAFwffG08uLHDXs3zxBxMm4M8DTDcy EA7pR7uNhSMYal96tquVbH9iCSKheURfNPwocWtpqnWHMo5Qv9La/9wN637+ZcI6NRZP BEJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=UXgN+fRoQVqRNIrBNn/ogTb7gFK//mC1g/cwUUlVilc=; b=HDoFPNY6/cEglxvZ7QNs1go1zwT9iM9udzvPV6R/2Uq4rVxV/K1nj+8qzTABlR5ID7 4NZWj3ZLjgt2Ngoag3T3Ge2mjlV7VxfC+5bfgq2HLSwRLuFOk4LlnK52JuO8BwTEmzAL xl+WPEMg0twvLXeaT1tOV3iTyGiVVGwAbJmOCF2KFT+JpVgWkXoPoSE4XGKC2236PMUi f9qwTb2oh0fxMj3WHSHLUOnqS+ucUfLefdWfXc198Yf7mQaCno4Ne1qVJ0t2BB7SlzyI IX/DmGna2O2SsyKPjA+4MBzw2X/98b4lKlJMMb7GtAPccHH1/Kku1MtwQOwysX7l35yS pJCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fQGe35J3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11-20020a50c90b000000b0040f886f08aasi10442700edh.296.2022.03.01.21.33.57; Tue, 01 Mar 2022 21:34:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fQGe35J3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231358AbiCAQHt (ORCPT + 99 others); Tue, 1 Mar 2022 11:07:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236013AbiCAQHr (ORCPT ); Tue, 1 Mar 2022 11:07:47 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81CA6AC91D; Tue, 1 Mar 2022 08:07:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646150824; x=1677686824; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hRh2SjknJ5JBtOZ2co7ZjEevgpRiwVpG4mTh8FguEAw=; b=fQGe35J3g0L4bk72Cki4tLJi7NlBgU7mzaCBgsVqWM1zUgSTroDcxIX6 6eDfxE/eU/1OG8COO7BOdhrIZUFY5zctpdMFLogit1TwKjlyr2OOdudMk aJS4GiWbfzGfrBEVLM16LENIJjw8nHM8w5NA6WWdimvncHaZ3RjO7HISW kiXLkk/g1HxMZQ2cD4UAjC8cLpjQp4ehIMNS/OdzHFR4NuKQj8qmq1dE+ kKo1UewW1vaxuXt1y1aUqnn8RqPGsbxuwm3TUDWUdyyfn8lDgS4zni0cp I7gKuhUAajhz2JyQrsdtJABi4Ej/NjZMcqK3Bh6trs9xC3e5iKBBk5sJ8 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="253091596" X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="253091596" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 08:06:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="493154440" Received: from lkp-server01.sh.intel.com (HELO 2146afe809fb) ([10.239.97.150]) by orsmga003.jf.intel.com with ESMTP; 01 Mar 2022 08:06:31 -0800 Received: from kbuild by 2146afe809fb with local (Exim 4.92) (envelope-from ) id 1nP51D-0000fi-8J; Tue, 01 Mar 2022 16:06:31 +0000 Date: Wed, 2 Mar 2022 00:06:07 +0800 From: kernel test robot To: Meng Tang , mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, ebiederm@xmission.com, willy@infradead.org Cc: kbuild-all@lists.01.org, nixiaoming@huawei.com, nizhen@uniontech.com, zhanglianjie@uniontech.com, sujiaxun@uniontech.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Meng Tang Subject: Re: [PATCH v2 1/2] fs/proc: optimize exactly register one ctl_table Message-ID: <202203012347.yd56xhtd-lkp@intel.com> References: <20220301115341.30101-1-tangmeng@uniontech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220301115341.30101-1-tangmeng@uniontech.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Meng, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mcgrof/sysctl-next] [also build test WARNING on jack-fs/fsnotify rostedt-trace/for-next linus/master v5.17-rc6 next-20220301] [cannot apply to kees/for-next/pstore] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Meng-Tang/fs-proc-optimize-exactly-register-one-ctl_table/20220301-195515 base: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git sysctl-next config: nds32-allnoconfig (https://download.01.org/0day-ci/archive/20220301/202203012347.yd56xhtd-lkp@intel.com/config) compiler: nds32le-linux-gcc (GCC) 11.2.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/d9e9a410cf46b383390d668770fff70540e27528 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Meng-Tang/fs-proc-optimize-exactly-register-one-ctl_table/20220301-195515 git checkout d9e9a410cf46b383390d668770fff70540e27528 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nds32 SHELL=/bin/bash fs/proc/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): fs/proc/proc_sysctl.c: In function 'new_links_single': >> fs/proc/proc_sysctl.c:1281:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 1281 | int len = strlen(table->procname) + 1; | ^~~ fs/proc/proc_sysctl.c: At top level: >> fs/proc/proc_sysctl.c:1638:26: warning: no previous prototype for '__register_sysctl_table_single' [-Wmissing-prototypes] 1638 | struct ctl_table_header *__register_sysctl_table_single( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/proc/proc_sysctl.c: In function 'put_links_single': fs/proc/proc_sysctl.c:1988:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 1988 | struct ctl_table_header *link_head; | ^~~~~~ vim +1281 fs/proc/proc_sysctl.c 1256 1257 static struct ctl_table_header *new_links_single(struct ctl_dir *dir, struct ctl_table *table, 1258 struct ctl_table_root *link_root) 1259 { 1260 struct ctl_table *link_table; 1261 struct ctl_table_header *links; 1262 struct ctl_node *node; 1263 char *link_name; 1264 int name_bytes = 0; 1265 1266 name_bytes += strlen(table->procname) + 1; 1267 1268 links = kzalloc(sizeof(struct ctl_table_header) + 1269 sizeof(struct ctl_node) + 1270 sizeof(struct ctl_table)*2 + 1271 name_bytes, 1272 GFP_KERNEL); 1273 1274 if (!links) 1275 return NULL; 1276 1277 node = (struct ctl_node *)(links + 1); 1278 link_table = (struct ctl_table *)(node + 1); 1279 link_name = (char *)&link_table[2]; 1280 > 1281 int len = strlen(table->procname) + 1; 1282 1283 memcpy(link_name, table->procname, len); 1284 link_table->procname = link_name; 1285 link_table->mode = S_IFLNK|S_IRWXUGO; 1286 link_table->data = link_root; 1287 link_name += len; 1288 1289 init_header_single(links, dir->header.root, dir->header.set, node, link_table); 1290 links->nreg = 1; 1291 1292 return links; 1293 } 1294 static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table *table, 1295 struct ctl_table_root *link_root) 1296 { 1297 struct ctl_table *link_table, *entry, *link; 1298 struct ctl_table_header *links; 1299 struct ctl_node *node; 1300 char *link_name; 1301 int nr_entries, name_bytes; 1302 1303 name_bytes = 0; 1304 nr_entries = 0; 1305 for (entry = table; entry->procname; entry++) { 1306 nr_entries++; 1307 name_bytes += strlen(entry->procname) + 1; 1308 } 1309 1310 links = kzalloc(sizeof(struct ctl_table_header) + 1311 sizeof(struct ctl_node)*nr_entries + 1312 sizeof(struct ctl_table)*(nr_entries + 1) + 1313 name_bytes, 1314 GFP_KERNEL); 1315 1316 if (!links) 1317 return NULL; 1318 1319 node = (struct ctl_node *)(links + 1); 1320 link_table = (struct ctl_table *)(node + nr_entries); 1321 link_name = (char *)&link_table[nr_entries + 1]; 1322 1323 for (link = link_table, entry = table; entry->procname; link++, entry++) { 1324 int len = strlen(entry->procname) + 1; 1325 memcpy(link_name, entry->procname, len); 1326 link->procname = link_name; 1327 link->mode = S_IFLNK|S_IRWXUGO; 1328 link->data = link_root; 1329 link_name += len; 1330 } 1331 init_header(links, dir->header.root, dir->header.set, node, link_table); 1332 links->nreg = nr_entries; 1333 1334 return links; 1335 } 1336 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org