28 Jul, 2020
1 commit
-
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva
Link: https://lore.kernel.org/r/20200727190829.GA30332@embeddedor
Signed-off-by: Greg Kroah-Hartman
13 Apr, 2020
1 commit
-
The pointer 'w' is being initialized with a value that is never read
and it is being updated later with a new value. The initialization
is redundant and can be removed.Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King
Link: https://lore.kernel.org/r/20200405130619.377043-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman
20 Mar, 2020
1 commit
-
use netdev_err() which is a message printing function specific for network
devices instead of pr_err(), in function netlink_send().Signed-off-by: Lourdes Pedrajas
Link: https://lore.kernel.org/r/20200320003947.31726-1-lu@pplo.net
Signed-off-by: Greg Kroah-Hartman
24 Feb, 2020
1 commit
-
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:struct foo {
int stuff;
struct boo array[];
};By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.Also, notice that, dynamic memory allocations won't be affected by
this change:"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")Signed-off-by: Gustavo A. R. Silva
Link: https://lore.kernel.org/r/20200220132908.GA30501@embeddedor
Signed-off-by: Greg Kroah-Hartman
03 Apr, 2019
1 commit
-
There are a few remaining drivers/staging/*/Kconfig files that do not
have SPDX identifiers in them. Add the correct GPL-2.0 identifier to
them to make scanning tools happy.Signed-off-by: Greg Kroah-Hartman
22 Mar, 2019
1 commit
-
Remove print statements that provide information about error messages
when memory allocation is failed.
Issue found using coccinelle
The following semantic patch is used to solve this:@@
expression x;
constant char[] C;
identifier f;
@@x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|
usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));if(x==NULL)
{
...
(
-f(C,...);
|
-f(...,C);
)
...
}Signed-off-by: Bhanusree Pola
Acked-by: Julia Lawall
Signed-off-by: Greg Kroah-Hartman
21 Mar, 2019
1 commit
-
Rename member element dftEpsId to dft_eps_id to avoid camelcase.
checkpatch warning: Avoid CamelCase.Signed-off-by: Branden Bonaby
Signed-off-by: Greg Kroah-Hartman
18 Mar, 2019
1 commit
-
When the entire expression can be shown in the same line breaking it
makes it more difficult to read.Signed-off-by: Ignacio Losiggio
Signed-off-by: Greg Kroah-Hartman
11 Jul, 2018
1 commit
-
Variable idProduct and idVendor are being assigned but are never used
hence they are redundant and can be removed.Cleans up clang warnings:
warning: variable 'idProduct' set but not used [-Wunused-but-set-variable]
warning: variable 'idVendor' set but not used [-Wunused-but-set-variable]Signed-off-by: Colin Ian King
Signed-off-by: Greg Kroah-Hartman
17 Jun, 2018
1 commit
-
match_string() returns the index of an array for a matching string,
which can be used instead of open coded variant.Cc: Greg Kroah-Hartman
Cc: Quytelda Kahja
Cc: devel@driverdev.osuosl.org
Signed-off-by: Yisheng Xie
Signed-off-by: Greg Kroah-Hartman
26 Apr, 2018
2 commits
-
Now that the SPDX tag is in all gdm724x files, that identifies the
license in a specific and legally-defined manner. So the extra GPL text
wording can be removed as it is no longer needed at all.This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.Signed-off-by: Greg Kroah-Hartman
-
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.Fix up the all of the staging gdm724x files to have a proper SPDX
identifier, based on the license text in the file itself. The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.Cc: Thomas Gleixner
Cc: Kate Stewart
Cc: Philippe Ombredanne
Signed-off-by: Greg Kroah-Hartman
25 Apr, 2018
1 commit
-
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.Fix this by returning 'netdev_tx_t' in this driver too.
Signed-off-by: Luc Van Oostenryck
Signed-off-by: Greg Kroah-Hartman
23 Feb, 2018
3 commits
-
Mostly this change just reverses the primary conditional so most of
the code can be pulled back a tab, which fixes some code style
warnings.Signed-off-by: Quytelda Kahja
Signed-off-by: Greg Kroah-Hartman -
Since the testing for host endianness and in-driver conversion were
removed in 77e8a50149a2, the gdm_endian struct contains only one member,
and can therefore be simplified to a single u8 variable.Signed-off-by: Quytelda Kahja
Signed-off-by: Greg Kroah-Hartman -
Fix lines with a trailing open parenthesis, which is a coding style issue.
Signed-off-by: Quytelda Kahja
Signed-off-by: Greg Kroah-Hartman
20 Feb, 2018
5 commits
-
Remove the macro 'gdm_tty_send_control' which adds unnecessary complexity,
is unused, and has arguments that could mistakenly be evaluated multiple
times.Signed-off-by: Quytelda Kahja
Signed-off-by: Greg Kroah-Hartman -
Remove the macro 'gdm_tty_recv' which adds unnecessary complexity and has
arguments that could mistakenly be evaluated multiple times.Signed-off-by: Quytelda Kahja
Signed-off-by: Greg Kroah-Hartman -
Remove the macro 'gdm_tty_send' which adds unnecessary complexity and has
arguments that could mistakenly be evaluated multiple times.Signed-off-by: Quytelda Kahja
Signed-off-by: Greg Kroah-Hartman -
Check the return value of of the register_lte_tty_driver() call in the
module initialization function.Signed-off-by: Quytelda Kahja
Signed-off-by: Greg Kroah-Hartman -
Fix coding style warning from checkpatch.pl.
Signed-off-by: Quytelda Kahja
Signed-off-by: Greg Kroah-Hartman
14 Nov, 2017
1 commit
-
Pull staging and IIO updates from Greg KH:
"Here is the "big" staging and IIO driver update for 4.15-rc1.Lots and lots of little changes, almost all minor code cleanups as the
Outreachy application process happened during this development cycle.
Also happened was a lot of IIO driver activity, and the typec USB code
moving out of staging to drivers/usb (same commits are in the USB tree
on a persistent branch to not cause merge issues.)Overall, it's a wash, I think we added a few hundred more lines than
removed, but really only a few thousand were modified at all.All of these have been in linux-next for a while. There might be a
merge issue with Al's vfs tree in the pi433 driver (take his changes,
they are always better), and the media tree with some of the odd
atomisp cleanups (take the media tree's version)"* tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (507 commits)
staging: lustre: add SPDX identifiers to all lustre files
staging: greybus: Remove redundant license text
staging: greybus: add SPDX identifiers to all greybus driver files
staging: ccree: simplify ioread/iowrite
staging: ccree: simplify registers access
staging: ccree: simplify error handling logic
staging: ccree: remove dead code
staging: ccree: handle limiting of DMA masks
staging: ccree: copy IV to DMAable memory
staging: fbtft: remove redundant initialization of buf
staging: sm750fb: Fix parameter mistake in poke32
staging: wilc1000: Fix bssid buffer offset in Txq
staging: fbtft: fb_ssd1331: fix mirrored display
staging: android: Fix checkpatch.pl error
staging: greybus: loopback: convert loopback to use generic async operations
staging: greybus: operation: add private data with get/set accessors
staging: greybus: loopback: Fix iteration count on async path
staging: greybus: loopback: Hold per-connection mutex across operations
staging: greybus/loopback: use ktime_get() for time intervals
staging: fsl-dpaa2/eth: Extra headroom in RX buffers
...
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
20 Oct, 2017
2 commits
-
fix return codes in gdm_lte in gdm724x driver
Signed-off-by: Andrii Vladyka
Signed-off-by: Greg Kroah-Hartman -
check for skb->len in gdm_lte_emulate_arp in gdm724x driver
Signed-off-by: Andrii Vladyka
Signed-off-by: Greg Kroah-Hartman
06 Jul, 2017
1 commit
-
Pull networking updates from David Miller:
"Reasonably busy this cycle, but perhaps not as busy as in the 4.12
merge window:1) Several optimizations for UDP processing under high load from
Paolo Abeni.2) Support pacing internally in TCP when using the sch_fq packet
scheduler for this is not practical. From Eric Dumazet.3) Support mutliple filter chains per qdisc, from Jiri Pirko.
4) Move to 1ms TCP timestamp clock, from Eric Dumazet.
5) Add batch dequeueing to vhost_net, from Jason Wang.
6) Flesh out more completely SCTP checksum offload support, from
Davide Caratti.7) More plumbing of extended netlink ACKs, from David Ahern, Pablo
Neira Ayuso, and Matthias Schiffer.8) Add devlink support to nfp driver, from Simon Horman.
9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa
Prabhu.10) Add stack depth tracking to BPF verifier and use this information
in the various eBPF JITs. From Alexei Starovoitov.11) Support XDP on qed device VFs, from Yuval Mintz.
12) Introduce BPF PROG ID for better introspection of installed BPF
programs. From Martin KaFai Lau.13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann.
14) For loads, allow narrower accesses in bpf verifier checking, from
Yonghong Song.15) Support MIPS in the BPF selftests and samples infrastructure, the
MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David
Daney.16) Support kernel based TLS, from Dave Watson and others.
17) Remove completely DST garbage collection, from Wei Wang.
18) Allow installing TCP MD5 rules using prefixes, from Ivan
Delalande.19) Add XDP support to Intel i40e driver, from Björn Töpel
20) Add support for TC flower offload in nfp driver, from Simon
Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub
Kicinski, and Bert van Leeuwen.21) IPSEC offloading support in mlx5, from Ilan Tayari.
22) Add HW PTP support to macb driver, from Rafal Ozieblo.
23) Networking refcount_t conversions, From Elena Reshetova.
24) Add sock_ops support to BPF, from Lawrence Brako. This is useful
for tuning the TCP sockopt settings of a group of applications,
currently via CGROUPs"* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits)
net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap
dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap
cxgb4: Support for get_ts_info ethtool method
cxgb4: Add PTP Hardware Clock (PHC) support
cxgb4: time stamping interface for PTP
nfp: default to chained metadata prepend format
nfp: remove legacy MAC address lookup
nfp: improve order of interfaces in breakout mode
net: macb: remove extraneous return when MACB_EXT_DESC is defined
bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case
bpf: fix return in load_bpf_file
mpls: fix rtm policy in mpls_getroute
net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t
net, ax25: convert ax25_route.refcount from atomic_t to refcount_t
net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t
net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t
net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t
net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t
net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t
net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t
...
16 Jun, 2017
1 commit
-
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.An spatch similar to the one for skb_put_zero() converts many
of the places using it:@@
identifier p, p2;
expression len, skb, data;
type t, t2;
@@
(
-p = skb_put(skb, len);
+p = skb_put_data(skb, data, len);
|
-p = (t)skb_put(skb, len);
+p = skb_put_data(skb, data, len);
)
(
p2 = (t2)p;
-memcpy(p2, data, len);
|
-memcpy(p, data, len);
)@@
type t, t2;
identifier p, p2;
expression skb, data;
@@
t *p;
...
(
-p = skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
|
-p = (t *)skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
)
(
p2 = (t2)p;
-memcpy(p2, data, sizeof(*p));
|
-memcpy(p, data, sizeof(*p));
)@@
expression skb, len, data;
@@
-memcpy(skb_put(skb, len), data, len);
+skb_put_data(skb, data, len);(again, manually post-processed to retain some comments)
Reviewed-by: Stephen Hemminger
Signed-off-by: Johannes Berg
Signed-off-by: David S. Miller
03 Jun, 2017
1 commit
-
This patch fixes the following checkpatch.pl warning in gdm_usb.c:
WARNING: suspect code indent for conditional statements (8, 12)Signed-off-by: Mart Lubbers
Signed-off-by: Greg Kroah-Hartman
28 Apr, 2017
1 commit
-
Make sure to deregister the USB driver before releasing the tty driver
to avoid use-after-free in the USB disconnect callback where the tty
devices are deregistered.Fixes: 61e121047645 ("staging: gdm7240: adding LTE USB driver")
Cc: stable # 3.12
Cc: Won Kang
Signed-off-by: Johan Hovold
Signed-off-by: Greg Kroah-Hartman
16 Mar, 2017
1 commit
-
Fixes the checkpatch.pl warning: Avoid CamelCase
Signed-off-by: Aya Mahfouz
Signed-off-by: Greg Kroah-Hartman
10 Mar, 2017
1 commit
-
Use macro min() to get the minimum of two values for
brevity and readability. The macro MUX_TX_MAX_SIZE
has a value of 2048 which is well within the integer
limits. This check was done manually.Found using Coccinelle:
@@ type T; T x; T y; @@
(
- x < y ? x : y
+ min(x,y)
|
- x > y ? x : y
+ max(x,y)
)Signed-off-by: Gargi Sharma
Signed-off-by: Greg Kroah-Hartman
06 Mar, 2017
2 commits
-
Removed initialisation of a varible if it is immediately reassigned.
Changes were made using Coccinelle.
@@
type T;
constant C;
expression e;
identifier i;
@@
T i
- = C
;
i = e;Signed-off-by: simran singhal
Signed-off-by: Greg Kroah-Hartman -
The icmp6_checksum was returning an invalid data type as the expected type
is __sum16. For returning such data type, icmp6_checksum, now, is using
the kernel functions for computing the checksum.Here, the sparse message:
drivers/staging/gdm724x/gdm_lte.c:311:39: warning: incorrect type in assignment (different base types)
drivers/staging/gdm724x/gdm_lte.c:311:39: expected restricted __sum16 [addressable] [assigned] [usertype] icmp6_cksum
drivers/staging/gdm724x/gdm_lte.c:311:39: got intSigned-off-by: Javier Rodriguez
Signed-off-by: Greg Kroah-Hartman
09 Feb, 2017
2 commits
-
Fix sparse warning issue.
drivers/staging/gdm724x/gdm_lte.c:201:33: warning: incorrect type in assignment (different base types)
drivers/staging/gdm724x/gdm_lte.c:201:33: expected unsigned int [unsigned] [addressable] [usertype] ph_len
drivers/staging/gdm724x/gdm_lte.c:201:33: got restricted __be16 [usertype] payload_lenSigned-off-by: Javier Rodriguez
Signed-off-by: Greg Kroah-Hartman -
The find_dev_index() function is frustrating. If you give it an invalid
index then it returns 0. That was the intent except there is an
off-by-one so it can return MAX_NIC_TYPE which is one higher than we
want.There is one caller which had a sanity check to catch invalid returns,
but the other two callers assumed that index was valid.My feeling is that when we are given invalid indexes, that should be
treated like an error and we abandon what we were doing.Signed-off-by: Dan Carpenter
Signed-off-by: Greg Kroah-Hartman
08 Jan, 2017
1 commit
-
Refactor code to remove multi-line derefs and code duplication
Signed-off-by: Emil Gedda
Signed-off-by: Greg Kroah-Hartman
06 Jan, 2017
1 commit
-
Update the driver's HCI structs and associated endian-converter
functions with new driver-specific bitwise types. The new types
encourage correct endian-handling within the driver by triggering
sparse warnings when mixing with other types. The driver's
endian-converters provide correct and warning-free conversions.Driver-specific bitwise types are used instead of the standard
endian-specific types because the attached device can be of either
endian. This is also why the driver has its own endian-conversion
functions, which consider endianness of both the cpu and the attached
device.Introducing the new types to the converters fixes the sparse warnings:
CHECK drivers/staging/gdm724x/gdm_endian.c
drivers/staging/gdm724x/gdm_endian.c:28:24: warning: incorrect type in return expression (different base types)
drivers/staging/gdm724x/gdm_endian.c:28:24: expected unsigned short
drivers/staging/gdm724x/gdm_endian.c:28:24: got restricted __le16 [usertype]
drivers/staging/gdm724x/gdm_endian.c:30:24: warning: incorrect type in return expression (different base types)
drivers/staging/gdm724x/gdm_endian.c:30:24: expected unsigned short
drivers/staging/gdm724x/gdm_endian.c:30:24: got restricted __be16 [usertype]
drivers/staging/gdm724x/gdm_endian.c:36:24: warning: cast to restricted __le16
drivers/staging/gdm724x/gdm_endian.c:38:24: warning: cast to restricted __be16
drivers/staging/gdm724x/gdm_endian.c:44:24: warning: incorrect type in return expression (different base types)
drivers/staging/gdm724x/gdm_endian.c:44:24: expected unsigned int
drivers/staging/gdm724x/gdm_endian.c:44:24: got restricted __le32 [usertype]
drivers/staging/gdm724x/gdm_endian.c:46:24: warning: incorrect type in return expression (different base types)
drivers/staging/gdm724x/gdm_endian.c:46:24: expected unsigned int
drivers/staging/gdm724x/gdm_endian.c:46:24: got restricted __be32 [usertype]
drivers/staging/gdm724x/gdm_endian.c:52:24: warning: cast to restricted __le32
drivers/staging/gdm724x/gdm_endian.c:54:24: warning: cast to restricted __be32Signed-off-by: Eric S. Stone
Signed-off-by: Greg Kroah-Hartman
30 Nov, 2016
2 commits
-
Remove one blank line in sequence of two empty lines.
Signed-off-by: Dawid Kurek
Signed-off-by: Greg Kroah-Hartman -
Align parameters to open parenthesis.
Signed-off-by: Dawid Kurek
Signed-off-by: Greg Kroah-Hartman
16 Sep, 2016
1 commit
-
This patch fixes the checkpatch.pl warning:
CHECK: Please don't use multiple blank linesSigned-off-by: Rehas Sachdeva
Signed-off-by: Greg Kroah-Hartman