kib [Mon, 2 Jan 2012 00:04:51 +0000 (00:04 +0000)]
MFC r228751:
Change the type of real_dev_bsize variable from long to u_int.
The DIOCGSECTORSIZE takes u_int * as an argument, using long *
causes failures on big-endian targets.
dim [Sun, 1 Jan 2012 23:53:16 +0000 (23:53 +0000)]
MFC r228722:
In usr.sbin/yp_mkdb/yp_mkdb.c, cast some printf field width parameters
to int, cast time_t to intmax_t, and use the corresponding printf length
modifier.
kib [Sun, 1 Jan 2012 23:51:18 +0000 (23:51 +0000)]
MFC r228306:
Most users of pipe(2) do not call fstat(2) on the returned pipe descriptors.
Optimize for the case, by lazily allocating the pipe inode number at the
fstat(2) time.
dim [Sun, 1 Jan 2012 23:49:11 +0000 (23:49 +0000)]
MFC r228714:
In usr.sbin/timed, fix several issues with printf formats:
- Cast time_t's to long, and print them with %ld.
- Print ptrdiff_t's with %td.
- Print ssize_t's and size_t's with %zd and %zu.
- Print int32_t's with %d.
Also, replace some int variables with the more appropriate size_t.
MFC r228719:
Some people pointed out long is 32-bit on some arches, while time_t is
64-bit, so better cast time_t to intmax_t, and use the appropriate
printf format strings.
MFC r228720:
Fix r228719; when you use intmax_t, you need stdint.h.
dim [Sun, 1 Jan 2012 23:45:21 +0000 (23:45 +0000)]
MFC r228713:
In contrib/tcpdump/print-icmp6.c, fix a problem where the comparison
against icmp6_hdr::icmp6_type is done incorrectly. (This fix has
already been applied upstream, but we do not have the latest version of
tcpdump.)
dim [Sun, 1 Jan 2012 23:39:56 +0000 (23:39 +0000)]
MFC r228678:
In usr.sbin/rpc.ypupdated/yp_dbupdate.c, use the appropriate printf
length modifier for time_t (after casting it to intmax_t).
MFC r228679:
In usr.sbin/rpc.ypupdated/yp_dbupdate.c, include stdint.h, so intmax_t
is known, otherwise it won't build.
Pointy hat to: dim
MFC r228680:
In usr.sbin/rpc.ypupdated/yp_dbupdate.c, since intmax_t is signed, just
like time_t, better use %jd instead of %ju. Strangely enough, neither
gcc, clang nor gcc 4.6 warn about this discrepancy...
kib [Sun, 1 Jan 2012 23:34:06 +0000 (23:34 +0000)]
MFC r227656:
Use the alternate form of the gcc extension that works even with
-ansi -pedantic without issuing a warning, and which is recommended
by gcc manual.
kib [Sun, 1 Jan 2012 23:12:43 +0000 (23:12 +0000)]
MFC r227696:
Do not use NULLVPTOLOWERVP() in the null_print(). If diagnostic is compiled
in, and show vnode is used from ddb on the faulty nullfs vnode, we get
panic instead of vnode dump.
dim [Sun, 1 Jan 2012 23:08:19 +0000 (23:08 +0000)]
MFC r228665:
Use NO_WCAST_ALIGN for usr.sbin/ndiscvt; because this is only built for
x86, any alignment warnings can be safely ignored. Define YY_NO_INPUT
in usr.sbin/ndiscvt/inf-token.l, so no unused lex functions are defined.
dougb [Sun, 1 Jan 2012 22:33:02 +0000 (22:33 +0000)]
MFC r228909:
1. Remove a bunch of duplicates. Usually this means removing them from
fortunes, but occasionally remove them from the other 2 files when
they are not offensive, or not murphy'ish enough.
Where the version in fortunes had better attribution and/or formatting,
copy it over.
2. Fix a few typos
3. Use the full name of François De La Rochefoucauld, fix one of his
quotes, and remove the duplicate of it.
MFC r228934:
Prefer ASCII apostrophes over Unicode ones like the rest of the file.
MFC r228938:
1. Correct capitalization of the nobility particle for
Francois de La Rochefoucauld introduced in r228909
2. Change c-cedilla introduced in the same commit to ASCII c since
non-UTF-8 terminals will choke on the non-ASCII text.
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.