From: Ahmad Fatoum Date: Sat, 8 Jul 2017 19:28:44 +0000 (+0200) Subject: net: Fix minor code bug in timestamping.txt X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5e34fa23ced16f03fe163d3f31fddcae91c3f2fc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: Fix minor code bug in timestamping.txt Passing (void*)val instead of &val would make a pointer out of an integer and cause sock_setsockopt to -EFAULT. See tools/testing/selftests/networking/timestamping/timestamping.c for a working example. Cc: David S. Miller Cc: netdev@vger.kernel.org Signed-off-by: Ahmad Fatoum Signed-off-by: David S. Miller --- diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt index 196ba17cc344..1be0b6f9e0cb 100644 --- a/Documentation/networking/timestamping.txt +++ b/Documentation/networking/timestamping.txt @@ -44,8 +44,7 @@ timeval of SO_TIMESTAMP (ms). Supports multiple types of timestamp requests. As a result, this socket option takes a bitmap of flags, not a boolean. In - err = setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, (void *) val, - sizeof(val)); + err = setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, &val, sizeof(val)); val is an integer with any of the following bits set. Setting other bit returns EINVAL and does not change the current state. @@ -249,8 +248,7 @@ setsockopt to receive timestamps: __u32 val = SOF_TIMESTAMPING_SOFTWARE | SOF_TIMESTAMPING_OPT_ID /* or any other flag */; - err = setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, (void *) val, - sizeof(val)); + err = setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, &val, sizeof(val)); 1.4 Bytestream Timestamps