xref: /linux/tools/net/sunrpc/xdrgen/templates/C/program/decoder/result.j2 (revision 6382f4e4e7bd65b829d1d598b1315e905accc15c)
1{# SPDX-License-Identifier: GPL-2.0 #}
2
3{% if annotate %}
4/* Decode {{ result }} results */
5{% endif %}
6static int {{ program }}_xdr_dec_{{ result }}(struct rpc_rqst *req,
7		struct xdr_stream *xdr, void *data)
8{
9{% if result == 'void' %}
10	xdrgen_decode_void(xdr);
11{% else %}
12	struct {{ result }} *result = data;
13
14	if (!xdrgen_decode_{{ result }}(xdr, result))
15		return -EIO;
16{% endif %}
17	return 0;
18}
19