| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* the variable definition with hidden type is always horrible, for
example:
int func() {
LIST_HEAD(foo);
...
}
the more readable is:
int func() {
struct list_head foo;
INIT_LIST_HEAD(&foo);
...
}
* the name LIST_HEAD conflict with /usr/include/sys/queue.h
* we use it only on two places in sulogin
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change has motivation to make -Wall -pedantic compiler options to
spit a little bit less noise, which with luck will increase change to
notice real issues.
Multiple of these:
warning: ISO C forbids braced-groups within expressions [-Wpedantic]
And nearly 300 times reported:
include/c.h:75:41: warning: struct has no named members [-Wpedantic]
#define UL_BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
We use the code from include/ and lib/ on many places, so use public
domain if possible or LGPL for code copied from libs.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update list_entry() macro, which is basically the same as the
container_of() macro in the kernel, to use offsetof() to fix undefined
behavior.
Caught using clang -fsanitize=undefined.
[kzak@redhat.com: port from e2fsprogs]
Signed-off-by: Sami Liedes <sami.liedes@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
include/list.h:224:17: warning: ISO C forbids omitting the middle term of a ?: expression [-pedantic]
include/list.h:255:19: warning: ISO C forbids omitting the middle term of a ?: expression [-pedantic]
Compilation warned about that at least 110 times.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
| |
For systems with regular mtab the fs->root should be ignored in
"already mounted" heuristic.
Reported-by: Matt Burgess <matthew@linuxfromscratch.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need a list sorting function, just to mention one example user that could
benefit is the lib/tt code to sort columns.
This patch adds list_sort() which uses the Merge Sort algorithm, behaving
nicely in O(nlog(n)), heavily based on the kernel's implementation[1]. The
private data (void *priv) passed to the comparison function as been removed to
adopt a qsort(3)-like syntax, and IMHO we don't really need it anyways.
[1]: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=lib/list_sort.c;h=d7325c6b103f0be078ff3672c35c468ed35738f1;hb=HEAD
[kzak@redhat.com: - use size_t in list_sort()]
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|