Skip to content

Commit 6d0aed7

Browse files
author
Jens Axboe
committed
do_mounts: only enable PARTUUID for CONFIG_BLOCK
When CONFIG_BLOCK is not enabled: init/do_mounts.c:71: error: implicit declaration of function 'dev_to_part' init/do_mounts.c:71: warning: initialization makes pointer from integer without a cast init/do_mounts.c:73: error: dereferencing pointer to incomplete type init/do_mounts.c:76: error: dereferencing pointer to incomplete type init/do_mounts.c:76: error: dereferencing pointer to incomplete type init/do_mounts.c:102: error: implicit declaration of function 'part_pack_uuid' init/do_mounts.c:104: error: 'block_class' undeclared (first use in this function) Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 01ea506 commit 6d0aed7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

init/do_mounts.c

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ static int __init readwrite(char *str)
5858
__setup("ro", readonly);
5959
__setup("rw", readwrite);
6060

61+
#ifdef CONFIG_BLOCK
6162
/**
6263
* match_dev_by_uuid - callback for finding a partition using its uuid
6364
* @dev: device passed in by the caller
@@ -111,6 +112,7 @@ static dev_t __init devt_from_partuuid(char *uuid_str)
111112
done:
112113
return res;
113114
}
115+
#endif
114116

115117
/*
116118
* Convert a name into device number. We accept the following variants:
@@ -138,6 +140,7 @@ dev_t name_to_dev_t(char *name)
138140
dev_t res = 0;
139141
int part;
140142

143+
#ifdef CONFIG_BLOCK
141144
if (strncmp(name, "PARTUUID=", 9) == 0) {
142145
name += 9;
143146
if (strlen(name) != 36)
@@ -147,6 +150,7 @@ dev_t name_to_dev_t(char *name)
147150
goto fail;
148151
goto done;
149152
}
153+
#endif
150154

151155
if (strncmp(name, "/dev/", 5) != 0) {
152156
unsigned maj, min;

0 commit comments

Comments
 (0)