Re: [PATCH] direct-io: squelch maybe-uninitialized warning in do_direct_IO()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I did a bit of digging on this and I am wondering if the initialization
of "to" and "from" to 0 should instead be done in dio_get_page().

The warning is caused by the return in dio_get_page():

		ret = dio_refill_pages(dio, sdio);
		if (ret)
			return ERR_PTR(ret);

This code path would leave "to" and "from" uninitialized (even though the
caller currently never uses the variables in that case).

If both variables are initialized to 0 in dio_get_page(), it would
guarantee that any future callers of dio_get_page() also get to take
advantage of the initialization. If, however, the variables are only
initialized in do_direct_IO(), other callers would have to take care of
this themselves (or the same warnings will pop up there).

There aren't currently any other callers to dio_get_page(), so the
choice is probably not a terribly critical one right now, but I wanted
to at least point this out.

Regards,
-Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux