Commit graph

39 commits

Author SHA1 Message Date
Quytelda Kahja
ba3d01560b Staging: gdm724x: LTE: Refactor gdm_lte_pdn_table().
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 <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-23 09:54:56 +01:00
Quytelda Kahja
1b5e56ece3 Staging: gdm724x: Simplify the struct gdm_endian to a variable.
Since the testing for host endianness and in-driver conversion were
removed in 77e8a50149, the gdm_endian struct contains only one member,
and can therefore be simplified to a single u8 variable.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-23 09:54:56 +01:00
Quytelda Kahja
8db3656310 Staging: gdm724x: LTE: Fix trailing open parentheses.
Fix lines with a trailing open parenthesis, which is a coding style issue.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-23 09:54:56 +01:00
Quytelda Kahja
e21981b571 Staging: gdm724x: LTE: Fix argument list not aligned with parenthesis.
Fix coding style warning from checkpatch.pl.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-19 18:06:35 +01:00
Andrii Vladyka
b2b41718b6 staging: gdm724x: fix return codes in gdm_lte
fix return codes in gdm_lte in gdm724x driver

Signed-off-by: Andrii Vladyka <tulup@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-20 14:42:50 +02:00
Andrii Vladyka
d67dc3a402 staging: gdm724x: check for skb->len in gdm_lte_emulate_arp
check for skb->len in gdm_lte_emulate_arp in gdm724x driver

Signed-off-by: Andrii Vladyka <tulup@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-20 14:42:50 +02:00
Johannes Berg
59ae1d127a networking: introduce and use skb_put_data()
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-16 11:48:37 -04:00
simran singhal
ca5af1f303 staging: gdm724x: Drop useless initialisation
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-06 09:16:58 +01:00
Javier Rodriguez
efe96779e5 staging: gdm724x: modify icmp6_checksum for returning a correct data type.
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-03-06 09:16:58 +01:00
Javier Rodriguez
d3ea53c7a4 staging: gdm724x: fix incorrect type in assignment
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-09 13:10:21 +01:00
Dan Carpenter
cd47e4d69a staging: gdm724x: fix a couple array overflows
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-02-09 13:10:20 +01:00
Emil Gedda
9b9cefd00f staging: gdm724x: cleanup long lines to conform to kernel coding style
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-07 17:04:04 +01:00
Imre Deak
ce4b80fb05 staging: gdm724x: gdm_lte: Constify gdm_netdev_ops
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-09-12 11:40:06 +02:00
Bhumika Goyal
4e4acff734 Staging: gdm724x: Replace random_ether_addr with eth_random_addr
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-05 14:48:04 -08:00
Janani Ravichandran
e3b07865f5 staging: gdm724x: Remove unneeded parentheses
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>
2016-02-11 20:00:30 -08:00
Amitoj Kaur Chawla
ca3fde19d4 staging: gdm724x: Remove wrapper function
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-11-15 20:02:47 -08:00
Ioana Ciornei
ba7f55b705 staging: gdm724x: add spaces around binary operators
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-24 19:02:42 -07:00
Ioana Ciornei
b6f6fd8a87 stating: gdm724x: remove explicit NULL comparison
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-24 19:02:42 -07:00
Ioana Ciornei
a4785ef810 staging: gdm724x: properly indent to match open paranthesis
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-24 19:02:42 -07:00
Shraddha Barke
2594ca30c0 Staging: gdm724x: Remove unnecessary cast on void pointer
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-10-16 22:51:48 -07:00
Somya Anand
9d877fdbf3 staging: gdm724x: use !x instead of x == NULL
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-03-16 16:28:47 +01:00
Ning Zhou
59215e694f staging: gdm724x: fix line limit coding style issue in gdm_lte.c
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-17 14:57:43 -08:00
Dilek Uzulmez
3995213419 staging: gdm724x: Fix warning of prefer ether_addr_copy.
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-10-20 10:29:18 +08:00
Linus Torvalds
ae045e2455 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
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-08-06 09:38:14 -07:00
Tom Gundersen
c835a67733 net: set name_assign_type in alloc_netdev()
Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
all users to pass NET_NAME_UNKNOWN.

Coccinelle patch:

@@
expression sizeof_priv, name, setup, txqs, rxqs, count;
@@

(
-alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
+alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
|
-alloc_netdev_mq(sizeof_priv, name, setup, count)
+alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
|
-alloc_netdev(sizeof_priv, name, setup)
+alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
)

v9: move comments here from the wrong commit

Signed-off-by: Tom Gundersen <teg@jklm.no>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-15 16:12:48 -07:00
Scott Weir
4e13d410e6 staging: gdm724x: Added blank lines after declarations in gdm_lte.c
This patch fixes following checkpatch.pl warning:
WARNING: Missing a blank line after declarations in gdm_lte.c

Signed-off-by: Scott Weir <sjw0410@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 16:33:44 -07:00
Monam Agarwal
a28bfd11ed Staging: gdm724x: Fix unchecked sscanf values in gdm_lte.c
This patch fixes following checkpatch.pl warning:
WARNING: unchecked sscanf value in gdm_lte.c

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 11:35:53 -07:00
Gulsah Kose
097b4d8ce2 staging: gdm724x: Fix line over 80 characters.
Fix checkpatch.pl issues with line over 80 characters in gdm_lte.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 18:37:04 -07:00
Rashika Kheria
a23bb460aa Staging: gdm724x: Remove confusing macro gdm_lte_sdu_send in gdm_lte.c
This patch removes confusing macro gdm_lte_sdu_send as stated in TODO list
in file gdm_lte.c. It then fixes the place where the macro is used.

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-11 15:55:16 -08:00
Rashika Kheria
abb40c11c4 Staging: gdm724x: Remove confusing macro gdm_lte_hci_send in gdm_lte.c
This patch removes confusing macro gdm_lte_hci_send as stated in TODO list
in file gdm_lte.c. It then fixes the place where the macro is used.

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:22:34 -08:00
Rashika Kheria
04db9c6a2d Staging: gdm724x: Remove confusing macro gdm_dev_endian in gdm_lte.c
This patch removes confusing macro gdm_dev_endian as stated in TODO list
in file gdm_lte.c. It then fixes the place where the macro is used.

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:22:34 -08:00
Rashika Kheria
4ed7eeceb5 Staging: gdm724x: Remove confusing macro gdm_lte_rcv_with_cb in gdm_lte.c
This patch removes confusing macro gdm_lte_rcv_with_cb as stated in TODO list
in file gdm_lte.c. It then fixes the place where the macro is used.

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:22:34 -08:00
Valentina Manea
ff52b8fe2b staging: gdm724x: Fix sparse warnings regarding static functions/variables
This fixes sparse warnings for functions and variables, e.g.:
* drivers/staging/gdm724x/gdm_mux.c:29:25: warning: symbol
'mux_rx_wq' was not declared. Should it be static?

Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
Reviewed-by: Zach Brown <zab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 13:09:57 -07:00
Masanari Iida
26085a70b3 staging: gdm724x: Fix typo in comments
Correct spelling typo in comments within staging/gdm724x

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23 10:01:43 -07:00
Wei Yongjun
485754f5cc staging: gdm724x: remove duplicated include from gdm_lte.c
Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:29:37 -07:00
Sachin Kamat
1bf4d4860e staging: gdm724x: Remove version.h header inclusion in gdm_lte.c
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:11:57 -07:00
Greg Kroah-Hartman
8e24a32ed1 staging: gdm724x: remove ioctl call
This isn't needed, userspace can trigger off of the device id if they
need to do something "special" for different devices in special modes
depending on the device's endian issues.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Won Kang <wonkang@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 09:37:21 -07:00
Joe Perches
0ec473b526 staging: gdm724x: Update logging
Make the logging prefixes match the module names
by adding #define pr_fmt(fmt) KBUILD_MODNAME and
converting printks to netdev_<level> when a
struct netdevice * is available and and pr_<level>
when not.

Remove embedded prefixes.
Add missing terminating newlines.
Remove an unnecessary rx-dropped message.
Remove an unnecessary temporary variable.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-24 15:11:20 -07:00
Won Kang
61e1210476 staging: gdm7240: adding LTE USB driver
GCT Semiconductor GDM7240 is 4G LTE chip.
This driver supports GCT reference platform as a USB device.

Signed-off-by: Won Kang <wonkang@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-24 13:09:44 -07:00