Commit Graph

284364 Commits

Author SHA1 Message Date
nakayama
268efe53aa The "available" property requires a variable length buffer, so
leave free(9) until prom_getprop is changed to use kmem_alloc(9)
instead of malloc(9).
2021-01-07 07:40:39 +00:00
rillig
7d8d33cba8 lint: add tests for messages 93, 94, 95, 96, 97, 98, 99 2021-01-07 00:38:46 +00:00
ginsbach
4b5ddda496 df: bump man page date 2021-01-06 20:38:09 +00:00
palle
d4df58243d psycho: explicit allocation of memory using kmem(9) instead of using the buffer indirectly allocted in the prom_getprop() function (which is still using malloc(9) for memory allocation 2021-01-06 20:04:30 +00:00
wiz
2e256d9d5b Simplify macro usage. 2021-01-06 18:05:58 +00:00
pgoyette
386ae5b46e Grammar fix for the grammer fix. Plural subject needs plural verb. :) 2021-01-06 17:22:36 +00:00
kre
f9167198aa Minor grammar fix, more markup, and update date (Dd). 2021-01-06 17:13:23 +00:00
wiz
f77ed54857 Add some paragraph breaks. 2021-01-06 14:07:43 +00:00
jandberg
b614bd0aac Implement the WSDISPLAYIO_GET_FBINFO ioctl, needed by X wsfb driver. 2021-01-06 13:00:51 +00:00
wiz
99fedf3d5f Markup improvements and typo fixes. 2021-01-06 10:19:27 +00:00
rillig
1aa2d3570d lint: fix test for message 324 on i386
i386 is an ILP32 platform (arch/i386/targparam.h).  On these platforms,
int and long have the same size, and even with the -p option for
portability checks, INT_RSIZE in inittyp.c is defined to 4, not 3.

Because of this, in check_integer_conversion, psize(nt) was not greater
than psize(ot), and the warning was not issued.

To make the test behave the same on all platforms, changed the long
variables to long long, since long long is 64-bit on all platforms, and
int is 32-bit.
2021-01-06 09:23:04 +00:00
lukem
5650392b38 ftp(1): fix description of "debug"
"debug" command and documentation got accidentally renamed
to "ftp_debug" 13 years ago, and was only partially fixed.
2021-01-06 09:15:59 +00:00
rin
7f00a9aa4e Drop unused headers. No functional changes intended. 2021-01-06 08:17:46 +00:00
rin
a07603df51 Switch DDB for powerpc/booke into SOFTWARE_SSTEP.
SR_SINGLESTEP aka PSL_SE bit in MSR is only available for oea, and HW
debug facilities for booke are significantly different from oea.
2021-01-06 08:14:34 +00:00
rin
04d12c4699 Sort headers. No functional changes intended. 2021-01-06 08:07:36 +00:00
rin
c0ef0c79a0 Sort headers. Also, use <ddb/ddb.h> instead of db_interface.h and
db_machdep.h in order not to be bothered by subtle include order.

No functional changes intended.
2021-01-06 08:04:57 +00:00
rin
8ef35a2e18 Fix pmap_procwr() for powerpc/booke:
- Use PAGE_MASK, not PAGE_SIZE, to calculate page offset.
- Do not drop page offset of target address.
2021-01-06 07:56:19 +00:00
lukem
920389c199 ftp: don't use restartable signals
Refactor to not rely upon restartable signals (SA_RESTART),
possibly fixing intermittent failures with -q QUITTIME.

ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
instead of relying upon restartable signals.

http/https transfers: Explicitly print an error similar to
progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
and set errno to ETIMEDOUT so that the warn() in fetch_url()
prints a more accurate error message.

PR/55857
2021-01-06 04:43:14 +00:00
rillig
bd9b719c88 lint: clean up generation of the operator tables
Instead of running a shell program that runs an AWK program that
generates the two files ops.c and ops.h, just define the operator tables
once in ops.def and use these definitions flexibly in ops.c and op.h.
2021-01-05 23:50:29 +00:00
rillig
15275571de lint: remove redundant symbolic operator names
These symbolic names for INCBEF, INCAFT, DECBEF and DECAFT were
non-standard and thus confusing.  All other operators were as expected.
Now that the operator names from ops.def are very similar, there is no
need to keep to almost identical lists around.

No change to the user-visible messages since the only place where these
operator names were used was in 324, and that message was restricted to
PLUS, MINUS, MULT and SHL.
2021-01-05 23:20:53 +00:00
rillig
b8104292aa lint: clean up symbolic operator names that are used in the messages
Including the "p" in the symbolic operator names was questionable, for
several reasons:

1.  The "p" could be taken to mean an actual variable name, which is
    confusing if the function doesn't have such a variable, or even more
    so if the line contains an unrelated variable called "p".

2.  For the binary operators, having the "p" mentioned on both sides of
    the operator (such as in "p + p") wrongly suggested that both
    operands of the expression were the same.

3.  The name "p" often stands for a pointer.  Most of the operators
    don't accept pointers, therefore the name was misleading.

For these reasons, the "p" was removed from the symbolic name of all
operators.  This makes several pairs of operators indistinguishable:

    INCBEF == INCAFT
    DECBEF == DECAFT
    UPLUS == PLUS
    UMINUS == MINUS
    STAR == MULT
    AMPER == AND

This is not expected to create any confusion since C programmers are
expected to know these double meanings.

The symbolic names for SHLASS and SHRASS were missing the '=' before.
This was added since omitting it was probably an oversight.
2021-01-05 23:07:49 +00:00
rillig
3796e6d449 lint: add test for "suggest cast" [324]
This warning is the only one that calls print_tnode, which in turn uses
the redundant operator names in str_op_t.

There is another list of operator names in ops.c, but those names
include more clutter, for example "p + p" instead of a simple "+".
Using those operator names would therefore rather be confusing. These
two lists should be merged, to remove unnecessary redundancy.
2021-01-05 22:38:51 +00:00
mlelstv
a1d6d60c3f Explain wedge auto discovery. 2021-01-05 22:17:40 +00:00
rillig
40291d99b5 lint: swap columns 1 and 2 in ops.def
List the ID of a record first, followed by the describing fields.
2021-01-05 21:40:42 +00:00
rillig
bb3299716f lint: make generating the operators table simpler
The generated files are exactly the same as before.
2021-01-05 21:32:47 +00:00
skrll
4db86d3d06 More converstion from usbd_status to int for function error reporting.
This time it's the turn of usb_allocmem.
2021-01-05 18:00:21 +00:00
rillig
701a9913ea lint: make check_precedence_confusion simpler
In C, only binary operators have possibly confusing precedence.  All
binary operators have lower precedence than an explicit cast.  When an
expression is parsed, the parentheses are associated with the innermost
possible node.  This means that as soon as a cast operator is
parenthesized, its contained expression can no longer have confusing
precedence.

This allows the code to be written more succinct since the local
variables are no longer necessary.
2021-01-05 17:37:57 +00:00
rillig
09a0c30431 lint: in debug mode, log every newline
This helps to quickly see where in the source file the parser currently
is.  Previously, the parsing position was only printed after each
declaration, as part of "clear flags".
2021-01-05 17:13:44 +00:00
rillig
77051f68d6 lint: fix inconsistent whitespace in ops.def 2021-01-05 16:34:37 +00:00
skrll
3b279b2e71 Misc KNF. NFCI. 2021-01-05 16:30:37 +00:00
skrll
a15c9db76d Replace home grown #ifdef DIAGNOSTIC check with ASSERT_SLEEPABLE 2021-01-05 16:15:09 +00:00
simonb
76c08b0f65 Use the compat machinery to build "native" IPF binaries as ipfilter
doesn't use compat32 64-bit alignment/size safe structures.

Fixes IPF on at least mips64.
2021-01-05 11:07:59 +00:00
rillig
be58920ae9 lint: add missing strings for operators
It's difficult to keep these lists in sync when they are spread over
several files.  The lists had been inconsistent since 2008-04-26.  The
inconsistency didn't lead to undefined behavior though since the
operator names are only used in 2 places:

1. check_integer_conversion in message 324 only calls that function with
a few selected operators, all of which are above the missing ones.

2. mkinit prints the node including its operator, but only in debug
mode.  Furthermore I'm not sure whether any of the broken operator names
could ever be accessed at this place since mkinit is only called for
expressions, and the node types are INIT, CASE, FARG, which are all
special.
2021-01-05 07:37:41 +00:00
rillig
3b9b565485 lint: clean up comments 2021-01-05 00:22:04 +00:00
rillig
870d1f87f1 lint: extract code for determining possible precedence confusion
The function check_precedence_confusion was pretty long, and right in
the middle of that function was the complicated part of determining
which of the operand combinations are confusing and which aren't.

Extract this part into a separate function to document on which
information this decision is based.  This makes it easier to understand
the code since there are fewer local variables around.

As a left-over from a previous commit, rop and rparn don't need to be
initialized twice, now that the assertion for a binary operator is in
place.

Remove the large and useless switch statement over all operator types.
This list was completely unsorted, for no apparent reason.  To see the
list of operators, better look them up in ops.def, there was no need to
have this list duplicated here.
2021-01-05 00:17:21 +00:00
rillig
6e4e9ad1dc lint: remove unused TBUILTIN_SIZEOF from the C grammar
This token is not generated by the lexer, and it was misspelled anyway.
All other token names start with "T_", this one was missing the
underscore.
2021-01-05 00:02:52 +00:00
rillig
8f289eec5d lint: precedence confusion is only possible with binary operators
No functional change.

The operator table in ops.def states that every operator that has
possibly confusing precedence is also a binary operator, so assert that
instead of having two different code paths.
2021-01-04 23:58:19 +00:00
rillig
9a3fecd259 lint: fix bug in "precedence confusion possible [169]" 2021-01-04 23:50:46 +00:00
rillig
6c2a2c1402 lint: document and demonstrate the bug in check_precedence_confusion
It took quite a while to get to the correct interpretation of this small
piece of code and to draw the right conclusions from it.  Now the bug is
finally ready to be fixed, as already announced in the test.
2021-01-04 23:47:26 +00:00
rillig
fb2d84bf80 lint: add more rationale for removing effect-less code 2021-01-04 23:17:03 +00:00
rillig
8f3340157a lint: finish the comments in check_precedence_confusion 2021-01-04 22:41:56 +00:00
rillig
796f8d840b lint: replace LERROR with lint_assert in check_expr_misc
This reduces the visual clutter.  There is no reason for anyone to
modify the code around the CALL operator, therefore the assertion is not
expected to fail anytime soon.
2021-01-04 22:33:47 +00:00
rillig
4c2e526843 lint: reduce comment for xgetblk to the actually interesting part 2021-01-04 22:29:00 +00:00
rillig
0935430d9a lint: fix typos and other minor stylistic issues 2021-01-04 22:26:50 +00:00
thorpej
614805fdc6 Rename tsl256x.c -> tsllux.c. No other changes are made by this commit. 2021-01-04 22:09:35 +00:00
thorpej
08733279a9 Tweak register bit names, in preparation for supporting younger siblings
of this chip.
2021-01-04 21:59:48 +00:00
rillig
c48d8a0ff1 lint: fix bugs in dprint_node in debug mode (since today)
The node was dereferenced before the null check.  GCC 5.5 didn't warn
about this obvious bug, not even with -Wall -Wextra -O2.  Such a case
didn't occur though in the few tests that this function was used in.

The indentation for the nested nodes only needs to be set for a few
lines of code, make this region as small as possible.

There are nodes that use both tn_left and tn_right, even though they are
not defined as binary operators.  An example is CALL, for which tn_left
is the address of the function name and tn_right, which are the
arguments, linked via PUSH nodes.  CALL is not a binary operator since
it doesn't do any calculations with its arguments.
2021-01-04 21:30:06 +00:00
rillig
4f7d5d5f25 lint: move dprint_node to the top of the file
It now resides right below dumpnode, which implements the same idea but
uses a fixed-size output buffer and prints everything in a single line,
which quickly gets hard to read.  Maybe that's the reason why it had
been commented out since it got added in 2014.
2021-01-04 21:17:31 +00:00
pgoyette
b5cd926b3f Better grammar. 2021-01-04 18:27:46 +00:00
riastradh
3b80deb3da dev/ic/tpm: Take advantage of entropy source if available.
If the tpm is deactivated, though, detach the entropy source so we
don't continue to try polling it -- it can't be activated without a
reboot anyway.
2021-01-04 18:26:59 +00:00