| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is using the following semantic patch:
@bind@
type T;
expression A, C;
struct sockaddr *B;
@@
- bind(A, (struct sockaddr *) B, C)
+ bind(A, B, C)
@bind_in@
type T;
expression A, C;
struct sockaddr_in *B;
@@
- bind(A, (struct sockaddr *) B, C)
+ bind(A, B, C)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Arguably useful in documenting the return value is intentionally ignored
I think it's just cluttering the screen.
This is using the following semantic patch:
@castvoid@
expression F;
@@
- (void) F
+ F
(...)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is using the following semantic patch:
@send@
type T;
expression A, B, C, D;
@@
- send(A, (T *)B, C, D)
+ send(A, B, C, D)
@sendto1@
type T;
expression A, B, C, D, E, F;
@@
- sendto(A, (T *)B, C, D, E, F)
+ sendto(A, B, C, D, E, F)
@sendto2@
type T;
expression A, B, C, D, F;
struct sockaddr *E;
@@
- sendto(A, B, C, D, (struct sockaddr *) E, F)
+ sendto(A, B, C, D, E, F)
@sendmsg@
type T;
expression A, B, C;
@@
- sendmsg(A, (T *)B, C)
+ sendmsg(A, B, C)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is using the following semantic patch:
@memset@
type T;
expression A, B, C;
@@
- memset((T *)A, B, C)
+ memset(A, B, C)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is using the following semantic patch:
@memcpy1@
type T;
expression A, B, C;
@@
- memcpy((T *)A, B, C)
+ memcpy(A, B, C)
@memcpy2@
type T;
expression A, B, C;
@@
- memcpy(A, (T *)B, C)
+ memcpy(A, B, C)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hex2intrev is a hilariously complicated function which combine parsing
a hexadecimal integer in network byte order and swapping the result to
host byte order.
Move the endianess swapping to the caller which allows to remove double
endianess swapping. Now that hex2intrev no longer deals with byte
order rename it to hex2int and replace its implementation with a simple
invocation of strtoul.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
| |
Unsigned long is wasteful on 64 bit.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
| |
An IPv4 mask fit into an unsigned int.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
| |
An IPv4 address or mask fits into an unsigned int.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Somewhat hard to read and the code base already has many overlong
lines.
Found with below spatch file and some manual editing in ax25/access.c
to restore a comment lost by spatch.
@parens@
expression E, F, G;
binary operator X;
statement S;
@@
- if ((E = F) X G)
+ E = F;
+ if (E X G)
S
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
| |
In particular this remove reliance on how file descriptors are assigned
and ensures we don't pass an unnecessarily high nfds argument to select.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc -g -O2 -Wall -o axspawn axspawn.o access.o md5.o -lax25 -lutil
gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/us
r/local/var/ax25/"\" -g -O2 -Wall -MT axwrapper.o -MD -MP -MF .deps/axwrapper.Tpo -c -o axwrapper.o axwrapper.c
axwrapper.c:49:13: warning: ‘sigchld_handler’ defined but not used [-Wunused-function]
static void sigchld_handler(int sig)
^~~~~~~~~~~~~~~
Since 71918b7d4e95 ("axwrapper: Mark functions sigchld_handler and
convert_{cr_lf,lf_cr} static.") made sigchld_handler() static gcc was
warning about the function being unused. No point in keeping this around;
SIGCHLD is perfectly fine.
Fixes: 71918b7d4e95 ("axwrapper: Mark functions sigchld_handler and convert_{cr_lf,lf_cr} static.")
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
| |
No files were listed in the FILES section.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When printing an error message for configurations using particularly
long file names a buffer overflow may occur potencially resulting in
malfunction or crash.
This fixes the following GCC 7.1.1 warnings:
gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/us
r/local/var/ax25/"\" -g -O2 -Wall -MT kissnetd.o -MD -MP -MF .deps/kissnetd.Tpo -c -o kissnetd.o kissnetd.c
kissnetd.c: In function ‘main’:
kissnetd.c:124:38: warning: ‘%s’ directive writing up to 4095 bytes into a region of size 66 [-Wformat-overflow=]
sprintf(MyString, "cannot reopen %s", PortList[PortNumber]->Name);
^~
kissnetd.c:124:5: note: ‘sprintf’ output between 15 and 4110 bytes into a destination of size 80
sprintf(MyString, "cannot reopen %s", PortList[PortNumber]->Name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kissnetd.c:143:49: warning: ‘%s’ directive writing up to 4095 bytes into a region of size 55 [-Wformat-overflow=]
sprintf(MyString, "Cannot unlock pts-device %s\n", PortList[PortNumber]->namepts);
^~
kissnetd.c:143:5: note: ‘sprintf’ output between 27 and 4122 bytes into a destination of size 80
sprintf(MyString, "Cannot unlock pts-device %s\n", PortList[PortNumber]->namepts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kissnetd.c:154:50: warning: ‘%s’ directive writing up to 4095 bytes into a region of size 54 [-Wformat-overflow=]
sprintf(MyString, "cannot reopen ptmx (slave %s).", PortList[PortNumber]->namepts);
^~
kissnetd.c:154:5: note: ‘sprintf’ output between 29 and 4124 bytes into a destination of size 80
sprintf(MyString, "cannot reopen ptmx (slave %s).", PortList[PortNumber]->namepts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
malloc returns a void pointer so no cast is necessary when
assigning to a pointer type.
Found with below coccinelle script:
@malloccast@
type T;
@@
- (T *)
malloc(...)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
| |
For one strlen does not return any errors. By its very nature strlen
does not return negative results and its return type is size_t which
happens to be unsigned.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -Wextra -MT mheard.o -MD -MP -MF .deps/mheard.Tpo -c -o mheard.o mheard.c
[...]
mheard.c:135:22: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (pr->entry.type < 0 || pr->entry.type > sizeof(types))
^
mheard.c:168:22: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (pr->entry.type < 0 || pr->entry.type > sizeof(types))
^
[...]
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/va
r/ax25/"\" -O2 -Wall -pedantic -MT netromt.o -MD -MP -MF .deps/netromt.Tpo -c -o netromt.o netromt.c
In file included from netromt.c:24:0:
netromt.c: In function ‘build_header’:
netromd.h:10:19: warning: overflow in implicit constant conversion [-Woverflow]
#define NODES_SIG 0xFF
^
netromt.c:28:15: note: in expansion of macro ‘NODES_SIG’
message[0] = NODES_SIG;
^~~~~~~~~
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT mkiss.o -MD -MP -MF .deps/mkiss.Tpo -c -o mkiss.o mkiss.c
mkiss.c: In function ‘poll’:
mkiss.c:67:15: warning: overflow in implicit constant conversion [-Woverflow]
#define FEND 0300 /* Frame End (0xC0) */
^
mkiss.c:148:14: note: in expansion of macro ‘FEND’
buffer[0] = FEND;
^~~~
mkiss.c:67:15: warning: overflow in implicit constant conversion [-Woverflow]
#define FEND 0300 /* Frame End (0xC0) */
^
mkiss.c:150:14: note: in expansion of macro ‘FEND’
buffer[2] = FEND;
^~~~
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
| |
rsmemsiz.c: In function ‘main’:
rsmemsiz.c:139:11: warning: ‘uptime_secs’ may be used uninitialized in this function [-Wmaybe-uninitialized]
updays = (int) uptime_secs / (60*60*24);
^~~~~~~~~~~~~~~~~
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
| |
rsuplnk.c: In function ‘main’:
rsuplnk.c:262:17: warning: overflow in implicit constant conversion [-Woverflow]
buffer[0] = 0xF0;
^~~~
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
|
|
|
| |
user_io.c
user_io.c: In function ‘flush_output’:
user_io.c:70:7: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
buf += paclen_out;
^~
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
| |
Expand the one remaining invocation to FILE_TO_BUF(), then fix the
return type and attempt to close fd -1 and format nicely.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
|
| |
Now that uptime() is only used to obtain the load average it's trivial to
replace.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
| |
We don't use this information anyway later on.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
| |
And add proper declarations to the header file.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
|
|
| |
And then delete those now useless declarations.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|
|
|
|
| |
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
|