Commit graph

753539 commits

Author SHA1 Message Date
Nathan Chancellor 1cbe5fe261 staging: wilc1000: Remove unnecessary array index check
This statment triggers GCC's -Wtype-limit since key_index is an
unsigned integer so it cannot be less than zero.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:11:23 -07:00
Nathan Chancellor 7aa48d37ae staging: wilc1000: Remove useless function
GCC warns that 'wid' is unused in wilc_remove_key and it's correct; the
variable is only local. Get rid of the function (since it just returns
zero) and shuffle the remaining code into one if statement.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:11:23 -07:00
Nathan Chancellor 17521b1a1e staging: wilc1000: Remove unused variables
GCC warns these variables are all set but never used so remove them.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:11:23 -07:00
Colin Ian King cddef80270 staging: r8822be: fix typo in variable name "offest" -> "offset"
There are multiple occurrances of typos of "offest" that should be
"offset". Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:24 -07:00
NeilBrown ab56a0d024 staging: mt7621-dts: update nor-flash info for gnubee1
The GNUBEE has 32MB flash, so set partitions accordingly.
Also remove "m25p,chunked-io" which isn't documented or
used anywhere (outside of freewrt).

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:24 -07:00
NeilBrown bb52645a9c staging: mt7621-pci: remove some dead code.
Some code is dead because it is commented out.
Some is dead because it is uninteresting printks.
Some is dead because it declares unused functions.

Remove it all.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:23 -07:00
NeilBrown a6f1748415 staging: mt7621-pci: remove unnecessary resource details.
These resources are extracted from devicetree, so they aren't
needed here.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:23 -07:00
NeilBrown bba9b3ec0f staging: mt7621-pci: remove conditional compilation.
Code currently defines:

#define CONFIG_PCIE_PORT0
#define CONFIG_PCIE_PORT1
#define CONFIG_PCIE_PORT2
#define GPIO_PERST

and then compiles code only if they are defined.
We might want to disable some of these via devicetree one
day, but for now just remove the #defines and the
conditions - all the code for different ports is
easy to identify.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:23 -07:00
NeilBrown d4e3a1f6ce staging: mt7621-pci: white-space cleanups.
- remove white space at end of line.
- no more than 2 blank line at a time
- remove spaces before tabs
- use tabs to line things up
- re-indent some #define do{}while(0)

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:23 -07:00
NeilBrown 46d093124d staging: mt7621-pci: improve interrupt mapping
As the Interrupts for the PCI adapters are listed in
devicetree we shouldn't need to have them explicit in the code.

The simplest way to do this is to use of_irq_parse_and_map_pci()
and specify an interrupt-map which identifies the different
PCI hosts by bus/slot numbers.
This has the advantage that the hwirq number are mapped to virq
numbers for us, so the ugly hack can go.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:23 -07:00
NeilBrown 66fbebb631 staging: mt7621-spi: remove unused lock.
This lock is never initialized, locked once, and never unlocked.
Clearly it is pointless - so remove it.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:23 -07:00
NeilBrown 61749d183e staging: mt7621-eth: Lock is never unlocked.
mtk_phy_link_adjust takes a spinlock and disables
interrupts, but never unlocks.
This can leave interrupts disabled on one CPU and
various things stop working.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:23 -07:00
Christian Lütke-Stetzkamp b06b46059b staging: mt7621-mmc: Remove unused barrier macros
The current code has some barrier macros in it, which are already '#if
0' out, so just remove them.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:07 -07:00
Christian Lütke-Stetzkamp f18898631a staging: mt7621-mmc: Cleanup includes
This commit cleans the includes in the sd.c file. Those which are not
needed are removed, the remaining ones are sorted alphabetically.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:07 -07:00
Christian Lütke-Stetzkamp 47b7bae694 staging: mt7621-mmc: Remove unused macro HOST_MAX_NUM
The macro HOST_MAX_NUM is never used, so remove it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:07 -07:00
Christian Lütke-Stetzkamp a0381e2e28 staging: mt7621-mmc: Always use linked DMA mode
Current code uses linked DMA mode only when there is more than one
entry in the scatterlist. But the overhead of the linked DMA is very
small, so the code is easier when only using linked DMA and this is
also the way, the upstream driver mtk-sd handles it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:07 -07:00
Christian Lütke-Stetzkamp 759c05d317 staging: mt7621-mmc: Change return value of msdc_dma_config to void
The msdc_dma_config function currently returns always 0. Remove the
return and change to void.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:07 -07:00
Christian Lütke-Stetzkamp 37c6325b58 staging: mt7621-mmc: Don't disables DMA
Current code disables the DMA after the transfer. That only changes
the transfer mode to non-DMA and does not save any power. This is not
necessary any more, because now DMA transfer is always used. The macro
for disabling DMA transfer is also removed, because it is not used any
more.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:07 -07:00
Christian Lütke-Stetzkamp 32a966cb00 staging: mt7621-mmc: Inline function msdc_set_blknum
The function msdc_set_blknum consists of one (real) line of code and
is only called once, so inline it makes the code shorter and more
readable.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:07 -07:00
Christian Lütke-Stetzkamp 96a9789306 staging: mt7621-mmc: Remove initialisation in msdc_dma_config
Current code initialises the variable sg at the beginning of the
msdc_dma_config function. This is not necessary, because the variable
is assigned by the for_each_sg macro later on.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:07 -07:00
Christian Lütke-Stetzkamp f71774ac8a staging: mt7621-mmc: Remove redundant check for card status
Current code checks the card status at the beginning of
msdc_ops_request. This is not necessary because mmc core always checks
the card status before calling this operation.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:06 -07:00
Christian Lütke-Stetzkamp eafda89222 staging: mt7621-mmc: Do not BUG() if mrq set in msdc_ops_request
Currently the code BUG()'s, if host->mrq is set at the beginning of
msdc_ops_request. This shoould normally not happen, but it is not that
critical, because the critical sections are protected by a spin lock
and in the worst case, some commands to the card are lost, so it is
sufficient to just WARN_ON().

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:06 -07:00
Christian Lütke-Stetzkamp ec7375d1f5 staging: mt7621-mmc: Remove unused sdio irq code
Currently the code for the sdio irq is never used, because the flags
for it (MSDC_(EXT_)SDIO_IRQ) are never set. So the whole code for it
can be removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:06 -07:00
Christian Lütke-Stetzkamp 23f37ef71c staging: mt7621-mmc: Remove unused field abort from msdc_host
The field abort of msdc_host is only set, but never read, so it can be
removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:06 -07:00
Christian Lütke-Stetzkamp ec5e399edd staging: mt7621-mmc: Fix error number assignment
Currently the value that data->error is set to is converted to an
unsigned int, but it is a usual error number, so it should be
negative.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:06 -07:00
Christian Lütke-Stetzkamp eb7b0a9344 staging: mt7621-mmc: Remove unused variable dma_xfer from msdc_host
The field dma_xfer of the struct msdc_host is not used anymore, remove
it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:06 -07:00
Christian Lütke-Stetzkamp bcdcbfd533 staging: mt7621-mmc: Remove non-DMA transfer code
Currently the driver is capable of DMA and non-DMA transfer. But the
option to choose non-DMA transfer has already been removed. Now remove
also the code for the non-DMA transfer.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:06 -07:00
Christian Lütke-Stetzkamp f908abf3c6 staging: mt7621-mmc: Remove unused global dma_size
The global variable dma_size was previously used to select DMA or
non-DMA transfer mode based on the size of the data that should be
transferred. This option was removed preivously, so the variable is not
used any more and can be removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:06 -07:00
Christian Lütke-Stetzkamp 1e653f4fd5 staging: mt7621-mmc: Remove transfer mode setting variable
Currently the transfer mode can be chosen between DMA, a size
dependent mode and non-DMA by writing to a proc file. The upstream
driver mtk-sd uses DMA all times. The previous patch removed the
ability to set that option.

Now the remaining uses of the transfer mode setting variable are
cleaned up, because it cannot be changed any more.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp 67cfac33a8 staging: mt7621-mmc: Remove transfer mode setting from proc
Currently the transfer mode can be chosen between DMA, a size
dependent mode and non-DMA by writing to a proc file. The upstream
driver mtk-sd uses DMA all times.

There is no apparent reason why somebody would like to change the
transfer mode and the position of the setting in the debug part of the
driver also indicates, that the option was used for debugging
purposes. So it is removed to clean up the driver and bring it more in
line with the upstream one.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp ab4ce1140a staging: mt7621-mmc: Remove unused static msdc_regs
The static variable msdc_regs is set once, but never used, so remove
it.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp 8f1c27c981 staging: mt7621-mmc: Replace macro sdr_get_field with function
Currently sdr_get_field is a macro, to bring the code in line with the
upstream driver mtk-sd, it is changed to a function.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp bffcc2e923 staging: mt7621-mmc: Replace macro sdr_set_field with function
Currently sdr_set_field is a macro, to bring the code in line with the
upstream driver mtk-sd, it is changed to a function.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp 35af3110d4 staging: mt7621-mmc: Remove function uffs
The function uffs that is implemented by this driver returns the same
values as the kernel function ffs. So the uffs function is removed and
the calls to it are replaced with calls to ffs.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp a9392b099c staging: mt7621-mmc: Remove unused macros sdr_{read,write}16
The sdr_{read,write}16 macros are never used and does not provide any
information about the device, so they are removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp 36b730101d staging: mt7621-mmc: Remove unused macro msdc_init_gpd_ex
The macro msdc_init_gpd_ex is never used and does not provied any
information about the hardware, so it is removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp a3edb7c1ef staging: mt7621-mmc: Remove unused field clk_drv from msdc_hw
The field clk_drv of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:05 -07:00
Christian Lütke-Stetzkamp a1972612c8 staging: mt7621-mmc: Remove unused field cmd_drv from msdc_hw
The field cmd_drv of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:04 -07:00
Christian Lütke-Stetzkamp f46a0ae597 staging: mt7621-mmc: Remove unused field dat_drv from msdc_hw
The field dat_drv of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:04 -07:00
Christian Lütke-Stetzkamp 9133f0e338 staging: mt7621-mmc: Remove unused field data_edge from msdc_hw
The field data_edge of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:04 -07:00
Christian Lütke-Stetzkamp b001fa3cdf staging: mt7621-mmc: Remove unused field cmd_edge from msdc_hw
The field cmd_edge of msdc_hw is set to a constant and only used once,
replace that position with the constant and remove the unused field.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:04 -07:00
Christian Lütke-Stetzkamp ace488268a staging: mt7621-mmc: Fix typo in function parameters
The type pm_message does not exist in the kernel, the correct type is
pm_message_t, so the type of the parameter is corrected.

Fixes: 9673d9f6f4 ("staging: mt7621-mmc: Refactor suspend, resume")
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:08:04 -07:00
Stefan Wahren 121bdbf113 staging: vc04_services: Remove stack hog issue from TODO
Since there is no vchiq function listed by "make checkstack" anymore,
we can remove the stack hog issue from the TODO.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:04:43 -07:00
Stefan Wahren ae8d5f464d staging: vchiq_shim: Remove unnecessary break
This removes an unnecessary break which has been reported by checkpatch.pl.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:04:43 -07:00
Stefan Wahren 8ba7d1e3d7 staging: vchiq_arm: remove unnecessary return
This removing an unnecessary return which has been reported by checkpatch.pl.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:04:43 -07:00
Stefan Wahren 6401a1674a staging: vchiq_2835_arm: Fix whitespace issue in create_pagelist
This fixes a whitespace issue reported by checkpatch:

ERROR: code indent should use tabs where possible

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:04:43 -07:00
Stefan Wahren 0b55753f55 staging: vc04_services: Remove defines from Makefile
The definition of USE_VCHIQ_ARM and VCOS_VERIFY_BKPTS isn't really necessary
so remove them.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:04:43 -07:00
Stefan Wahren b0ae3f5575 staging: vchiq_arm: Make index variable more self-explaining
The chance to mixup i and j is very high. So rename variable j to a more
explaining one.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:04:43 -07:00
Stefan Wahren 0b134c5d7e staging: vchiq_arm: Rework second abort criterion
In order to make the code easier to review, move the second
abort criterion into the loop and the incrementation into
a separate line.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:04:43 -07:00
Stefan Wahren 028fa9d038 staging: vchiq_arm: Clear VLA warning
The kernel would like to have all stack VLA usage removed[1]. The array
here is fixed (declared with a const variable) but it appears like a VLA
to the compiler. Also, currently we are putting 768 bytes on the
stack. This function is only called on the error path so performance is
not critical, let's just allocate the memory instead of using the
stack. This saves stack space and removes the VLA build warning.

kmalloc a buffer for dumping state instead of using the stack.

[1]: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:04:43 -07:00