1
0
Fork 0
alistair23-linux/drivers/isdn/mISDN
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 treewide: Fix typo in Kconfig 2013-12-02 14:54:57 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
clock.c isdn: Use ktime_t instead of 'struct timeval' 2016-03-20 16:47:13 -04:00
core.c ISDN: convert class code to use dev_groups 2013-07-26 18:05:17 -07:00
core.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
dsp.h mISDN: Convert timers to use timer_setup() 2017-10-18 12:39:39 +01:00
dsp_audio.c isdn: Remove reverse_bits(), use revbit8() 2015-08-10 14:29:04 -07:00
dsp_biquad.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
dsp_blowfish.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
dsp_cmx.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
dsp_core.c mISDN: Convert timers to use timer_setup() 2017-10-18 12:39:39 +01:00
dsp_dtmf.c mISDN: Fix division by zero 2012-04-26 03:10:45 -04:00
dsp_ecdis.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
dsp_hwec.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
dsp_hwec.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dsp_pipeline.c mISDN: use kstrdup() in dsp_pipeline_build 2015-10-13 18:29:50 -07:00
dsp_tones.c mISDN: Convert timers to use timer_setup() 2017-10-18 12:39:39 +01:00
fsm.c mISDN: Convert timers to use timer_setup() 2017-10-18 12:39:39 +01:00
fsm.h mISDN: Fix null pointer dereference at mISDN_FsmNew 2017-08-11 14:56:23 -07:00
hwchannel.c Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
l1oip.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
l1oip_codec.c mISDN: Deletion of unnecessary checks before the function call "vfree" 2014-11-21 12:17:53 -05:00
l1oip_core.c mISDN: switch to sock_recvmsg() 2017-12-02 20:38:07 -05:00
layer1.c mISDN: Fix null pointer dereference at mISDN_FsmNew 2017-08-11 14:56:23 -07:00
layer1.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
layer2.c mISDN: Fix null pointer dereference at mISDN_FsmNew 2017-08-11 14:56:23 -07:00
layer2.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
socket.c net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
stack.c mISDN: Fix a sleep-in-atomic bug 2017-06-01 14:49:47 -04:00
tei.c mISDN: Fix null pointer dereference at mISDN_FsmNew 2017-08-11 14:56:23 -07:00
timerdev.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00