Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread O'Connor, Daniel

> On 28 Aug 2015, at 15:34, Alexey Dokuchaev  wrote:
> On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote:
>> On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev  wrote:
>>> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
 New Revision: 287236
 URL: https://svnweb.freebsd.org/changeset/base/287236
 
 Log:
  Use exit() instead of return in main().
>>> 
>>> Because?..
>> 
>> Probably because of libxo...
> 
> I'm just wondering how hard is it to write sensible commit logs. :(

To put it in a hopefully more helpful way..
Please write why your change is doing something, not what it is doing.

Saying what it is doing is OK if it's really hairy, but 99% of the time that 
isn't the case.

Assuming this is a libxo thing the commit log should have been something like..
"Use exit out of main otherwise libxo will not flush properly"
(or something similar)

Although it would be surprising if libxo required you to use exit()..

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread Garrett Cooper

> On Aug 28, 2015, at 00:24, O'Connor, Daniel  wrote:
> 
>> On 28 Aug 2015, at 15:34, Alexey Dokuchaev  wrote:
>>> On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote:
 On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev  
 wrote:
> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
> New Revision: 287236
> URL: https://svnweb.freebsd.org/changeset/base/287236
> 
> Log:
> Use exit() instead of return in main().
 
 Because?..
>>> 
>>> Probably because of libxo...
>> 
>> I'm just wondering how hard is it to write sensible commit logs. :(
> 
> To put it in a hopefully more helpful way..
> Please write why your change is doing something, not what it is doing.
> 
> Saying what it is doing is OK if it's really hairy, but 99% of the time that 
> isn't the case.
> 
> Assuming this is a libxo thing the commit log should have been something 
> like..
> "Use exit out of main otherwise libxo will not flush properly"
> (or something similar)
> 
> Although it would be surprising if libxo required you to use exit()..

Libxo (iirc) doesn't install atexit handlers, which means that you need to use 
exit (or a reason facsimile) in order for it to flush its file streams.

This is unintuitive though. I wish it did the right thing as part of 
initializing the streams..
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread Xin Li


On 8/27/15 21:43, Alexey Dokuchaev wrote:
> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
>> New Revision: 287236
>> URL: https://svnweb.freebsd.org/changeset/base/287236
>>
>> Log:
>>   Use exit() instead of return in main().
> 
> Because?..

Because the explicit exit() have a subtle difference from returning from
main(), and that could confuse static analyzers.  I thought it was
obvious and too much for trivial changes like this.  Let me try again:

C standard defines that when main() returns to the startup code, the
latter is required by the standard to call exit() with main()'s return
value, should main() be defined to return a type compatible with int.
On FreeBSD, this is done by lib/csu/${ARCH}/crt1.c.

Note, however, that return'ing from a C function means the stack
contents, for example, variables defined in function scope, are
discarded.  Therefore, if, let's say one defined a pointer in the
function scope, like:

void *p;

And then later assign a block of memory allocated from heap to it:

p = malloc(size);

Since p is in function scope, upon return, it's gone.  If there is no
other pointers that referenced the memory block referenced by p, the
memory block is _technically_ leaked.

This does not matter in practice because exit() or returning from main
are both the points of termination, and the kernel would then reclaim
all memory pages that belongs to the process.  However, doing exit()
makes it more explicit that this is the point of no returns, actually,
it hints the compiler or a static analyzer to do the right thing without
needing to make main() a special case.

Cheers,



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r286880 - head/sys/kern

2015-08-28 Thread Julien Charbon

 Hi Konstantin,

On 27/08/15 19:19, Konstantin Belousov wrote:
> On Thu, Aug 27, 2015 at 06:28:03PM +0200, Julien Charbon wrote:
>> On 27/08/15 12:49, Konstantin Belousov wrote:
>>> On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote:
  As I said, I am not opposed to back out this change, callout(9) API in
 mpsafe mode is a already complex/subtle API, it won't change too much
 the current complexity.

  Let say that if nobody screams until Friday 8/28, I will put back
 r284245 and revert this change _and_ I will make this case clear in the
 man page.
>>>
>>> [Replying to a random message in the whole set of conversations]
>>>
>>> There is one more case, besides TCP timers, which is equially, of not
>>> more, critical and sensitive WRT to the callout_stop().  Look at the
>>> sys/kern/subr_sleepqueue.c:sleepq_check_timeout().  Stray return of
>>> the false result from callout_stop() causes creation of the non-killable
>>> processes:  the callout fired, we missed the wakeup and went to sleep
>>> by manually doing the context switch.  Such thread cannot be woken up.
>>>
>>> I suspect that your fix is a better approach than my attempt to look
>>> at something similar at PR 200992 (may be not).
>>
>>  This change (r286880) won't improve the PR 200992:
>>
>>  r286880 only addresses a case where callout_stop() returns 1 instead of
>> 0.  Thus the only thing that can do r286880 to PR 200992:
>>
>>  - Don't change anything the issues
>>  - Worsen the issue
>>
>>  Sorry to kill your hope of a simple and elegant fix for PR 200992.
> 
> Well, not that I am frustrated much.  Thank you for taking a look.
> Did you read the patch attached to the PR ?

 Right, I read it from here:

https://bugs.freebsd.org/bugzilla/attachment.cgi?id=157915&action=diff

 And I am not confident enough to say if it is the right way go.  I
became knowledgeable on callout calls from TCP timers (D2079 and D2763),
but that's it.

 I would propose rrs (as he introduced the 'not_on_a_list' logic) and
jhb for reviewing your patch.

 And unlike me (D3078), don't underestimate the callout complexity in
mpsafe mode. :)

--
Julien



signature.asc
Description: OpenPGP digital signature


svn commit: r287249 - head/sys/netinet6

2015-08-28 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Aug 28 09:38:18 2015
New Revision: 287249
URL: https://svnweb.freebsd.org/changeset/base/287249

Log:
  remove a left-over after r220463 empty #ifdef INET check.
  
  MFC after:1 week

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==
--- head/sys/netinet6/udp6_usrreq.c Fri Aug 28 07:31:19 2015
(r287248)
+++ head/sys/netinet6/udp6_usrreq.c Fri Aug 28 09:38:18 2015
(r287249)
@@ -1243,8 +1243,6 @@ udp6_send(struct socket *so, int flags, 
INP_HASH_WLOCK(pcbinfo);
error = udp6_output(inp, m, addr, control, td);
INP_HASH_WUNLOCK(pcbinfo);
-#ifdef INET
-#endif 
INP_WUNLOCK(inp);
return (error);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287250 - head/sys/dev/mmc/host

2015-08-28 Thread Andrew Turner
Author: andrew
Date: Fri Aug 28 10:34:37 2015
New Revision: 287250
URL: https://svnweb.freebsd.org/changeset/base/287250

Log:
  Only check for the bus frequency if it has not already been set, for
  example through a driver running as a subclass of this.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Fri Aug 28 09:38:18 2015
(r287249)
+++ head/sys/dev/mmc/host/dwmmc.c   Fri Aug 28 10:34:37 2015
(r287250)
@@ -481,10 +481,12 @@ parse_fdt(struct dwmmc_softc *sc)
 * what the clock is supplied for our device.
 * For now rely on the value specified in FDT.
 */
-   if ((len = OF_getproplen(node, "bus-frequency")) <= 0)
-   return (ENXIO);
-   OF_getencprop(node, "bus-frequency", dts_value, len);
-   sc->bus_hz = dts_value[0];
+   if (sc->bus_hz == 0) {
+   if ((len = OF_getproplen(node, "bus-frequency")) <= 0)
+   return (ENXIO);
+   OF_getencprop(node, "bus-frequency", dts_value, len);
+   sc->bus_hz = dts_value[0];
+   }
 
/*
 * Platform-specific stuff
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287217 - head/usr.sbin/syslogd

2015-08-28 Thread Bruce Evans

On Thu, 27 Aug 2015, Xin LI wrote:


Log:
 die() would never return, mark it as so.


Why?  (Except to add a style bug.)


Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Thu Aug 27 17:16:18 2015
(r287216)
+++ head/usr.sbin/syslogd/syslogd.c Thu Aug 27 18:11:00 2015
(r287217)
@@ -324,7 +324,7 @@ static const char *cvthname(struct socka
static void deadq_enter(pid_t, const char *);
static int  deadq_remove(pid_t);
static int  decode(const char *, const CODE *);
-static voiddie(int);
+static voiddie(int) __dead2;


Since the function is static, it is very easy for the compiler to see
that it doesn't return.  Even gcc-4.2.1 does this by default, since
-O implies -funit-at-a-time for gcc-4.2.1.  For clang, there is no way
to prevent this (except possibly -O0) since, since -fno-unit-at-a-time
is broken in clang.

Several other functions in the same file are still missing this style
bug:

- usage().  The style bug is clearly documented for usage() by its
  absence in style(9) and in most files that have usage().  Howvever,
  about 30 declarations of usage() in /usr/src have the style bug.

- timedout().  This is a signal handler, so doesn't really need it.
  This is broken signal handler.  It carefully uses _exit() so as
  to not use stdio in a signal handler, but defeats this by also
  using errx().

Bruce
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread Warner Losh
On Fri, Aug 28, 2015 at 1:48 AM, Garrett Cooper 
wrote:

>
> Libxo (iirc) doesn't install atexit handlers, which means that you need to
> use exit (or a reason facsimile) in order for it to flush its file streams.
>
> This is unintuitive though. I wish it did the right thing as part of
> initializing the streams..
>

Ummm, stdio streams are flushed if you return from main() too. If it has
internal buffered data it
hasn't delivered to stdio yet and hasn't installed atexit handlers, how on
earth can it flush anything
when you call exit().

Warner
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287227 - in head: lib/libstand share/mk sys/boot/efi sys/boot/ficl sys/boot/i386 sys/boot/libstand32 sys/boot/pc98 sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs

2015-08-28 Thread Nikolai Lifanov
On 08/27/15 19:46, Warner Losh wrote:
> Author: imp
> Date: Thu Aug 27 23:46:42 2015
> New Revision: 287227
> URL: https://svnweb.freebsd.org/changeset/base/287227
> 
> Log:
>   Use CFLAGS_NO_SIMD in preference to varying lists of -mno- flags.
>   Go ahead and defined -D_STANDALONE for all targets (only strictly
>   needed for some architecture, but harmless on those it isn't required
>   for). Also add -msoft-float to all architectures uniformly rather
>   that higgley piggley like it is today.
>   
>   Differential Revision: https://reviews.freebsd.org/D3496
> 
> Added:
>   head/share/mk/bsd.stand.mk   (contents, props changed)
> Modified:
>   head/lib/libstand/Makefile
>   head/sys/boot/efi/Makefile.inc
>   head/sys/boot/ficl/Makefile
>   head/sys/boot/i386/Makefile.inc
>   head/sys/boot/libstand32/Makefile
>   head/sys/boot/pc98/Makefile.inc
>   head/sys/boot/userboot/ficl/Makefile
>   head/sys/boot/userboot/libstand/Makefile
>   head/sys/boot/zfs/Makefile
> 

Hi! I get this on amd64 after this commit:

--- sys.all__D ---
ld: i386:x86-64 architecture of input file
`/usr/obj/usr/src/sys/boot/i386/gptboot/../../libstand32/libstand.a(qdivrem.o)'
is incompatible with i386 output
*** [gptboot.out] Error code 1

- Nikolai Lifanov

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287253 - head/sys/conf

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 13:57:30 2015
New Revision: 287253
URL: https://svnweb.freebsd.org/changeset/base/287253

Log:
  Fix cleaning of files generated from .m sources.

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Fri Aug 28 12:02:40 2015(r287252)
+++ head/sys/conf/kmod.mk   Fri Aug 28 13:57:30 2015(r287253)
@@ -360,11 +360,9 @@ __MPATH!=find ${SYSDIR:tA}/ -name \*_if.
 _MPATH=${__MPATH:H:O:u}
 .endif
 .PATH.m: ${_MPATH}
-.for _s in ${SRCS:M*_if.[ch]}
-.if eixsts(${_s:R}.m})
-CLEANFILES+=   ${_s}
-.endif
-.endfor # _s
+.for _i in ${SRCS:M*_if.[ch]}
+CLEANFILES+=   ${_i}
+.endfor # _i
 .m.c:  ${SYSDIR}/tools/makeobjops.awk
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287227 - in head: lib/libstand share/mk sys/boot/efi sys/boot/ficl sys/boot/i386 sys/boot/libstand32 sys/boot/pc98 sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs

2015-08-28 Thread Warner Losh
I'm testing a fix now. Not sure why I didn't see it until now.

Warner


On Fri, Aug 28, 2015 at 7:45 AM, Nikolai Lifanov 
wrote:

> On 08/27/15 19:46, Warner Losh wrote:
> > Author: imp
> > Date: Thu Aug 27 23:46:42 2015
> > New Revision: 287227
> > URL: https://svnweb.freebsd.org/changeset/base/287227
> >
> > Log:
> >   Use CFLAGS_NO_SIMD in preference to varying lists of -mno- flags.
> >   Go ahead and defined -D_STANDALONE for all targets (only strictly
> >   needed for some architecture, but harmless on those it isn't required
> >   for). Also add -msoft-float to all architectures uniformly rather
> >   that higgley piggley like it is today.
> >
> >   Differential Revision: https://reviews.freebsd.org/D3496
> >
> > Added:
> >   head/share/mk/bsd.stand.mk   (contents, props changed)
> > Modified:
> >   head/lib/libstand/Makefile
> >   head/sys/boot/efi/Makefile.inc
> >   head/sys/boot/ficl/Makefile
> >   head/sys/boot/i386/Makefile.inc
> >   head/sys/boot/libstand32/Makefile
> >   head/sys/boot/pc98/Makefile.inc
> >   head/sys/boot/userboot/ficl/Makefile
> >   head/sys/boot/userboot/libstand/Makefile
> >   head/sys/boot/zfs/Makefile
> >
>
> Hi! I get this on amd64 after this commit:
>
> --- sys.all__D ---
> ld: i386:x86-64 architecture of input file
>
> `/usr/obj/usr/src/sys/boot/i386/gptboot/../../libstand32/libstand.a(qdivrem.o)'
> is incompatible with i386 output
> *** [gptboot.out] Error code 1
>
> - Nikolai Lifanov
>
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread Conrad Meyer
On Fri, Aug 28, 2015 at 1:36 AM, Xin Li  wrote:
>
>
> On 8/27/15 21:43, Alexey Dokuchaev wrote:
>> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
>>> New Revision: 287236
>>> URL: https://svnweb.freebsd.org/changeset/base/287236
>>>
>>> Log:
>>>   Use exit() instead of return in main().
>>
>> Because?..
>
> Because the explicit exit() have a subtle difference from returning from
> main(), and that could confuse static analyzers.  I thought it was
> obvious and too much for trivial changes like this.  Let me try again:
>
> C standard defines that when main() returns to the startup code, the
> latter is required by the standard to call exit() with main()'s return
> value, should main() be defined to return a type compatible with int.
> On FreeBSD, this is done by lib/csu/${ARCH}/crt1.c.
>
> Note, however, that return'ing from a C function means the stack
> contents, for example, variables defined in function scope, are
> discarded.  Therefore, if, let's say one defined a pointer in the
> function scope, like:
>
> void *p;
>
> And then later assign a block of memory allocated from heap to it:
>
> p = malloc(size);
>
> Since p is in function scope, upon return, it's gone.  If there is no
> other pointers that referenced the memory block referenced by p, the
> memory block is _technically_ leaked.
>
> This does not matter in practice because exit() or returning from main
> are both the points of termination, and the kernel would then reclaim
> all memory pages that belongs to the process.  However, doing exit()
> makes it more explicit that this is the point of no returns, actually,
> it hints the compiler or a static analyzer to do the right thing without
> needing to make main() a special case.


So, a better commit log may have been:

"Use exit() instead of return in main() to work around a broken static analyzer"

Any C static analyzer must understand main().

Best,
Conrad
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287254 - head/sys/sys

2015-08-28 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Aug 28 14:06:28 2015
New Revision: 287254
URL: https://svnweb.freebsd.org/changeset/base/287254

Log:
  Be more GCC-friendly with attributes
  
  Being clang the default compiler, we were always giving precedence to
  the __has_attribute check. Unfortunately clang generally doesn't support
  the new attributes (alloc_size was briefly supported and then reverted)
  so we were always doing both checks. Give the precedence to GCC as that is
  the working case now.
  
  Do the same for  __has_builtin() for consistency.

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Aug 28 13:57:30 2015(r287253)
+++ head/sys/sys/cdefs.hFri Aug 28 14:06:28 2015(r287254)
@@ -237,12 +237,12 @@
 #define__aligned(x)__attribute__((__aligned__(x)))
 #define__section(x)__attribute__((__section__(x)))
 #endif
-#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size)
 #define__alloc_size(x) __attribute__((__alloc_size__(x)))
 #else
 #define__alloc_size(x)
 #endif
-#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9)
+#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align)
 #define__alloc_align(x)__attribute__((__alloc_align__(x)))
 #else
 #define__alloc_align(x)
@@ -382,7 +382,7 @@
 #define__returns_twice
 #endif
 
-#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6)
+#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) 
 #define__unreachable() __builtin_unreachable()
 #else
 #define__unreachable() ((void)0)
@@ -535,7 +535,7 @@
  * well enough to use them in limited cases.
  */ 
 #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
-#if __has_attribute(artificial) || __GNUC_PREREQ__(4, 3)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial)
 #define__gnu_inline__attribute__((__gnu_inline__, __artificial__))
 #else
 #define__gnu_inline__attribute__((__gnu_inline__))
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287255 - head/sys/sys

2015-08-28 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Aug 28 14:13:01 2015
New Revision: 287255
URL: https://svnweb.freebsd.org/changeset/base/287255

Log:
  trailing space

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Aug 28 14:06:28 2015(r287254)
+++ head/sys/sys/cdefs.hFri Aug 28 14:13:01 2015(r287255)
@@ -382,7 +382,7 @@
 #define__returns_twice
 #endif
 
-#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) 
+#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable)
 #define__unreachable() __builtin_unreachable()
 #else
 #define__unreachable() ((void)0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287256 - head/sys/fs/nfs

2015-08-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Aug 28 14:26:11 2015
New Revision: 287256
URL: https://svnweb.freebsd.org/changeset/base/287256

Log:
  Fix an NFS server bug that manifested in "ls -al" displaying a plus
  sign on every directory exported via NFSv4 with NFSv4 ACLs enabled.
  
  Reviewed by:  rmacklem@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D3502

Modified:
  head/sys/fs/nfs/nfs_commonacl.c

Modified: head/sys/fs/nfs/nfs_commonacl.c
==
--- head/sys/fs/nfs/nfs_commonacl.c Fri Aug 28 14:13:01 2015
(r287255)
+++ head/sys/fs/nfs/nfs_commonacl.c Fri Aug 28 14:26:11 2015
(r287256)
@@ -347,6 +347,8 @@ nfsrv_buildace(struct nfsrv_descript *nd
acemask |= NFSV4ACE_WRITEACL;
if (ace->ae_perm & ACL_WRITE_OWNER)
acemask |= NFSV4ACE_WRITEOWNER;
+   if (ace->ae_perm & ACL_SYNCHRONIZE)
+   acemask |= NFSV4ACE_SYNCHRONIZE;
} else {
if (ace->ae_perm & ACL_READ_DATA)
acemask |= NFSV4ACE_READDATA;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287217 - head/usr.sbin/syslogd

2015-08-28 Thread Joerg Sonnenberger
On Fri, Aug 28, 2015 at 10:17:56PM +1000, Bruce Evans wrote:
> >-static void die(int);
> >+static void die(int) __dead2;
> 
> Since the function is static, it is very easy for the compiler to see
> that it doesn't return.

But the compiler can't tell if it is the *intention* that the function
never returns. The warning behavior exists because that can easily
change with macros etc. 

> Even gcc-4.2.1 does this by default, since
> -O implies -funit-at-a-time for gcc-4.2.1.  For clang, there is no way
> to prevent this (except possibly -O0) since, since -fno-unit-at-a-time
> is broken in clang.

It is not broken. It is loadly ignored as unsupported. The very
existance of the option in GCC has always been a concession to broken
and badly written code, including of course GCC's own CRT.

Joerg
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287257 - head/sys/boot/libstand32

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 14:50:36 2015
New Revision: 287257
URL: https://svnweb.freebsd.org/changeset/base/287257

Log:
  Add back missing -m32 for amd64 and powerpc64 that was lost
  in the move to bsd.stand.mk.

Modified:
  head/sys/boot/libstand32/Makefile

Modified: head/sys/boot/libstand32/Makefile
==
--- head/sys/boot/libstand32/Makefile   Fri Aug 28 14:26:11 2015
(r287256)
+++ head/sys/boot/libstand32/Makefile   Fri Aug 28 14:50:36 2015
(r287257)
@@ -19,6 +19,9 @@ LIB=  stand
 INTERNALLIB=
 MK_PROFILE=no
 NO_PIC=
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
+CFLAGS+=   -m32 -I.
+.endif
 
 WARNS?=0
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287254 - head/sys/sys

2015-08-28 Thread Tijl Coosemans
On Fri, 28 Aug 2015 14:06:29 + (UTC) "Pedro F. Giffuni"  
wrote:
> Author: pfg
> Date: Fri Aug 28 14:06:28 2015
> New Revision: 287254
> URL: https://svnweb.freebsd.org/changeset/base/287254
> 
> Log:
>   Be more GCC-friendly with attributes
>   
>   Being clang the default compiler, we were always giving precedence to
>   the __has_attribute check. Unfortunately clang generally doesn't support
>   the new attributes (alloc_size was briefly supported and then reverted)
>   so we were always doing both checks. Give the precedence to GCC as that is
>   the working case now.
>   
>   Do the same for  __has_builtin() for consistency.
> 
> Modified:
>   head/sys/sys/cdefs.h
> 
> Modified: head/sys/sys/cdefs.h
> ==
> --- head/sys/sys/cdefs.h  Fri Aug 28 13:57:30 2015(r287253)
> +++ head/sys/sys/cdefs.h  Fri Aug 28 14:06:28 2015(r287254)
> @@ -237,12 +237,12 @@
>  #define  __aligned(x)__attribute__((__aligned__(x)))
>  #define  __section(x)__attribute__((__section__(x)))
>  #endif
> -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
> +#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size)

I think you have to add underscores to the __has_attribute argument,
like __alloc_size__ here, because user code is allowed to use
alloc_size.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287258 - head/sys/dev/mmc/host

2015-08-28 Thread Andrew Turner
Author: andrew
Date: Fri Aug 28 15:27:55 2015
New Revision: 287258
URL: https://svnweb.freebsd.org/changeset/base/287258

Log:
  Move dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
  subclass the dwmmc driver to allow SoC specific attachments.
  
  Sponsored by: ABT Systems Ltd

Added:
  head/sys/dev/mmc/host/dwmmc_reg.h
 - copied, changed from r287249, head/sys/dev/mmc/host/dwmmc.h
Deleted:
  head/sys/dev/mmc/host/dwmmc.h
Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Fri Aug 28 14:50:36 2015
(r287257)
+++ head/sys/dev/mmc/host/dwmmc.c   Fri Aug 28 15:27:55 2015
(r287258)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "mmcbr_if.h"
 

Copied and modified: head/sys/dev/mmc/host/dwmmc_reg.h (from r287249, 
head/sys/dev/mmc/host/dwmmc.h)
==
--- head/sys/dev/mmc/host/dwmmc.h   Fri Aug 28 09:38:18 2015
(r287249, copy source)
+++ head/sys/dev/mmc/host/dwmmc_reg.h   Fri Aug 28 15:27:55 2015
(r287258)
@@ -30,6 +30,9 @@
  * $FreeBSD$
  */
 
+#ifndef DEV_MMC_HOST_DWMMC_REG_H
+#define DEV_MMC_HOST_DWMMC_REG_H
+
 #defineSDMMC_CTRL  0x0 /* Control Register */
 #define SDMMC_CTRL_USE_IDMAC   (1 << 25)   /* Use Internal DMAC */
 #define SDMMC_CTRL_DMA_ENABLE  (1 << 5)/* */
@@ -150,3 +153,5 @@
 #define SDMMC_CLKSEL_SAMPLE_SHIFT  0
 #define SDMMC_CLKSEL_DRIVE_SHIFT   16
 #define SDMMC_CLKSEL_DIVIDER_SHIFT 24
+
+#endif /* DEV_MMC_HOST_DWMMC_REG_H */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287254 - head/sys/sys

2015-08-28 Thread Pedro Giffuni



On 08/28/15 10:22, Tijl Coosemans wrote:

On Fri, 28 Aug 2015 14:06:29 + (UTC) "Pedro F. Giffuni"  
wrote:

Author: pfg
Date: Fri Aug 28 14:06:28 2015
New Revision: 287254
URL: https://svnweb.freebsd.org/changeset/base/287254

Log:
   Be more GCC-friendly with attributes

   Being clang the default compiler, we were always giving precedence to
   the __has_attribute check. Unfortunately clang generally doesn't support
   the new attributes (alloc_size was briefly supported and then reverted)
   so we were always doing both checks. Give the precedence to GCC as that is
   the working case now.

   Do the same for  __has_builtin() for consistency.

Modified:
   head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Aug 28 13:57:30 2015(r287253)
+++ head/sys/sys/cdefs.hFri Aug 28 14:06:28 2015(r287254)
@@ -237,12 +237,12 @@
  #define   __aligned(x)__attribute__((__aligned__(x)))
  #define   __section(x)__attribute__((__section__(x)))
  #endif
-#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size)


I think you have to add underscores to the __has_attribute argument,
like __alloc_size__ here, because user code is allowed to use
alloc_size.



Hmm .. yes, it certainly won't hurt.

Thanks!

Pedro.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287259 - head/sys/sys

2015-08-28 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Aug 28 15:36:05 2015
New Revision: 287259
URL: https://svnweb.freebsd.org/changeset/base/287259

Log:
  Add underscores to attributes when checking for __has_attribute.
  
  This is a good practice to avoid confusion with allowed macros.
  
  Suggested by: jilles

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Aug 28 15:27:55 2015(r287258)
+++ head/sys/sys/cdefs.hFri Aug 28 15:36:05 2015(r287259)
@@ -237,12 +237,12 @@
 #define__aligned(x)__attribute__((__aligned__(x)))
 #define__section(x)__attribute__((__section__(x)))
 #endif
-#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
 #define__alloc_size(x) __attribute__((__alloc_size__(x)))
 #else
 #define__alloc_size(x)
 #endif
-#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align)
+#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
 #define__alloc_align(x)__attribute__((__alloc_align__(x)))
 #else
 #define__alloc_align(x)
@@ -535,7 +535,7 @@
  * well enough to use them in limited cases.
  */ 
 #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
-#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial)
+#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__)
 #define__gnu_inline__attribute__((__gnu_inline__, __artificial__))
 #else
 #define__gnu_inline__attribute__((__gnu_inline__))
@@ -787,8 +787,8 @@
  * properties that cannot be enforced by the C type system. 
  */
 
-#if __has_attribute(argument_with_type_tag) && \
-__has_attribute(type_tag_for_datatype) && !defined(lint)
+#if __has_attribute(__argument_with_type_tag__) && \
+__has_attribute(__type_tag_for_datatype__) && !defined(lint)
 #define__arg_type_tag(arg_kind, arg_idx, type_tag_idx) \
__attribute__((__argument_with_type_tag__(arg_kind, arg_idx, 
type_tag_idx)))
 #define__datatype_type_tag(kind, type) \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287259 - head/sys/sys

2015-08-28 Thread Pedro Giffuni



On 08/28/15 10:36, Pedro F. Giffuni wrote:

Author: pfg
Date: Fri Aug 28 15:36:05 2015
New Revision: 287259
URL: https://svnweb.freebsd.org/changeset/base/287259

Log:
   Add underscores to attributes when checking for __has_attribute.

   This is a good practice to avoid confusion with allowed macros.

   Suggested by:jilles



Really sorry .. this was Tijl !!

I hate it when my fingers betray me.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287260 - in head/sys: pc98/include x86/include

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 15:41:09 2015
New Revision: 287260
URL: https://svnweb.freebsd.org/changeset/base/287260

Log:
  Add missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too.
  This allows the owc module to compile on pc98 and seems preferable to
  adding another special case in the build system.

Added:
  head/sys/pc98/include/ofw_machdep.h   (contents, props changed)
Modified:
  head/sys/x86/include/ofw_machdep.h

Added: head/sys/pc98/include/ofw_machdep.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/pc98/include/ofw_machdep.h Fri Aug 28 15:41:09 2015
(r287260)
@@ -0,0 +1,6 @@
+/*-
+ * This file is in the public domain.
+ */
+/* $FreeBSD$ */
+
+#include 

Modified: head/sys/x86/include/ofw_machdep.h
==
--- head/sys/x86/include/ofw_machdep.h  Fri Aug 28 15:36:05 2015
(r287259)
+++ head/sys/x86/include/ofw_machdep.h  Fri Aug 28 15:41:09 2015
(r287260)
@@ -29,7 +29,7 @@
 #ifndef _MACHINE_OFW_MACHDEP_H_
 #define _MACHINE_OFW_MACHDEP_H_
 
-#include 
+#include 
 #include 
 
 typedefuint32_tcell_t;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread Allan Jude
On 2015-08-28 03:48, Garrett Cooper wrote:
> 
>> On Aug 28, 2015, at 00:24, O'Connor, Daniel  wrote:
>>
>>> On 28 Aug 2015, at 15:34, Alexey Dokuchaev  wrote:
 On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote:
> On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev  
> wrote:
>> On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
>> New Revision: 287236
>> URL: https://svnweb.freebsd.org/changeset/base/287236
>>
>> Log:
>> Use exit() instead of return in main().
>
> Because?..

 Probably because of libxo...
>>>
>>> I'm just wondering how hard is it to write sensible commit logs. :(
>>
>> To put it in a hopefully more helpful way..
>> Please write why your change is doing something, not what it is doing.
>>
>> Saying what it is doing is OK if it's really hairy, but 99% of the time that 
>> isn't the case.
>>
>> Assuming this is a libxo thing the commit log should have been something 
>> like..
>> "Use exit out of main otherwise libxo will not flush properly"
>> (or something similar)
>>
>> Although it would be surprising if libxo required you to use exit()..
> 
> Libxo (iirc) doesn't install atexit handlers, which means that you need to 
> use exit (or a reason facsimile) in order for it to flush its file streams.
> 
> This is unintuitive though. I wish it did the right thing as part of 
> initializing the streams..
> 

This has nothing to do with libxo. libxo has an optional atexit handler,
but as long as you call xo_finish(), then everything is flushed and the
xo handle is closed. xo_finish() is indeed called the line before this
change.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r287262 - head/gnu/usr.bin/binutils

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 16:23:03 2015
New Revision: 287262
URL: https://svnweb.freebsd.org/changeset/base/287262

Log:
  Remove .WAIT hacks and put in specific dependencies.

Modified:
  head/gnu/usr.bin/binutils/Makefile

Modified: head/gnu/usr.bin/binutils/Makefile
==
--- head/gnu/usr.bin/binutils/Makefile  Fri Aug 28 16:09:29 2015
(r287261)
+++ head/gnu/usr.bin/binutils/Makefile  Fri Aug 28 16:23:03 2015
(r287262)
@@ -5,10 +5,8 @@
 SUBDIR=doc\
libiberty \
libbfd \
-   .WAIT \
libopcodes \
libbinutils \
-   .WAIT \
as \
ld \
${_objcopy} \
@@ -18,6 +16,11 @@ SUBDIR=  doc\
 _objcopy=  objcopy
 .endif
 
+SUBDIR_DEPEND_libbinutils=libbfd   # for bfdver.h
+SUBDIR_DEPEND_as=libbfd libiberty libopcodes
+SUBDIR_DEPEND_ld=libbfd libiberty
+SUBDIR_DEPEND_objcopy=libbfd libiberty libbinutils
+SUBDIR_DEPEND_objdump=libbfd libiberty libbinutils libopcodes
 
 .if !make(install)
 SUBDIR_PARALLEL=
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287196 - head/sys/kern

2015-08-28 Thread Hans Petter Selasky

On 08/27/15 10:15, Julien Charbon wrote:

Author: jch
Date: Thu Aug 27 08:15:32 2015
New Revision: 287196
URL: https://svnweb.freebsd.org/changeset/base/287196

Log:
   In callout_stop(), if a callout is both pending and currently
   being serviced return 0 (fail) but it is applicable only
   mpsafe callouts.  Thanks to hselasky for finding this.

   Differential Revision:   https://reviews.freebsd.org/D3078 (Updated)
   Submitted by:hselasky
   Reviewed by: jch



Hi,

I suggest that this special case be made into a new function, named 
callout_drain_async() inspired from projects/hps_head and that r287196 
be backed out, so that callout_stop() works like before. See:


https://reviews.freebsd.org/D3521

And that the following patch be MFC'ed to -current from 
projects/hps_head after D3521.


https://svnweb.freebsd.org/changeset/base/287261

It should close the race in question.

--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287263 - head/sys/conf

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 16:29:38 2015
New Revision: 287263
URL: https://svnweb.freebsd.org/changeset/base/287263

Log:
  Comment out cleaning files, since it cleans too much.

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Fri Aug 28 16:23:03 2015(r287262)
+++ head/sys/conf/kmod.mk   Fri Aug 28 16:29:38 2015(r287263)
@@ -361,7 +361,8 @@ _MPATH=${__MPATH:H:O:u}
 .endif
 .PATH.m: ${_MPATH}
 .for _i in ${SRCS:M*_if.[ch]}
-CLEANFILES+=   ${_i}
+#removes too much, comment out until it's more constrained.
+#CLEANFILES+=  ${_i}
 .endfor # _i
 .m.c:  ${SYSDIR}/tools/makeobjops.awk
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread Alexey Dokuchaev
On Fri, Aug 28, 2015 at 12:00:26PM -0400, Allan Jude wrote:
> On 2015-08-28 03:48, Garrett Cooper wrote:
> >> On Aug 28, 2015, at 00:24, O'Connor, Daniel  wrote:
> >>> On 28 Aug 2015, at 15:34, Alexey Dokuchaev  wrote:
>  On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote:
> 
>  Probably because of libxo...
> >>>
> >>> I'm just wondering how hard is it to write sensible commit logs. :(
> >>
> >> To put it in a hopefully more helpful way..
> >> Please write why your change is doing something, not what it is doing.
> >>
> >> Saying what it is doing is OK if it's really hairy, but 99% of the time
> >> that isn't the case.
> >>
> >> Assuming this is a libxo thing the commit log should have been
> >> something like.. "Use exit out of main otherwise libxo will not flush
> >> properly" (or something similar)
> >>
> >> Although it would be surprising if libxo required you to use exit()..
> > 
> > Libxo (iirc) doesn't install atexit handlers, which means that you need
> > to use exit (or a reason facsimile) in order for it to flush its file
> > streams.
> > 
> > This is unintuitive though. I wish it did the right thing as part of
> > initializing the streams..
> 
> This has nothing to do with libxo. libxo has an optional atexit handler,
> but as long as you call xo_finish(), then everything is flushed and the
> xo handle is closed. xo_finish() is indeed called the line before this
> change.

Funny how much hypotheses/guesses/speculations it had caused.  Which just
proves the necessity of good commit logs.

But some of us had probably learned a few things about exit(), atexit
handlers, flushing the file streams, etc. so thanks for that guys. :)

./danfe
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287264 - head/sys/kern

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 19:53:19 2015
New Revision: 287264
URL: https://svnweb.freebsd.org/changeset/base/287264

Log:
  Per overwhelming sentiment in the code review, use FEATURE instead.
  
  Differential Revision: https://reviews.freebsd.org/D3488
  MFC After: 2 days

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Fri Aug 28 16:29:38 2015(r287263)
+++ head/sys/kern/init_main.c   Fri Aug 28 19:53:19 2015(r287264)
@@ -119,12 +119,8 @@ SYSCTL_INT(_debug, OID_AUTO, bootverbose
 
 /* Want to avoid defining INVARIANTS if not already defined */
 #ifdef INVARIANTS
-static int invariants = 1;
-#else
-static int invariants = 0;
+FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance");
 #endif
-SYSCTL_INT(_debug, OID_AUTO, invariants, CTLFLAG_RD, &invariants, 0,
-   "Kernel compiled with invariants");
 
 /*
  * This ensures that there is at least one entry so that the sysinit_set
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287265 - head/sys/kern

2015-08-28 Thread Warner Losh
Author: imp
Date: Fri Aug 28 20:06:58 2015
New Revision: 287265
URL: https://svnweb.freebsd.org/changeset/base/287265

Log:
  Remove now obsolete comment.
  
  MFC After: 2 days

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Fri Aug 28 19:53:19 2015(r287264)
+++ head/sys/kern/init_main.c   Fri Aug 28 20:06:58 2015(r287265)
@@ -117,7 +117,6 @@ int bootverbose = BOOTVERBOSE;
 SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0,
"Control the output of verbose kernel messages");
 
-/* Want to avoid defining INVARIANTS if not already defined */
 #ifdef INVARIANTS
 FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance");
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287236 - head/bin/df

2015-08-28 Thread John Baldwin
On Friday, August 28, 2015 07:05:06 AM Conrad Meyer wrote:
> On Fri, Aug 28, 2015 at 1:36 AM, Xin Li  wrote:
> > And then later assign a block of memory allocated from heap to it:
> >
> > p = malloc(size);
> >
> > Since p is in function scope, upon return, it's gone.  If there is no
> > other pointers that referenced the memory block referenced by p, the
> > memory block is _technically_ leaked.
> >
> > This does not matter in practice because exit() or returning from main
> > are both the points of termination, and the kernel would then reclaim
> > all memory pages that belongs to the process.  However, doing exit()
> > makes it more explicit that this is the point of no returns, actually,
> > it hints the compiler or a static analyzer to do the right thing without
> > needing to make main() a special case.
> 
> 
> So, a better commit log may have been:
> 
> "Use exit() instead of return in main() to work around a broken static 
> analyzer"
> 
> Any C static analyzer must understand main().

+1

C++ might be another case (if you want to avoid destructors for local objects
in main() for some reason, and that probably argues for preferring return over
exit in general since usually you do want to run destructors).

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287268 - head/sys/dev/drm2/i915

2015-08-28 Thread Baptiste Daroussin
Author: bapt
Date: Sat Aug 29 00:05:39 2015
New Revision: 287268
URL: https://svnweb.freebsd.org/changeset/base/287268

Log:
  Mark ValleyView/Bay Trail as not supported

Modified:
  head/sys/dev/drm2/i915/i915_drv.c

Modified: head/sys/dev/drm2/i915/i915_drv.c
==
--- head/sys/dev/drm2/i915/i915_drv.c   Fri Aug 28 22:42:37 2015
(r287267)
+++ head/sys/dev/drm2/i915/i915_drv.c   Sat Aug 29 00:05:39 2015
(r287268)
@@ -193,6 +193,7 @@ static const struct intel_device_info in
.has_bsd_ring = 1,
.has_blt_ring = 1,
.is_valleyview = 1,
+   .not_supported = 1,
 };
 
 static const struct intel_device_info intel_valleyview_d_info = {
@@ -202,6 +203,7 @@ static const struct intel_device_info in
.has_bsd_ring = 1,
.has_blt_ring = 1,
.is_valleyview = 1,
+   .not_supported = 1,
 };
 
 static const struct intel_device_info intel_haswell_d_info = {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287270 - head/sys/net

2015-08-28 Thread Adrian Chadd
Author: adrian
Date: Sat Aug 29 04:33:31 2015
New Revision: 287270
URL: https://svnweb.freebsd.org/changeset/base/287270

Log:
  Remove now unused (and #if 0'ed out) headers.

Modified:
  head/sys/net/rss_config.c

Modified: head/sys/net/rss_config.c
==
--- head/sys/net/rss_config.c   Sat Aug 29 02:41:59 2015(r287269)
+++ head/sys/net/rss_config.c   Sat Aug 29 04:33:31 2015(r287270)
@@ -53,18 +53,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if 0
-#include 
-#include 
-#include 
-#include 
-
-/* for software rss hash support */
-#include 
-#include 
-#include 
-#endif
-
 /*-
  * Operating system parts of receiver-side scaling (RSS), which allows
  * network cards to direct flows to particular receive queues based on hashes
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287276 - head/sys/powerpc/booke

2015-08-28 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug 29 06:52:14 2015
New Revision: 287276
URL: https://svnweb.freebsd.org/changeset/base/287276

Log:
  The TLB1 TSIZE is a multiple of 4, not 2, so shift 2 bits, not 1.

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Sat Aug 29 06:28:48 2015
(r287275)
+++ head/sys/powerpc/booke/pmap.c   Sat Aug 29 06:52:14 2015
(r287276)
@@ -2817,7 +2817,7 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd
sz = 1 << (ilog2(size) & ~1);
if (va % sz != 0) {
do {
-   sz >>= 1;
+   sz >>= 2;
} while (va % sz != 0);
}
if (bootverbose)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287277 - head/sys/netinet

2015-08-28 Thread Adrian Chadd
Author: adrian
Date: Sat Aug 29 06:58:30 2015
New Revision: 287277
URL: https://svnweb.freebsd.org/changeset/base/287277

Log:
  Rename rss_soft_m2cpuid() ->  rss_soft_m2cpuid_v4() in preparation for
  an IPv6 version to show up.
  
  Submitted by: Tiwei Bie 
  Differential Revision:https://reviews.freebsd.org/D3504

Modified:
  head/sys/netinet/in_rss.c
  head/sys/netinet/in_rss.h
  head/sys/netinet/ip_input.c

Modified: head/sys/netinet/in_rss.c
==
--- head/sys/netinet/in_rss.c   Sat Aug 29 06:52:14 2015(r287276)
+++ head/sys/netinet/in_rss.c   Sat Aug 29 06:58:30 2015(r287277)
@@ -332,7 +332,7 @@ rss_mbuf_software_hash_v4(const struct m
  * XXX TODO: definitely want statistics here!
  */
 struct mbuf *
-rss_soft_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid)
+rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source, u_int *cpuid)
 {
uint32_t hash_val, hash_type;
int ret;

Modified: head/sys/netinet/in_rss.h
==
--- head/sys/netinet/in_rss.h   Sat Aug 29 06:52:14 2015(r287276)
+++ head/sys/netinet/in_rss.h   Sat Aug 29 06:58:30 2015(r287277)
@@ -51,7 +51,7 @@ int   rss_proto_software_hash_v4(struct i
struct in_addr dst, u_short src_port, u_short dst_port,
int proto, uint32_t *hashval,
uint32_t *hashtype);
-struct mbuf *  rss_soft_m2cpuid(struct mbuf *m, uintptr_t source,
+struct mbuf *  rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source,
u_int *cpuid);
 
 #endif /* !_NETINET_IN_RSS_H_ */

Modified: head/sys/netinet/ip_input.c
==
--- head/sys/netinet/ip_input.c Sat Aug 29 06:52:14 2015(r287276)
+++ head/sys/netinet/ip_input.c Sat Aug 29 06:58:30 2015(r287277)
@@ -140,7 +140,7 @@ static struct netisr_handler ip_nh = {
.nh_handler = ip_input,
.nh_proto = NETISR_IP,
 #ifdef RSS
-   .nh_m2cpuid = rss_soft_m2cpuid,
+   .nh_m2cpuid = rss_soft_m2cpuid_v4,
.nh_policy = NETISR_POLICY_CPU,
.nh_dispatch = NETISR_DISPATCH_HYBRID,
 #else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"