dim [Sun, 1 Jan 2012 21:43:14 +0000 (21:43 +0000)]
MFC r228657:
In usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h, use the correct
enumeration types for the mesh_peering and mesh_forwarding members of
struct wlan_iface, to fix enum conversion warnings.
dim [Sun, 1 Jan 2012 20:57:38 +0000 (20:57 +0000)]
MFC r228650:
In usr.bin/netstat/atalk.c, work around a clang false positive with
printf format warnings and conditional operators.
MFC r228668:
Revert r228650, and work around the clang false positive with printf
formats in usr.bin/netstat/atalk.c by conditionally adding NO_WFORMAT to
the Makefile instead.
dim [Sun, 1 Jan 2012 20:53:33 +0000 (20:53 +0000)]
MFC r228649:
Use NO_WCAST_ALIGN for usr.bin/ncplist, as there are many potential
alignment issues in it. (Though I doubt anyone still cares about
NetWare support...)
dim [Sun, 1 Jan 2012 19:19:48 +0000 (19:19 +0000)]
MFC r228712:
Use NO_WCAST_ALIGN for usr.bin/hastctl and usr.bin/hastd; the alignment
warnings in sbin/hastd/lzf.c are only emitted for i386 and amd64, and
there they can be safely ignored.
dim [Sun, 1 Jan 2012 19:15:52 +0000 (19:15 +0000)]
MFC r228636:
Correct a logic error in usr.bin/hexdump/conv.c, found by clang.
Whenever the conv_c() function encounters an incomplete multibyte char,
it peeks ahead. It also sets p to peekbuf, to indicate it is still
processing the incomplete character.
However, on the next retry, it compares buf against peekbuf, which
always returns false, since both buf and peekbuf are local char arrays,
whose addresses are never the same.
Fix this by comparing against p instead, which was the intention. Also
turn peekbuf into an array of u_char, to prevent conversion warnings.
dim [Sun, 1 Jan 2012 19:05:15 +0000 (19:05 +0000)]
MFC r228627:
In contrib/ee/ee.c, fix a few warnings about format strings not being
literals. Also, change the direction argument to move_rel() from char
to int; K&R function definions cause it to be promoted to an int anyway,
and this way we avoid clang warning about it.
dim [Sun, 1 Jan 2012 18:25:16 +0000 (18:25 +0000)]
MFC r228619:
In usr.bin/mt/mt.c, the c_code member of struct commands should really
be an unsigned long, since it will contain values of ioctl request
codes. On 64-bit arches, these will not fit into an int.
dim [Sun, 1 Jan 2012 18:17:37 +0000 (18:17 +0000)]
MFC r227090:
Fix a warning emitted by Clang.
The size passed to strlcat() must depend on the input length, not the
output length. Because the input and output buffers are equal in size,
the resulting binary does not change at all.
dim [Sun, 1 Jan 2012 17:37:17 +0000 (17:37 +0000)]
MFC r228612
Use both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too
disruptive to actually fix all the warnings, and the code hasn't been
maintained for several years.
rmacklem [Sun, 1 Jan 2012 16:41:33 +0000 (16:41 +0000)]
MFC: r227493
Move the assignment of default values for some mount options
to before the nfs_decode_args() call in the new NFS client,
so they don't overwrite the value specified on the command line.
nwhitehorn [Sun, 1 Jan 2012 16:05:36 +0000 (16:05 +0000)]
Keep track of PVO entries in each pmap, which allows much faster
pmap_remove() for large sparse requests. This can prevent pmap_remove()
operations on 64-bit process destruction or swapout that would take
several hundred times the lifetime of the universe to complete. This
behavior is largely indistinguishable from a hang.
nwhitehorn [Sun, 1 Jan 2012 16:04:02 +0000 (16:04 +0000)]
Increase the available virtual address space for user programs on PowerPC
AIM systems to 4 GB on 32-bit systems and 2^64 bytes on 64-bit systems.
VM_MAXUSER_ADDRESS remains at 2 GB on Book-E, due to a different memory
layout used on this platform.
mdf [Sat, 31 Dec 2011 20:12:26 +0000 (20:12 +0000)]
MFC r228440:
Consistently use types in ixgbe driver code:
- {ixgbe,ixv}_header_split is passed to TUNABLE_INT, so delcare it
int, not bool.
- {ixgbe,ixv}_tx_ctx_setup() returns a boolean value, so declare it
bool, not int.
- {ixgbe,ixv}_tso_setup() returns a bool, so declare it bool, not boolean_t.
- {ixgbe,ixv}_txeof() returns a bool, so declare it bool, not boolean_t.
- Do not re-define bool if the symbol already exists.
dim [Sat, 31 Dec 2011 20:06:38 +0000 (20:06 +0000)]
MFC r228603:
In sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
format warnings and conditional operators. (See LLVM PR 11313 for more
information.)
MFC r228693:
Revert r228603, and add the workaround to sbin/fsdb/Makefile instead.
mdf [Sat, 31 Dec 2011 19:50:55 +0000 (19:50 +0000)]
MFC r228441:
Consistently use types in e1000 driver code:
- Two struct members eee_disable are used in a function that expects
an int *, so declare them int, not bool.
- igb_tx_ctx_setup() returns a boolean value, so declare it bool, not int.
- igb_header_split is passed to TUNABLE_INT, so delcare it int, not bool.
- igb_tso_setup() returns a bool, so declare it bool, not boolean_t.
- Do not re-define bool/true/false if the symbols already exist.
dim [Sat, 31 Dec 2011 19:46:06 +0000 (19:46 +0000)]
MFC r228600:
Fix the incompatible enum conversions in libexec/ypxfr in another, more
messy way, so as to not disrupt other yp programs: just add casts to
convert the incompatible enums, as the numerical values are the same
(either by accident, design, or the phase of the moon at that time).
dim [Sat, 31 Dec 2011 19:19:19 +0000 (19:19 +0000)]
MFC r228581:
In libexec/bootpd/bootpgw/bootpgw.c, add a cast for the remaining
minutes of activity, to avoid a warning on platforms where time_t is a
32-bit integer.
dim [Sat, 31 Dec 2011 18:53:11 +0000 (18:53 +0000)]
MFC r228580:
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c, some
uint64_t values are snprintf'd using %llx. On amd64, uint64_t is
typedef'd as unsigned long, so cast the values to u_longlong_t, as is
done similarly in the rest of the file.
dim [Sat, 31 Dec 2011 18:49:46 +0000 (18:49 +0000)]
MFC r228579:
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c, some
uint64_t values are snprintf'd using %llx. On amd64, uint64_t is
typedef'd as unsigned long, so cast the values to u_longlong_t, as is
done similarly in the rest of the file.
hselasky [Sat, 31 Dec 2011 15:46:36 +0000 (15:46 +0000)]
MFC r227404:
Add definition of some USB 3.0 descriptors to libusb 1.0 and libusb 2.0.
Some header file parts of this patch were taken from a patch submitted
by Maya Erez <merez@codeaurora.org> to the LibUSB developers list.
hselasky [Sat, 31 Dec 2011 15:37:31 +0000 (15:37 +0000)]
MFC r227706, r227748, r227749 and r228234:
Simplify the usb_pause_mtx() function by factoring out the generic parts
to the kernel's pause() function. The pause() function can now be used
when cold != 0. Also assert that the timeout in system ticks must be
greater or equal to zero.
hselasky [Sat, 31 Dec 2011 15:31:34 +0000 (15:31 +0000)]
MFC r227701, r227847 and r227849:
Move the device_delete_all_children() function from usb_util.c
to kern/subr_bus.c. Simplify this function so that it no longer
depends on malloc() to execute. Rename device_delete_all_children()
into device_delete_children(). Identify a few other places where
it makes sense to use device_delete_children().
nwhitehorn [Sat, 31 Dec 2011 15:08:33 +0000 (15:08 +0000)]
MFC r228646:
Additional icache paranoia: non-PLT relocations can modify the text segment.
It is then important to make sure the icache is synchronized again to
prevent (rare) random seg faults and illegal instructions.
dim [Sat, 31 Dec 2011 15:03:29 +0000 (15:03 +0000)]
MFC r228558, r228585, r228588, r228652, r228707:
Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet. Since this is contrib code, and we don't really care
about the warnings, just make them non-fatal for now.
MFC r228590:
Fix typos in the comments about clang warnings in several
sendmail-related Makefiles.
Spotted by: arundel
MFC r228708:
In usr.bin/vacation/Makefile, fix a typo in the comment about clang
warnings.
hselasky [Sat, 31 Dec 2011 14:45:43 +0000 (14:45 +0000)]
MFC r226709:
Allow USB ethernet drivers to define a driver specific
attach handler so that a USB ethernet driver can
announce interface capabilities and do its own MII attach.
hselasky [Sat, 31 Dec 2011 14:33:15 +0000 (14:33 +0000)]
MFC r228709, r228711 and r228723:
- Add missing unlock of USB controller's lock, when
doing shutdown, suspend and resume.
- Add code to wait for USB shutdown to be executed at system shutdown.
- Add sysctl which can be used to skip this waiting.
dim [Sat, 31 Dec 2011 14:21:41 +0000 (14:21 +0000)]
MFC r228553:
In contrib/file/softmagic.c, fix a potential format string security
problem. (This fix has already been applied upstream, but we do not
have the latest version of file in the tree at the moment.)
hselasky [Sat, 31 Dec 2011 14:12:12 +0000 (14:12 +0000)]
MFC r226173, r227843, r227848 and r227908:
Use DEVMETHOD_END to mark end of device methods.
Remove superfluous device methods.
Add some missing __FBSBID() macros.
dim [Sat, 31 Dec 2011 14:04:54 +0000 (14:04 +0000)]
MFC r228550:
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c, the
dt_popc() function assumes that either _ILP32 or _LP64 is defined,
otherwise it has no suitable implementation.
However, the _ILP32 and _LP64 macros come from isa_defs.h, which is not
included in this file. Add the include now, to get the macros defined.
dim [Sat, 31 Dec 2011 13:43:51 +0000 (13:43 +0000)]
MFC r228547:
Cast away a clang alignment warning in drti.c's fixsymbol() function.
This code only runs on i386 and amd64, so there should be no problems if
buf + sec->dofs_offset is not aligned (which is unlikely anyway).
dim [Sat, 31 Dec 2011 13:37:25 +0000 (13:37 +0000)]
MFC r228546:
Clang has more warnings enabled by default, and when using -Wall, so if WARNS
is set to low values, some of them have to be disabled explicitly.
MFC r228551:
Disable one more clang warning when WARNS <= 3.
MFC r228606:
Add a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang,
to selectively work around warnings in programs that don't use flexible
array members, but instead define arrays of length 1 at the end of the
struct, and then access those beyond their declared bounds.
MFC r228617:
Disable yet another clang warning when WARNS <= 3.
MFC r228675:
Disable yet another clang warning (-Wconversion) when WARNS <= 3.
MFC r228677:
Disable another clang warning (-Wempty-body) when WARNS <= 2.
hselasky [Sat, 31 Dec 2011 13:23:04 +0000 (13:23 +0000)]
MFC r227396, r227401, r227541, r227654 and r228493:
Relax XHCI timeouts which should fix enumeration issues.
Fix definition of XHCI port power bit.
Correct size of some USB 3.0 descriptor fields.
gabor [Sat, 31 Dec 2011 13:12:10 +0000 (13:12 +0000)]
MFC r228099:
- Create links to the xz and lzma versions even if BSD grep is not the
default. Nor GNU nor liblzma in base provides such functionality so
it may be useful.
MFC r228319:
- Match GNU behavior of exit code
- Rename variable that has a different meaning now
dim [Sat, 31 Dec 2011 12:58:21 +0000 (12:58 +0000)]
MFC r228540:
Since clang does not support the tls_model attribute used in malloc.c
yet (see LLVM PR 9788), and warns about it, rub it out for now. When
clang grows support for this attribute, I will revert this again.
dim [Sat, 31 Dec 2011 12:52:18 +0000 (12:52 +0000)]
MFC r228538:
In lib/libc/rpc/crypt_client.c, fix a clang warning about an implicit
conversion between enum desdir/desmode from include/rpc/des.h, and enum
desdir/desmode from include/rpcsvc/crypt.x. These are actually
different enums, with different value names, but by accident the integer
representation of the enum values happened to be the same.
dim [Sat, 31 Dec 2011 12:45:43 +0000 (12:45 +0000)]
MFC r228537:
Remove meaningless self-assignment in res_send.c, otherwise clang will
warn about it. I guess this was originally done to silence a bogus
warning by an older version of gcc, but I could not reproduce it with
any version of gcc that I have access to.
yongari [Sat, 31 Dec 2011 01:22:16 +0000 (01:22 +0000)]
MFC r226479:
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.
yongari [Sat, 31 Dec 2011 01:07:01 +0000 (01:07 +0000)]
MFC r226478:
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.
yongari [Sat, 31 Dec 2011 00:44:11 +0000 (00:44 +0000)]
MFC r226123:
BCE_MISC_ID register of BCM5716 returns the same id of BCM5709 so
remove explicit checks for BCM5716.
The BCM5709 and BCM5716 chips are virtually indistinguishable by
software except for the PCI device ID. The two chips differ in
that BCM5709 supports TCP/IP and iSCSI offload in Windows while
the BCM5716 doesn't.
While I'm here remove now unused definition of BCE_CHIP_NUM_5716
and BCE_CHIP_ID_5716_C0.