From: kernel test robot <lkp@intel.com>
To: Meng Tang <tangmeng@uniontech.com>,
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 <tangmeng@uniontech.com>
Subject: Re: [PATCH v2 1/2] fs/proc: optimize exactly register one ctl_table
Date: Wed, 2 Mar 2022 00:06:25 +0800 [thread overview]
Message-ID: <202203020000.IeIVyxMv-lkp@intel.com> (raw)
In-Reply-To: <20220301115341.30101-1-tangmeng@uniontech.com>
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: alpha-buildonly-randconfig-r001-20220301 (https://download.01.org/0day-ci/archive/20220302/202203020000.IeIVyxMv-lkp@intel.com/config)
compiler: alpha-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=alpha SHELL=/bin/bash fs/proc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
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
next prev parent reply other threads:[~2022-03-01 16:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 11:53 [PATCH v2 1/2] fs/proc: optimize exactly register one ctl_table Meng Tang
2022-03-01 11:53 ` [PATCH v2 2/2] fs/proc: sysctl: optimize register single " Meng Tang
2022-03-01 16:06 ` [PATCH v2 1/2] fs/proc: optimize exactly register " kernel test robot
2022-03-01 16:06 ` kernel test robot
2022-03-01 16:06 ` kernel test robot [this message]
2022-03-01 17:44 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202203020000.IeIVyxMv-lkp@intel.com \
--to=lkp@intel.com \
--cc=ebiederm@xmission.com \
--cc=kbuild-all@lists.01.org \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=nixiaoming@huawei.com \
--cc=nizhen@uniontech.com \
--cc=sujiaxun@uniontech.com \
--cc=tangmeng@uniontech.com \
--cc=willy@infradead.org \
--cc=yzaikin@google.com \
--cc=zhanglianjie@uniontech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).