Commit graph

20 commits

Author SHA1 Message Date
Muhammad Usama Anjum 20a2d16d22 staging: octeon: Add the license identifier
This patch fixes the checkpatch.pl warning:
WARNING: Missing or malformed SPDX-License-Identifier tag

Add a the SPDX-License-Identifier tag on line 1

Other files in this folder have GPL-2.0 license. So this file should
have the same license which was missing before and checkpatch.pl was
giving the warning.

Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Link: https://lore.kernel.org/r/20200723180723.GA30699@musamaanjum
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-23 20:34:34 +02:00
Kaaira Gupta 007b91435b staging: octeon: match parentheses alignment
match the next line with open parentheses by giving appropriate tabs.

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
Link: https://lore.kernel.org/r/20200220201033.GA14855@kaaira-HP-Pavilion-Notebook
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-23 19:20:49 +01:00
Kaaira Gupta 57dd99864f staging: octeon: add blank line after union
add a blank line after union declaration to fix checkpatch.pl warning

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
Link: https://lore.kernel.org/r/20200220195654.GA14056@kaaira-HP-Pavilion-Notebook
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-23 19:20:49 +01:00
Kaaira Gupta bc8942bc49 staging: octeon: add space around '+' and parentheses
Fix checkpatch.pl warnings of required spaces around '+' sign in
multiple lines in octeon-stubs.h by adding spaces. Also add space before
parentheses in the same file to fix checkpatch.pl warning.

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
Link: https://lore.kernel.org/r/20200220194820.GA13689@kaaira-HP-Pavilion-Notebook
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-23 19:20:48 +01:00
Chris Packham 422d97b8b0 Revert "staging: octeon: delete driver"
This reverts commit 710d7fbe21.
Re-instate the code so subsequent commits can clean it up and get it
building properly.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20200205001116.14096-3-chris.packham@alliedtelesis.co.nz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-12 13:50:32 -08:00
Greg Kroah-Hartman 710d7fbe21 staging: octeon: delete driver
This driver has been in the tree since 2009 with no real movement to get
it out.  Now it is starting to cause build issues and other problems for
people who want to fix coding style problems, but can not actually build
it.

As nothing is happening here, just delete the module entirely.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Cc: David Daney <ddaney@caviumnetworks.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: YueHaibing <yuehaibing@huawei.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Wambui Karuga <wambui.karugax@gmail.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Florian Westphal <fw@strlen.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Branden Bonaby <brandonbonaby94@gmail.com>
Cc: "Petr Štetiar" <ynezz@true.cz>
Cc: Sandro Volery <sandro@volery.com>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Giovanni Gherdovich <bobdc9664@seznam.cz>
Cc: Valery Ivanov <ivalery111@gmail.com>
Link: https://lore.kernel.org/r/20191210091509.3546251-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 12:54:33 +01:00
Giovanni Gherdovich 282eaa624f staging: octeon: indent with tabs instead of spaces
Remove a coding style error from the Octeon driver's tree and keep
checkpatch.pl a little quieter.

Being a white-spaces patch the chances of breakage are minimal; we don't
have the hardware to run this driver so we built it with COMPILE_TEST
enabled on an x86 machine.

Signed-off-by: Giovanni Gherdovich <bobdc9664@seznam.cz>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20191118183852.3699-1-bobdc9664@seznam.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-22 11:32:54 +01:00
Valery Ivanov 1fa489b14d staging: octeon: fix missing a blank line after declaration
This patch fixes "WARNING: Missing a blank line after declarations"
Issue found by checkpatch.pl

Signed-off-by: Valery Ivanov <ivalery111@gmail.com>
Link: https://lore.kernel.org/r/20191108142329.GA3192@hwsrv-485799.hostwindsdns.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-11 16:37:58 +01:00
Cristiane Naves 6d7e7c31ff staging: octeon: Remove unneeded variable
Remove unneeded variable used to store return value. Issue found by
coccicheck.

Signed-off-by: Cristiane Naves <cristianenavescardoso09@gmail.com>
Link: https://lore.kernel.org/r/20191026222453.GA14562@cristiane-Inspiron-5420
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-27 08:15:43 +01:00
Wambui Karuga 180245d2d0 staging: octeon: remove typedef declaration for cvmx_fau_op_size
Remove addition of new typedef for enum cvmx_fau_op_size.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/0130bbbffd4c3c9e0e2ab0fc02cb7fa704ee410c.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 15:36:54 +02:00
Wambui Karuga 6cc5e1c700 staging: octeon: remove typedef declartion for cvmx_pko_command_word0
Removes addition of new typedef declaration for
cvmx_pko_command_word0.
Also replace previous instances with new union declaration.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/40bb26b250d7ba5b0d5199072e773be2fb0fed90.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 15:36:53 +02:00
Wambui Karuga 1691741fe3 staging: octeon: remove typedef declaration for cvmx_fau_reg_32
Remove typedef declaration for enum cvmx_fau_reg_32.
Also replace its previous uses with new declaration format.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/b7216f423d8e06b2ed7ac2df643a9215cd95be32.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 15:36:53 +02:00
Wambui Karuga 73aef0c9d2 staging: octeon: remove typedef declaration for cvmx_helper_link_info
Remove declaration of union cvmx_helper_link_info as typedef.
Also replace its previous uses with new union declaration.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/fb373aed8fd2b04d01198f5a5769fd2476714e88.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 15:36:52 +02:00
Wambui Karuga ef1fe6b736 staging: octeon: remove typedef declaration for cvmx_wqe
Remove typedef declaration from struct cvmx_wqe.
Also replace its previous uses with new struct declaration.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/fa82104ea8d7ff54dc66bfbfedb6cca541701991.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 15:36:52 +02:00
Greg Kroah-Hartman 27d6e47f8e Merge 5.4-rc3 into staging-next
We want the staging driver fixes in here as well to build on and test
with.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 07:07:36 +02:00
Wambui Karuga fbf12784d3 staging: octeon: Fix incorrect type in assignment
Fix the following warning generated by sparse in
drivers/staging/octeon/ethernet-tx.c:

drivers/staging/octeon/ethernet-tx.c:563:50: warning: incorrect type in assignment (different base types)
drivers/staging/octeon/ethernet-tx.c:563:50:    expected unsigned short [usertype] hw_chksum
drivers/staging/octeon/ethernet-tx.c:563:50:    got restricted __wsum [usertype] csum

Warning generated by running:
make C=2 CF="-D__CHECK_ENDIAN__" drivers/staging/octeon/

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191010043815.14027-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-10 11:00:59 +02:00
Paul Burton 17a29fea08 staging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC
When building for a non-Cavium MIPS system with COMPILE_TEST=y, the
Octeon ethernet driver hits a number of issues due to use of macros
provided only for CONFIG_CAVIUM_OCTEON_SOC=y configurations. For
example:

  drivers/staging/octeon/ethernet-rx.c:190:6: error:
    'CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE' undeclared (first use in this function)
  drivers/staging/octeon/ethernet-rx.c:472:25: error:
    'OCTEON_IRQ_WORKQ0' undeclared (first use in this function)

These come from various asm/ headers that a non-Octeon build will be
using a non-Octeon version of.

Fix this by using the octeon-stubs.h header for non-Cavium MIPS builds,
and only using the real asm/octeon/ headers when building a Cavium
Octeon kernel configuration.

This requires that octeon-stubs.h doesn't redefine XKPHYS_TO_PHYS, which
is defined for MIPS by asm/addrspace.h which is pulled in by many other
common asm/ headers.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
URL: https://lore.kernel.org/linux-mips/CAMuHMdXvu+BppwzsU9imNWVKea_hoLcRt9N+a29Q-QsjW=ip2g@mail.gmail.com/
Fixes: 171a9bae68 ("staging/octeon: Allow test build on !MIPS")
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: David S. Miller <davem@davemloft.net>

Link: https://lore.kernel.org/r/20191007231741.2012860-1-paul.burton@mips.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-08 14:50:15 +02:00
Wambui Karuga d53c90c5d4 staging: octeon: Remove typedef declaration
Fixes checkpatch.pl warning: do not add new typedefs in
drivers/staging/octeon/octeon-stubs.h:41

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191008040943.9283-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-08 14:48:41 +02:00
Geert Uytterhoeven 7d4dea95f8 staging: octeon: Use "(uintptr_t)" to cast from pointer to int
On 32-bit:

    In file included from drivers/staging/octeon/octeon-ethernet.h:41,
		     from drivers/staging/octeon/ethernet-tx.c:25:
    drivers/staging/octeon/octeon-stubs.h: In function ‘cvmx_phys_to_ptr’:
    drivers/staging/octeon/octeon-stubs.h:1205:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      return (void *)(physical_address);
	     ^
    drivers/staging/octeon/ethernet-tx.c: In function ‘cvm_oct_xmit’:
    drivers/staging/octeon/ethernet-tx.c:264:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)skb->data);
					 ^
    drivers/staging/octeon/octeon-stubs.h:2:30: note: in definition of macro ‘XKPHYS_TO_PHYS’
     #define XKPHYS_TO_PHYS(p)   (p)
				  ^
    drivers/staging/octeon/ethernet-tx.c:268:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)skb->data);
					 ^
    drivers/staging/octeon/octeon-stubs.h:2:30: note: in definition of macro ‘XKPHYS_TO_PHYS’
     #define XKPHYS_TO_PHYS(p)   (p)
				  ^
    drivers/staging/octeon/ethernet-tx.c:276:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
	 XKPHYS_TO_PHYS((u64)skb_frag_address(fs));
			^
    drivers/staging/octeon/octeon-stubs.h:2:30: note: in definition of macro ‘XKPHYS_TO_PHYS’
     #define XKPHYS_TO_PHYS(p)   (p)
				  ^
    drivers/staging/octeon/ethernet-tx.c:280:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)CVM_OCT_SKB_CB(skb));
					 ^
    drivers/staging/octeon/octeon-stubs.h:2:30: note: in definition of macro ‘XKPHYS_TO_PHYS’
     #define XKPHYS_TO_PHYS(p)   (p)
				  ^

Fix this by replacing casts to "u64" by casts to "uintptr_t", which is
either 32-bit or 64-bit, and adding an intermediate cast to "uintptr_t"
where needed.

Exposed by commit 171a9bae68 ("staging/octeon: Allow test build on
!MIPS").

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20190919095022.29099-1-geert@linux-m68k.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-01 08:22:43 +02:00
Matthew Wilcox (Oracle) 171a9bae68 staging/octeon: Allow test build on !MIPS
Add compile test support by moving all includes of files under
asm/octeon into octeon-ethernet.h, and if we're not on MIPS,
stub out all the calls into the octeon support code in octeon-stubs.h

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-29 10:35:41 -07:00