linux_old1/drivers/soc/qcom
Denys Vlasenko 9b2c45d479 net: make getname() functions return length rather than use int* parameter
Changes since v1:
Added changes in these files:
    drivers/infiniband/hw/usnic/usnic_transport.c
    drivers/staging/lustre/lnet/lnet/lib-socket.c
    drivers/target/iscsi/iscsi_target_login.c
    drivers/vhost/net.c
    fs/dlm/lowcomms.c
    fs/ocfs2/cluster/tcp.c
    security/tomoyo/network.c

Before:
All these functions either return a negative error indicator,
or store length of sockaddr into "int *socklen" parameter
and return zero on success.

"int *socklen" parameter is awkward. For example, if caller does not
care, it still needs to provide on-stack storage for the value
it does not need.

None of the many FOO_getname() functions of various protocols
ever used old value of *socklen. They always just overwrite it.

This change drops this parameter, and makes all these functions, on success,
return length of sockaddr. It's always >= 0 and can be differentiated
from an error.

Tests in callers are changed from "if (err)" to "if (err < 0)", where needed.

rpc_sockname() lost "int buflen" parameter, since its only use was
to be passed to kernel_getsockname() as &buflen and subsequently
not used in any way.

Userspace API is not changed.

    text    data     bss      dec     hex filename
30108430 2633624  873672 33615726 200ef6e vmlinux.before.o
30108109 2633612  873672 33615393 200ee21 vmlinux.o

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: David S. Miller <davem@davemloft.net>
CC: linux-kernel@vger.kernel.org
CC: netdev@vger.kernel.org
CC: linux-bluetooth@vger.kernel.org
CC: linux-decnet-user@lists.sourceforge.net
CC: linux-wireless@vger.kernel.org
CC: linux-rdma@vger.kernel.org
CC: linux-sctp@vger.kernel.org
CC: linux-nfs@vger.kernel.org
CC: linux-x25@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-12 14:15:04 -05:00
..
Kconfig soc: qcom: Introduce QMI encoder/decoder 2017-12-20 15:38:34 -06:00
Makefile soc: qcom: Introduce QMI helpers 2017-12-20 15:38:34 -06:00
glink_ssr.c soc: qcom: GLINK SSR notifier 2017-08-02 12:43:29 -07:00
mdt_loader.c soc: qcom: mdt_loader: Use request_firmware_into_buf() 2017-08-08 17:41:23 -05:00
qcom_gsbi.c soc: qcom: gsbi: Add support for ADM CRCI muxing 2015-03-11 15:18:39 -05:00
qmi_encdec.c soc: qcom: Introduce QMI encoder/decoder 2017-12-20 15:38:34 -06:00
qmi_interface.c net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
rmtfs_mem.c soc: qcom: rmtfs_mem: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE 2017-12-20 15:38:34 -06:00
smd-rpm.c soc: qcom: smd-rpm: Add msm8996 compatibility 2017-03-28 17:58:08 -07:00
smem.c soc: qcom: smem: Increase the number of hosts 2017-10-11 23:48:27 -05:00
smem_state.c soc: qcom: Update properties for smem state referencing 2016-06-24 22:53:41 -05:00
smp2p.c soc: qcom: smp2p: Use common error handling code in qcom_smp2p_probe() 2018-01-01 00:29:09 -06:00
smsm.c soc: qcom: smsm: fix child-node lookup 2017-12-20 15:38:34 -06:00
spm.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-05-17 16:26:30 -07:00
wcnss_ctrl.c soc: qcom: wcnss_ctrl: add missing MODULE_DEVICE_TABLE() 2017-08-08 14:37:42 -05:00