Re: [RFC] next cycle fun: ->release() API change

From: Al Viro
Date: Sun May 12 2013 - 17:47:27 EST


On Sun, May 12, 2013 at 01:06:16AM +0100, Al Viro wrote:
> media_file_operations
> v4l2_file_operations
> snd_hwdep_ops
> sound_info_entry_ops
> proto_ops
> auth_ops

> BTW, a lot of those guys are returning void, but there are some that return
> int and I think we ought to review those as well. And that's probably
> worth doing *before* we start merging file_operations ->release() change,
> whether it's just int->void variant or anything more ambitious.

Having looked through some of those:
* cftype->release() is non-NULL only in two instances *and* the
only caller of that method is never called for those instances. WTF does
it exist, in the first place? NB: the set of cftype methods is unspeakably
ugly; check it and puke.
* hsi_port->release(): AFAICS, return value is ignored by the sole
caller. No non-trivial instances in the tree (again, AFAICS) - the only one
is "do nothing and return 0".
* loop_func_table->release(): return value is ignored by most of that
callers; the only in-tree instance returns non-zero only if it sees an obvious
result of memory corruption.
* posix_clock_operations->release(): NULL in the only in-tree instance
of struct posix_clock_operations. The only caller is posix_clock_release()
and return value is passed to its caller, which drops it on the floor.
* uio_info->release(): AFAICS, there are only 3 instances in the
tree. All are always returning 0; incidentally, none of them ever looks
at the second argument of that method (it's int (*release)(struct uio_info *,
struct inode *)). The only caller is uio_release(), which passes the
return value to its caller, which drops it on the floor.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/