From: kbuild test robot <lkp@intel.com>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: kbuild-all@01.org, Jens Axboe <axboe@kernel.dk>,
Cai Zhiyong <caizhiyong@huawei.com>,
linux-kernel@vger.kernel.org,
Shawn Lin <shawn.lin@rock-chips.com>
Subject: Re: [PATCH] block: cmdline-parser: add support for hidden disk space
Date: Mon, 28 Sep 2015 17:36:37 +0800 [thread overview]
Message-ID: <201509281712.lOytHg8u%fengguang.wu@intel.com> (raw)
In-Reply-To: <1443432468-24265-1-git-send-email-shawn.lin@rock-chips.com>
[-- Attachment #1: Type: text/plain, Size: 5984 bytes --]
Hi Shawn,
[auto build test results on v4.3-rc3 -- if it's inappropriate base, please ignore]
config: x86_64-randconfig-x005-201539 (attached as .config)
reproduce:
git checkout 937e3ebb4c7763e6120eda4a7e5b8c96bd710a9f
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/uapi/linux/capability.h:16,
from include/linux/capability.h:15,
from include/linux/sched.h:15,
from include/linux/blkdev.h:4,
from include/linux/cmdline-parser.h:10,
from block/cmdline-parser.c:8:
block/cmdline-parser.c: In function 'parse_parts':
block/cmdline-parser.c:136:9: error: 'subpart' undeclared (first use in this function)
if (!(subpart->flags & PF_HIDDEN))
^
include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> block/cmdline-parser.c:136:3: note: in expansion of macro 'if'
if (!(subpart->flags & PF_HIDDEN))
^
block/cmdline-parser.c:136:9: note: each undeclared identifier is reported only once for each function it appears in
if (!(subpart->flags & PF_HIDDEN))
^
include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> block/cmdline-parser.c:136:3: note: in expansion of macro 'if'
if (!(subpart->flags & PF_HIDDEN))
^
vim +/if +136 block/cmdline-parser.c
2 * Parse command line, get partition information
3 *
4 * Written by Cai Zhiyong <caizhiyong@huawei.com>
5 *
6 */
7 #include <linux/export.h>
> 8 #include <linux/cmdline-parser.h>
9
10 static int parse_subpart(struct cmdline_subpart **subpart, char *partdef)
11 {
12 int ret = 0;
13 struct cmdline_subpart *new_subpart;
14
15 *subpart = NULL;
16
17 new_subpart = kzalloc(sizeof(struct cmdline_subpart), GFP_KERNEL);
18 if (!new_subpart)
19 return -ENOMEM;
20
21 if (*partdef == '-') {
22 new_subpart->size = (sector_t)(~0ULL);
23 partdef++;
24 } else {
25 new_subpart->size = (sector_t)memparse(partdef, &partdef);
26 if (new_subpart->size < (sector_t)PAGE_SIZE) {
27 pr_warn("cmdline partition size is invalid.");
28 ret = -EINVAL;
29 goto fail;
30 }
31 }
32
33 if (*partdef == '@') {
34 partdef++;
35 new_subpart->from = (sector_t)memparse(partdef, &partdef);
36 } else {
37 new_subpart->from = (sector_t)(~0ULL);
38 }
39
40 if (*partdef == '(') {
41 int length;
42 char *next = strchr(++partdef, ')');
43
44 if (!next) {
45 pr_warn("cmdline partition format is invalid.");
46 ret = -EINVAL;
47 goto fail;
48 }
49
50 length = min_t(int, next - partdef,
51 sizeof(new_subpart->name) - 1);
52 strncpy(new_subpart->name, partdef, length);
53 new_subpart->name[length] = '\0';
54
55 partdef = ++next;
56 } else
57 new_subpart->name[0] = '\0';
58
59 new_subpart->flags = 0;
60
61 if (!strncmp(partdef, "ro", 2)) {
62 new_subpart->flags |= PF_RDONLY;
63 partdef += 2;
64 }
65
66 if (!strncmp(partdef, "lk", 2)) {
67 new_subpart->flags |= PF_POWERUP_LOCK;
68 partdef += 2;
69 }
70
71 if (!strncmp(partdef, "hidden", 6)) {
72 new_subpart->flags |= PF_HIDDEN;
73 partdef += 6;
74 }
75
76 *subpart = new_subpart;
77 return 0;
78 fail:
79 kfree(new_subpart);
80 return ret;
81 }
82
83 static void free_subpart(struct cmdline_parts *parts)
84 {
85 struct cmdline_subpart *subpart;
86
87 while (parts->subpart) {
88 subpart = parts->subpart;
89 parts->subpart = subpart->next_subpart;
90 kfree(subpart);
91 }
92 }
93
94 static int parse_parts(struct cmdline_parts **parts, const char *bdevdef)
95 {
96 int ret = -EINVAL;
97 char *next;
98 int length;
99 struct cmdline_subpart **next_subpart;
100 struct cmdline_parts *newparts;
101 char buf[BDEVNAME_SIZE + 32 + 4];
102
103 *parts = NULL;
104
105 newparts = kzalloc(sizeof(struct cmdline_parts), GFP_KERNEL);
106 if (!newparts)
107 return -ENOMEM;
108
109 next = strchr(bdevdef, ':');
110 if (!next) {
111 pr_warn("cmdline partition has no block device.");
112 goto fail;
113 }
114
115 length = min_t(int, next - bdevdef, sizeof(newparts->name) - 1);
116 strncpy(newparts->name, bdevdef, length);
117 newparts->name[length] = '\0';
118 newparts->nr_subparts = 0;
119
120 next_subpart = &newparts->subpart;
121
122 while (next && *(++next)) {
123 bdevdef = next;
124 next = strchr(bdevdef, ',');
125
126 length = (!next) ? (sizeof(buf) - 1) :
127 min_t(int, next - bdevdef, sizeof(buf) - 1);
128
129 strncpy(buf, bdevdef, length);
130 buf[length] = '\0';
131
132 ret = parse_subpart(next_subpart, buf);
133 if (ret)
134 goto fail;
135
> 136 if (!(subpart->flags & PF_HIDDEN))
137 newparts->nr_subparts++;
138
139 next_subpart = &(*next_subpart)->next_subpart;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 23719 bytes --]
next prev parent reply other threads:[~2015-09-28 9:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 9:27 Shawn Lin
2015-09-28 9:36 ` kbuild test robot [this message]
2015-09-28 9:38 ` kbuild test robot
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=201509281712.lOytHg8u%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=caizhiyong@huawei.com \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shawn.lin@rock-chips.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
all inboxes | Powered by JetHome®