mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
fs/ntfs3: Refactor enum_rstbl to suppress static checker
Comments and brief description of function enum_rstbl added.
Fixes: b46acd6a6a
("fs/ntfs3: Add NTFS journal")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
62fea783f9
commit
56c16d5459
@ -609,14 +609,29 @@ static inline void add_client(struct CLIENT_REC *ca, u16 index, __le16 *head)
|
|||||||
*head = cpu_to_le16(index);
|
*head = cpu_to_le16(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enumerate restart table.
|
||||||
|
*
|
||||||
|
* @t - table to enumerate.
|
||||||
|
* @c - current enumerated element.
|
||||||
|
*
|
||||||
|
* enumeration starts with @c == NULL
|
||||||
|
* returns next element or NULL
|
||||||
|
*/
|
||||||
static inline void *enum_rstbl(struct RESTART_TABLE *t, void *c)
|
static inline void *enum_rstbl(struct RESTART_TABLE *t, void *c)
|
||||||
{
|
{
|
||||||
__le32 *e;
|
__le32 *e;
|
||||||
u32 bprt;
|
u32 bprt;
|
||||||
u16 rsize = t ? le16_to_cpu(t->size) : 0;
|
u16 rsize;
|
||||||
|
|
||||||
|
if (!t)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
rsize = le16_to_cpu(t->size);
|
||||||
|
|
||||||
if (!c) {
|
if (!c) {
|
||||||
if (!t || !t->total)
|
/* start enumeration. */
|
||||||
|
if (!t->total)
|
||||||
return NULL;
|
return NULL;
|
||||||
e = Add2Ptr(t, sizeof(struct RESTART_TABLE));
|
e = Add2Ptr(t, sizeof(struct RESTART_TABLE));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user