aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/gdm724x (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-07-05Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds1-16/+9
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 ...
2017-06-16networking: introduce and use skb_put_data()Johannes Berg1-16/+9
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 <stephen@networkplumber.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-03Staging: gdm724x: Change spaces to tabsMart Lubbers1-4/+4
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 <mart@martlubbers.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: gdm724x: gdm_mux: fix use-after-free on module unloadJohan Hovold1-2/+1
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 <stable@vger.kernel.org> # 3.12 Cc: Won Kang <wkang77@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16staging: gdm724x: fix checkpatch.pl camelCase warningAya Mahfouz1-1/+1
Fixes the checkpatch.pl warning: Avoid CamelCase Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: gdm724x: Replace ternary operator with min macroGargi Sharma1-2/+1
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 <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: gdm724x: Drop useless initialisationsimran singhal2-3/+3
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 <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: gdm724x: modify icmp6_checksum for returning a correct data type.Javier Rodriguez1-9/+6
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 int Signed-off-by: Javier Rodriguez <jrodbar@yahoo.es> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: gdm724x: fix incorrect type in assignmentJavier Rodriguez1-1/+1
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_len Signed-off-by: Javier Rodriguez <jrodbar@yahoo.es> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: gdm724x: fix a couple array overflowsDan Carpenter1-10/+14
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 <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-07staging: gdm724x: cleanup long lines to conform to kernel coding styleEmil Gedda1-17/+10
Refactor code to remove multi-line derefs and code duplication Signed-off-by: Emil Gedda <emil.gedda@emilgedda.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05staging: gdm724x: update HCI structs with new bitwise typesEric S. Stone3-39/+46
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] <noident> 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] <noident> 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] <noident> 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] <noident> 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 __be32 Signed-off-by: Eric S. Stone <esstone@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-29staging: gdm724x: Remove one blank line in sequenceDawid Kurek1-1/+0
Remove one blank line in sequence of two empty lines. Signed-off-by: Dawid Kurek <dawikur@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-29staging: gdm724x: Align parameters to parenthesisDawid Kurek2-8/+9
Align parameters to open parenthesis. Signed-off-by: Dawid Kurek <dawikur@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: gdm724x: Remove unnecessary blank lineRehas Sachdeva1-1/+0
This patch fixes the checkpatch.pl warning: CHECK: Please don't use multiple blank lines Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13staging: gdm724x: Add spaces around the '*' operatorsayli karnik2-5/+5
This patch fixes the checkpatch.pl warning: Spaces required around the '*' operator. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12staging: gdm724x: gdm_lte: Constify gdm_netdev_opsImre Deak1-1/+1
Fix the following checkpatch.pl warning: WARNING: struct net_device_ops should normally be const +static struct net_device_ops gdm_netdev_ops = { Signed-off-by: Imre Deak <imre.deak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21Staging: gdm724x: gdm_tty: Fixed a checkpatch check issue.Samuele Baisi1-1/+0
Removed a blankline after an opening bracket. Signed-off-by: Samuele Baisi <ciccio87@gmail.com> Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: gdm724x: Replace semaphore netlink with mutexBinoy Jayan1-10/+1
Replace semaphore netlink_mutex with mutex. Semaphores are going away in the future. Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: gdm724x: gdm_usb: Remove ignored valueLuis de Bethencourt1-4/+4
The value assigned to ret will be overwritten before it could be read in a future iteration of the loop. Removing the unnecessary assignment. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging/gdm724x: fix "alignment should match open parenthesis" issuesBruno Carvalho2-3/+5
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis" Signed-off-by: Bruno Carvalho <brunocarvalhofarias@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging/gdm724x: Fix avoid CamelCaseBruno Carvalho2-4/+4
Fix checkpatch issues: "CHECK: Avoid CamelCase" Signed-off-by: Bruno Carvalho <brunocarvalhofarias@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05Staging: gdm724x: Replace random_ether_addr with eth_random_addrBhumika Goyal1-1/+1
The macro random_ether_addr is calling the function eth_random_addr. Therefore, the call to random_ether_addr can be replaced with eth_random_addr. Done using coccinelle: @@ expression addr; @@ - random_ether_addr(addr); + eth_random_addr(addr); Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05Staging: gdm724x: Use min instead of ternary operatorBhumika Goyal1-1/+1
This patch replaces ternary operator with macro min as it shorter and thus increases code readability. Macro min return the minimum of the two compared values. Made a semantic patch for changes: @@ type T; T x; T y; @@ ( - x < y ? x : y + min(x,y) | - x > y ? x : y + max(x,y) ) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05staging: gdm724x: gdm_usb: Remove create_workqueue()Amitoj Kaur Chawla1-26/+8
With concurrency managed workqueues, use of dedicated workqueues can be replaced by using system_wq. Drop usb_tx_wq and usb_rx_wq by using system_wq. Since there are multiple work items per udev but different udevs do not need to be ordered, increase of concurrency level by switching to system_wq should not break anything. cancel_work_sync() is used to ensure that work is not pending or executing on any CPU. Lastly, since all devices are suspended, which shutdowns the work items before the driver can be unregistered, it is guaranteed that no work item is pending or executing by the time exit path runs. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14staging: gdm724x: gdm_mux: Remove create_workqueue()Amitoj Kaur Chawla1-15/+3
With concurrency managed workqueues, use of dedicated workqueues can be replaced by using system_wq. Drop mux_rx_wq by using system_wq. Since there is only one work item per mux_dev and different mux_devs do not need to be ordered, increase of concurrency level by switching to system_wq should not break anything. cancel_work_sync() is used to ensure that work is not pending or executing on any CPU. Lastly, since all devices are suspended, which shutdowns the work item before the driver can be unregistered, it is guaranteed that no work item is pending or executing by the time exit path runs. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11staging: gdm724x: Remove unneeded parenthesesJanani Ravichandran1-3/+3
Remove parentheses around the right hand side of assignment statements as they are not needed. Semantic patch: @@ expression a, b, c; @@ ( a = (b == c) | a = - ( b - ) ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-26staging: gdm724x: constify tty_port_operations structsAya Mahfouz1-1/+1
Constifies tty_port_operations structure in the tty code of the gdm724x driver since it is not modified after its initialization. Detected and found using Coccinelle. Suggested-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15staging: gdm724x: Remove wrapper functionAmitoj Kaur Chawla3-7/+1
Remove wrapper function that can be replaced by a single line of code. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: gdm724x: remove multiple blank linesIoana Ciornei1-4/+0
This patch removes multiple blank lines in order to follow linux kernel coding style. Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: gdm724x: correct kzalloc/kmalloc sizeof argumentIoana Ciornei3-10/+10
This patch converts sizeof(TYPE) to sizeof(VAR) when used as a kzalloc/kmaloc argument. Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: gdm724x: add spaces around binary operatorsIoana Ciornei5-11/+11
This patch add spaces around binary operators in order to follow kernel coding style. Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24stating: gdm724x: remove explicit NULL comparisonIoana Ciornei5-14/+14
This patch converts explicit NULL comparison to its shorter equivalent form. Done with coccinelle semantic patch: @@ expression e; @@ - e == NULL + !e Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: gdm724x: properly indent to match open paranthesisIoana Ciornei3-27/+27
Indent parameters and arguments passed to function calls to match open paranthesis Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: gdx724x: gdm_mux: Remove explicit castShivani Bhardwaj1-1/+1
Compiler can typecast variables implicitly so, explicit type cast is not required and should be removed. Semantic patch used: @@ type T; T e; identifier x; @@ * T x = (T)e; Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: gdm724x: Remove unnecessary cast on void pointerShraddha Barke4-13/+13
void pointers do not need to be cast to other pointer types. Semantic patch: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: gdm724x: Remove test for host endianJaime Arrocha2-40/+17
gdm_endian.c: small changes were done to remove testing for host endianness and in-driver conversion for byte-ordering. The linux/kernel.h functions are used now. gdm_endian.h: removal of code no longer needed with changes in gdm_endian.c. Signed-off-by: Jaime Arrocha <jarr@kerneldev.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10staging: gdm724x: Correction of variable usage after applying ALIGN()Sławomir Demeszko1-9/+7
Fix regression introduced by commit <29ef8a53542a>. After it writing AT commands to /dev/GCT-ATM0 is unsuccessful (no echo, no response) and dmesg show "gdmtty: invalid payload : 1 16 f011". Before that commit value of dummy_cnt was only a padding size. After using ALIGN() this value is increased by its first argument. So the following usage of this variable needs correction. Signed-off-by: Sławomir Demeszko <s.demeszko@wireless-instruments.com> Cc: stable <stable@vger.kernel.org> # 3.14+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18Staging: gdm724x: replace pr_* with dev_*Haneen Mohammed2-5/+6
This patch replace pr_err/pr_info with dev_err/dev_info, when appropriate device structure is found. Issue found and resolved using the following Coccinelle script. pr_err/dev_err was substituted with pr_info/dev_info in the later case. @r exists@ identifier f, s, i; position p; @@ f(...,struct s *i,...) { <+... when != i == NULL pr_err@p(...); ...+> } @rr@ identifier r.s, s2, fld; @@ struct s { ... struct s2 *fld; ... }; @rrr@ identifier rr.s2, fld2; @@ struct s2 { ... struct device fld2; ... }; @@ identifier r.i, r.s, rr.fld, rrr.fld2; position r.p; @@ -pr_err@p +dev_err ( + &i->fld->fld2, ...) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18Staging: gdm724x: replace pr_err with dev_errHaneen Mohammed2-6/+6
This patch replace pr_err with dev_err, when appropriate device structre is found. Issue found using the following Coccinelle script: @r exists@ identifier f, s, i; position p; @@ f(...,struct s *i,...) { <+... when != i == NULL pr_err@p(...); ...+> } @rr@ identifier r.s, fld; @@ struct s { ... struct device *fld; ... }; @@ identifier r.i, rr.fld; position r.p; @@ -pr_err@p +dev_err ( + i->fld, ...) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16staging: gdm724x: use !x instead of x == NULLSomya Anand1-1/+1
Functions like devm_kzalloc, kmalloc_array, devm_ioremap, usb_alloc_urb, alloc_netdev return NULL as a return value on failure. Generally, When NULL represents failure, !x is commonly used. This patch cleans up the tests on the results of these functions, thereby using !x instead of x == NULL or NULL == x. This is done via following coccinelle script: @prob_7@ identifier x; statement S; @@ ( x = devm_kzalloc(...); | x = usb_alloc_urb(...); | x = kmalloc_array(...); | x = devm_ioremap(...); | x = alloc_netdev(...); ) ... - if(NULL == x) + if(!x) S Further we have used isomorphism characteristics of coccinelle to indicate x == NULL and NULL == x are equivalent. This is done via following iso script. Expression @ is_null @ expression X; @@ X == NULL <=> NULL == X Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17staging: gdm724x: fix line limit coding style issue in gdm_lte.cNing Zhou1-1/+2
This is a patch to fix "WARNING: line over 80 characters" found by checkpatch.pl in gdm_lte.c. Signed-off-by: Ning Zhou <zhou.ning.gd@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17Staging: gdm724x: fix space before comma coding style issue in gdm_mux.cRobert Nachlinger1-1/+1
This is a patch to the gdm_mux.c file that fixes a space before comma coding style issue found by the checkpatch.pl tool. Signed-off-by: Robert Nachlinger <robert.nachlinger@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: gdm724x: Fix incorrect type in assignmentEbru Akagunduz1-4/+4
This patch fixes following sparse warnings: drivers/staging/gdm724x/gdm_mux.c:389:32: warning: incorrect type in assignment (different base types) drivers/staging/gdm724x/gdm_mux.c:389:32: expected unsigned int [unsigned] start_flag drivers/staging/gdm724x/gdm_mux.c:389:32: got restricted __le32 [usertype] <noident drivers/staging/gdm724x/gdm_mux.c:390:29: warning: incorrect type in assignment (different base types) drivers/staging/gdm724x/gdm_mux.c:390:29: expected unsigned int [unsigned] seq_num drivers/staging/gdm724x/gdm_mux.c:390:29: got restricted __le32 [usertype] <noident> drivers/staging/gdm724x/gdm_mux.c:391:34: warning: incorrect type in assignment (different base types) drivers/staging/gdm724x/gdm_mux.c:391:34: expected unsigned int [unsigned] payload_size drivers/staging/gdm724x/gdm_mux.c:391:34: got restricted __le32 [usertype] <noident> drivers/staging/gdm724x/gdm_mux.c:392:33: warning: incorrect type in assignment (different base types) drivers/staging/gdm724x/gdm_mux.c:392:33: expected unsigned short [unsigned] packet_type drivers/staging/gdm724x/gdm_mux.c:392:33: got restricted __le16 [usertype] <noident> Sparse found above warnings, so this patch changes variable types of structs. Because expected and got variable types are different. Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Reviewed-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: gdm724x: Fix warning of prefer ether_addr_copy.Dilek Uzulmez1-5/+5
This patch fixes the following checkpatch.pl warnings: WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)" in file gdm_lte.c Pahole shows that the addresses are aligned. Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28staging: gdm724x: Removed unnecessary else expression.Gulsah Kose1-2/+1
This patch fixes "else is not generally useful after a break or return" checkpatch.pl warning in gdm_usb.c Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19Staging: gdm724x: gdm_usb: added error checking in do_tx()Abel Moyo1-0/+4
Added error checking for alloc_tx_struct in do_tx() Signed-off-by: Abel Moyo <abelmoyo.ab@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: gdm724x: Fix missing blank line warning.Gulsah Kose1-0/+1
Fixes "Missing a blank line after declarations" checkpatch.pl warning in gdm_mux.c Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds1-1/+1
Pull networking updates from David Miller: "Highlights: 1) Steady transitioning of the BPF instructure to a generic spot so all kernel subsystems can make use of it, from Alexei Starovoitov. 2) SFC driver supports busy polling, from Alexandre Rames. 3) Take advantage of hash table in UDP multicast delivery, from David Held. 4) Lighten locking, in particular by getting rid of the LRU lists, in inet frag handling. From Florian Westphal. 5) Add support for various RFC6458 control messages in SCTP, from Geir Ola Vaagland. 6) Allow to filter bridge forwarding database dumps by device, from Jamal Hadi Salim. 7) virtio-net also now supports busy polling, from Jason Wang. 8) Some low level optimization tweaks in pktgen from Jesper Dangaard Brouer. 9) Add support for ipv6 address generation modes, so that userland can have some input into the process. From Jiri Pirko. 10) Consolidate common TCP connection request code in ipv4 and ipv6, from Octavian Purdila. 11) New ARP packet logger in netfilter, from Pablo Neira Ayuso. 12) Generic resizable RCU hash table, with intial users in netlink and nftables. From Thomas Graf. 13) Maintain a name assignment type so that userspace can see where a network device name came from (enumerated by kernel, assigned explicitly by userspace, etc.) From Tom Gundersen. 14) Automatic flow label generation on transmit in ipv6, from Tom Herbert. 15) New packet timestamping facilities from Willem de Bruijn, meant to assist in measuring latencies going into/out-of the packet scheduler, latency from TCP data transmission to ACK, etc" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1536 commits) cxgb4 : Disable recursive mailbox commands when enabling vi net: reduce USB network driver config options. tg3: Modify tg3_tso_bug() to handle multiple TX rings amd-xgbe: Perform phy connect/disconnect at dev open/stop amd-xgbe: Use dma_set_mask_and_coherent to set DMA mask net: sun4i-emac: fix memory leak on bad packet sctp: fix possible seqlock seadlock in sctp_packet_transmit() Revert "net: phy: Set the driver when registering an MDIO bus device" cxgb4vf: Turn off SGE RX/TX Callback Timers and interrupts in PCI shutdown routine team: Simplify return path of team_newlink bridge: Update outdated comment on promiscuous mode net-timestamp: ACK timestamp for bytestreams net-timestamp: TCP timestamping net-timestamp: SCHED timestamp on entering packet scheduler net-timestamp: add key to disambiguate concurrent datagrams net-timestamp: move timestamp flags out of sk_flags net-timestamp: extend SCM_TIMESTAMPING ancillary data struct cxgb4i : Move stray CPL definitions to cxgb4 driver tcp: reduce spurious retransmits due to transient SACK reneging qlcnic: Initialize dcbnl_ops before register_netdev ...
2014-07-26staging: gdm724x: fix misplaced open bracesCihangir Akturk1-17/+11
This patch fixes the following checkpatch.pl issues in gdm_usb.c: ERROR: that open brace { should be on the previous line Signed-off-by: Cihangir Akturk <cakturk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>