1
0
Fork 0
Commit Graph

36 Commits (ef08e14a3832c88bb8d5ccbb88eab48642fc6aa9)

Author SHA1 Message Date
Shubham Kumaram 4305059627 Staging: gs_fpgaboot: remove FSF's mailing address from io.h
This patch removes FSF's mailing address issue from io.h found by
checkpatch.pl tool.

Signed-off-by: Shubham Kumaram <shubhamkumaram@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:47:23 +01:00
Arvind Yadav fe5625b396 staging: gs_fpgaboot: pr_err() strings should end with newlines
pr_err() messages should end with a new-line to avoid other messages
being concatenated.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03 18:36:25 +02:00
Jacob von Chorus c2d79b4b6d staging: gs_fpgaboot: return valid error codes
The return values on error are modified to be valid error codes. Theses
error codes are propagated back to the init function's return.

Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28 17:07:37 -07:00
Jacob von Chorus d3b2a8800d staging: gs_fpgaboot: change char to u8
The bitstream storage variables were changed from char to u8 arrays to
prevent issues such as negative lengths. This change makes the code
compatible with the "data" field in "struct firmware" which is of type
u8.

Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28 17:07:37 -07:00
Jacob von Chorus a46393aba7 staging: gs_fpgaboot: add buffer overflow checks
Four fields in struct fpgaimage are char arrays of length MAX_STR (256).
The amount of data read into these buffers is controlled by a length
field in the bitstream file read from userspace. If a corrupt or
malicious firmware file was supplied, kernel data beyond these buffers
can be overwritten arbitrarily.

This patch adds a check of the bitstream's length value to ensure it
fits within the bounds of the allocated buffers. An error condition is
returned from gs_read_bitstream if any of the reads fail.

Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-28 17:07:37 -07:00
Jacob von Chorus c955bb478c staging: gs_fpgaboot: remove FSF address from GPL notice
This patch removes the FSF address from the GPL notice to fix a
checkpatch.cl CHECK message.

Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-18 08:57:59 +02:00
Masahiro Yamada 4091fb95b5 scripts/spelling.txt: add "followings" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  followings||following

While we are here, add a missing colon in the boilerplate in DT binding
documents.  The "you SoC" in allwinner,sunxi-pinctrl.txt was fixed as
well.

I reworded "as the followings:" to "as follows:" for
drivers/usb/gadget/udc/renesas_usb3.c.

Link: http://lkml.kernel.org/r/1481573103-11329-32-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:47 -08:00
Shyam Saini 4b4462ecd0 Staging: gs_fpgaboot: Use octal permissions '0444'
Fixed following checkpatch warning
WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider
using octal permissions '0444'.

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 09:40:44 +02:00
Rehas Sachdeva d5102ad4d6 staging: gs_fpgaboot: Remove FSF address from GPL notice
This patch fixes the checkpatch.pl warning:

CHECK: Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF has
changed addresses in the past, and may do so again. Linux already
includes a copy of the GPL.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:10:34 +02:00
sayli karnik b9ac4b65b5 staging: gs_fpga_boot: Remove multiple blank lines
This patch fixes the following checkpatch warning for the gs_fpgaboot
driver:
CHECK: Please don't use multiple blank lines.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 15:01:29 +02:00
Ben Marsh 686855e033 Staging: gs_fpgaboot: remove blank line in io.c
Removes a blank line in order to silence a checkpatch.pl warning.

Signed-off-by: Ben Marsh <bmarsh94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-29 12:43:14 -07:00
Sandhya Bankar c70aa60bdc Staging: gs_fpgaboot: Replace 'int32_t' with 'int'.
Replace 'int32_t' with 'int'.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar c5471a6fa6 Staging: gs_fpgaboot: Add space around '+'.
Add space around '+'.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar e58463b341 Staging: gs_fpgaboot: Remove unnecessary blank lines.
Remove unnecessary blank lines.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar 8aba6c6e98 Staging: gs_fpgaboot: Fix alignment to match open parenthesis.
Fix alignment to match open parenthesis.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Eva Rachel Retuya bbbdc23e30 staging: gs_fpgaboot: drop wrapper function 'finish_driver'
Remove the function 'finish_driver' since a direct call to
platform_device_unregister() is intuitive enough to signify the original
intention of the function being removed. Coccinelle semantic patch used to
detect this:

@@
identifier wrapper, func;
type T;
@@

*T wrapper(...)
{
(
	return func(...);
|
	func(...);
)
}

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ben Marsh 600a777152 Staging: gs_fpgaboot: fix data types in gs_fpgaboot.c
This is a patch to gs_fpgaboot.c to convert data types to kernel types
as identified by checkpatch.pl.

Signed-off-by: Ben Marsh <bmarsh94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 20:07:29 -08:00
Ben Marsh 6172624a8c Staging: gs_fpgaboot: fix memory allocation in gs_fpgaboot.c
This is a patch for gs_fpgaboot.c that fixes a memory allocation problem
identified by checkpatch.pl.

Signed-off-by: Ben Marsh <bmarsh94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 20:07:29 -08:00
Navya Sri Nizamkari 0b5c85e0f4 staging: Remove <linux/moduleparam.h> header.
This patch drops #include <linux/moduleparam.h> in all the staging
driver files that also include #include <linux/module.h> as
module.h includes moduleparam.h already.

The following semantic patch is used to make these changes:

@ includesmodule @
@@
@ depends on includesmodule @
@@
- #include <linux/moduleparam.h>

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:09:52 -08:00
Rickard Strandqvist f37e90e9a1 staging: gs_fpgaboot: io.c: Remove unused function
Remove the function bitswap() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Reviewed-by: Insop Song <Insop.Song@gainspeed.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:19:52 -08:00
Devendra Naga 84e9cd6b5c staging: gs_fpgaboot: fix a compiler warning with make W=2
The below warning is fixed:

drivers/staging/gs_fpgaboot/gs_fpgaboot.c: In function ‘gs_load_image’:
drivers/staging/gs_fpgaboot/gs_fpgaboot.c:196:58: warning: declaration of ‘file’ shadows a global declaration [-Wshadow]
drivers/staging/gs_fpgaboot/gs_fpgaboot.c:45:14: warning: shadowed declaration is here [-Wshadow]

by renaming file function argument of gs_load_image with fw_file.

Signed-off-by: Devendra Naga <devendranaga4@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:39:55 +08:00
Devendra Naga a5841ff372 staging: gs_fpgpaboot: fix compiler warning with make W=1
the following compiler warning has been fixed:

drivers/staging/gs_fpgaboot/gs_fpgaboot.c: In function ‘gs_read_bitstream’:
drivers/staging/gs_fpgaboot/gs_fpgaboot.c:160:6: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
  CC      drivers/staging/gs_fpgaboot/io.o
  LD      drivers/staging/gs_fpgaboot/gs_fpga.o
  LD      drivers/staging/gs_fpgaboot/built-in.o

by removing the size variable.

Signed-off-by: Devendra Naga <devendranaga4@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:39:55 +08:00
Devendra Naga 92bf93f126 staging: gs_fpgaboot: cleanup in gs_fpgaboot_init function
the error path is cleanup to return the correct (function call return value)
error code.

Signed-off-by: Devendra Naga <devendranaga4@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:39:55 +08:00
Dzmitry Sledneu 02c2d43c26 staging: gs_fpgaboot: Fix "out of memory" error handling
Fix "out of memory" error handling

Signed-off-by: Dzmitry Sledneu <dzmitry.sledneu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:13 +08:00
Joe Perches 6232876b72 staging: gs_fpgaboot: Use print_hex_dump_bytes instead of pr_info
Use print_hex_dump_bytes instead of pr_info

Signed-off-by: Dzmitry Sledneu <dzmitry.sledneu@gmail.com>
Reviewed-by: Insop Song <insop.song@gainspeed.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:26 +08:00
Ebru Akagunduz 44396c7bce staging: gs_fpgaboot: remove unnecessary 'out of memory' message
This patch fixes "Possible unnecessary 'out of memory' message"
checkpatch.pl warning in gs_fpgaboot.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:12 +08:00
Aybuke Ozdemir 05fd349b17 staging: gs_fpgaboot Fix trailing whitespace.
Fix checkpatch.pl issues with trailing
whitespace in README.

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:42:15 -07:00
Paul Bolle 06a3fab941 staging: gs_fpgaboot: remove checks for CONFIG_B4860G100
There are two checks for CONFIG_B4860G100 in this driver. But there's no
Kconfig symbol B4860G100. These checks will always evaluate to false.
Remove them and the code they hide.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:00:07 -07:00
Michał Bartoszkiewicz ba660d25b5 staging: gs_fpgaboot: remove unnecessary return statements
This fixes "void function return statements are not generally useful"
warnings from checkpatch.pl.

Signed-off-by: Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com>
Reviewed-by: Insop Song <insop.song@gainspeed.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06 21:50:30 -07:00
Rocco Folino 5535c4dd47 staging: gs_fpgaboot: Fixed code style issues
Fixed missing a blank line after declarations warning

Signed-off-by: Rocco Folino <lordzen87@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:56:10 -07:00
Arnd Bergmann 14e6e35d04 staging: gs_fpgaboot: remove __TIMESTAMP__ macro
We specifically build the kernel with -Werror=date-time to detect
such macros, which gives us this error:

gs_fpgaboot/gs_fpgaboot.c:376:44: error: macro "__TIMESTAMP__" might prevent reproducible builds [-Werror=date-time]
  pr_info("built at %s UTC\n", __TIMESTAMP__);

The obvious fix is to remove the printk output line.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Insop Song <insop.song@gainspeed.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-15 14:46:43 -07:00
Paul Bolle d06fb58cb6 staging: fpgaboot: clean up Makefile
This Makefile tries to set the DEBUG macro but it uses an unknown
Kconfig macro to do so. Since no code appears to even care about the
DEBUG macro this line can safely be removed.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Reviewed-by: Insop Song <insop.song@gainspeed.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-15 14:46:42 -07:00
Monam Agarwal 7e41d9c341 Staging: gs_gpgaboot: Fix Bad function definition in io.c
This patch fixes the following checkpatch.pl issues in io.c
WARNING: Bad function definition

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 13:39:56 -08:00
Fengguang Wu c39e9c87ee staging: fpgaboot: fix coccinelle warnings
drivers/staging/gs_fpgaboot/gs_fpgaboot.c:191:2-3: Unneeded semicolon

 Removes unneeded semicolon.

Generated by: coccinelle/misc/semicolon.cocci

CC: Insop Song <insop.song@gainspeed.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-14 09:26:16 -08:00
Fengguang Wu 00e0d3c3d7 staging: fpgaboot: fix coccinelle warnings
drivers/staging/gs_fpgaboot/gs_fpgaboot.c:305:1-3: WARNING: PTR_RET can be used

 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: coccinelle/api/ptr_ret.cocci

CC: Insop Song <insop.song@gainspeed.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-14 09:26:07 -08:00
Insop Song e7185c6958 staging: fpgaboot: Xilinx FPGA firmware download driver
This driver downloads Xilinx FPGA firmware using gpio pins.
It loads Xilinx FPGA bitstream format firmware image and
program the Xilinx FPGA using SelectMAP (parallel) mode.

Signed-off-by: Insop Song <insop.song@gainspeed.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07 10:08:36 -08:00