ERROR: do not initialise statics to 0 or NULL
+static unsigned int ui_Temp = 0;
WARNING: braces {} are not necessary for any arm of this statement
+ if (data[1]) {
[...]
+ } else
[...]
WARNING: braces {} are not necessary for single statement blocks
+ for (i = 0; i < devpriv->ui_AiNbrofChannels; i++) {
+ devpriv->ui_AiChannelList[i] = data[4 + i];
+ }
ERROR: that open brace { should be on the previous line
+ } else /* EOC */
+ {
WARNING: braces {} are not necessary for any arm of this statement
+ if (data[1]) {
[...]
+ } else {
[...]
ERROR: that open brace { should be on the previous line
+ if (insn->unused[0] == 222) /* second insn read */
+ {
WARNING: braces {} are not necessary for single statement blocks
+ for (i = 0; i < insn->n; i++) {
+ data[i] = devpriv->ui_AiReadData[i];
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (cmd->start_src != TRIG_NOW && cmd->start_src != TRIG_EXT) {
+ err++;
+ }
ERROR: that open brace { should be on the previous line
+ if (cmd->scan_begin_src == TRIG_TIMER) /* Test Delay timing */
+ {
ERROR: that open brace { should be on the previous line
+ if (cmd->convert_src == TRIG_TIMER) /* Test Acquisition timing */
+ {
WARNING: braces {} are not necessary for any arm of this statement
+ if (cmd->stop_src == TRIG_COUNT) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for single statement blocks
+ if (devpriv->b_ExttrigEnable == APCI3120_ENABLE) {
+ i_APCI3120_ExttrigEnable(dev); /* activate EXT trigger */
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (dmalen0 > (devpriv->ui_AiDataLength)) {
+ dmalen0 = devpriv->ui_AiDataLength;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (dmalen1 > (devpriv->ui_AiDataLength)) {
+ dmalen1 = devpriv->ui_AiDataLength;
+ }
WARNING: braces {} are not necessary for any arm of this statement
+ if (CR_RANGE(chanlist[i]) < APCI3120_BIPOLAR_RANGES) {
[...]
+ } else {
[...]
ERROR: that open brace { should be on the previous line
+ if (devpriv->b_EocEosInterrupt == APCI3120_ENABLE) /* enable this in without DMA ??? */
+ {
ERROR: that open brace { should be on the previous line
+ if (data[0] == APCI3120_TIMER) /* initialize timer */
+ {
ERROR: that open brace { should be on the previous line
+ } else /* Initialize Watch dog */
+ {
ERROR: that open brace { should be on the previous line
+ if (data[0] == 2) /* write new value */
+ {
ERROR: that open brace { should be on the previous line
+ if (devpriv->b_Timer2Mode == APCI3120_TIMER) /* start timer */
+ {
ERROR: that open brace { should be on the previous line
+ } else /* start watch dog */
+ {
ERROR: that open brace { should be on the previous line
+ if (devpriv->b_Timer2Mode == APCI3120_TIMER) /* start timer */
+ {
ERROR: that open brace { should be on the previous line
+ } else /* Read watch dog status */
+ {
WARNING: braces {} are not necessary for single statement blocks
+ if (!devpriv->b_OutputMemoryStatus) {
+ ui_Temp = 0;
+
+ } /* if(!devpriv->b_OutputMemoryStatus ) */
ERROR: code indent should use tabs where possible
+ data[0] Value to be written$
ERROR: code indent should use tabs where possible
+ data[1] :1 Set digital o/p ON$
ERROR: code indent should use tabs where possible
+ data[1] 2 Set digital o/p OFF with memory ON$
ERROR: that open brace { should be on the previous line
+ if (ui_Range) /* if 1 then unipolar */
+ {
ERROR: that open brace { should be on the previous line
+ } else /* if 0 then bipolar */
+ {
ERROR: that open brace { should be on the previous line
+ do /* Waiting of DA_READY BIT */
+ {
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andrea Gelmini [Fri, 26 Feb 2010 09:15:01 +0000 (10:15 +0100)]
Staging: comedi: cb_pcidio.c: Checkpatch cleanup
WARNING: braces {} are not necessary for single statement blocks
+ if (devpriv->dio_reg_base) {
+ comedi_pci_disable(devpriv->pci_dev);
+ }
WARNING: braces {} are not necessary for single statement blocks
+ for (i = 0; i < thisboard->n_8255; i++) {
+ subdev_8255_cleanup(dev, dev->subdevices + i);
+ }
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andrea Gelmini [Fri, 26 Feb 2010 09:15:00 +0000 (10:15 +0100)]
Staging: comedi: cb_pcidda.c: Checkpatch cleanup
WARNING: braces {} are not necessary for single statement blocks
+ if (devpriv->dac) {
+ comedi_pci_disable(devpriv->pci_dev);
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (inw_p(devpriv->dac + DACALIBRATION1) & SERIAL_OUT_BIT) {
+ value |= 1 << (value_width - i);
+ }
WARNING: braces {} are not necessary for single statement blocks
+ for (i = 0; i < max_num_caldacs; i++) {
+ cal2_bits |= DESELECT_CALDAC_BIT(i);
+ }
WARNING: braces {} are not necessary for single statement blocks
+ for (i = 0; i < max_num_caldacs; i++) {
+ cal2_bits |= DESELECT_CALDAC_BIT(i);
+ }
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andrea Gelmini [Fri, 26 Feb 2010 09:14:59 +0000 (10:14 +0100)]
Staging: comedi: cb_pcidas.c: Checkpatch cleanup
ERROR: "foo * bar" should be "foo *bar"
+ uint8_t * data);
WARNING: braces {} are not necessary for single statement blocks
+ if (devpriv->s5933_config) {
+ comedi_pci_disable(devpriv->pci_dev);
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (cmd->stop_src == TRIG_COUNT) {
+ devpriv->count = cmd->chanlist_len * cmd->stop_arg;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (cmd->stop_src == TRIG_COUNT) {
+ devpriv->ao_count = cmd->chanlist_len * cmd->stop_arg;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (cmd->stop_src == TRIG_COUNT) {
+ devpriv->ao_count -= num_points;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (dev->attached == 0) {
+ return IRQ_NONE;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if ((status & (INT | EOAI | LADFUL | DAHFI | DAEMI)) == 0) {
+ comedi_error(dev, "spurious interrupt");
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (status & (DAHFI | DAEMI)) {
+ handle_ao_interrupt(dev, status);
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (async->cmd.stop_src == TRIG_COUNT) {
+ devpriv->ao_count -= num_points;
+ }
ERROR: "foo * bar" should be "foo *bar"
+ uint8_t * data)
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Ameya Palande [Wed, 24 Feb 2010 18:18:28 +0000 (20:18 +0200)]
Staging: crystalhd: Misc improvements for crystalhd_lnx.c
This patch does following improvements:
1. Follow kernel style for comments
2. Reorganize code for readability improvement
3. Use PCI helper macros
4. Use __devinit, __devexit, __devexit_p at necessary places
5. Mark functions and data as static when it is not exported
Signed-off-by: Ameya Palande <2ameya@gmail.com> Cc: Naren Sankar <nsankar@broadcom.com> Cc: Jarod Wilson <jarod@wilsonet.com> Cc: Scott Davilla <davilla@4pi.com> Cc: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jim Dog [Thu, 25 Feb 2010 11:38:21 +0000 (11:38 +0000)]
Staging: wlan-ng: Fixed line length issues in prism2usb.c
This is a patch to the prism2usb.c that fixes one line which was over
the 80 character limit by wrapping it to a new line and removes a
commented out configuration for a ZyDAS ZD1201 device since support for
this device with this driver is now deprecated.
Signed-off-by: Jim Dog <jimdog@northern-indymedia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Randy Dunlap [Wed, 24 Feb 2010 19:39:20 +0000 (11:39 -0800)]
Staging: rtl8192* needs semaphore.h
The rtl8192* drivers in staging use semaphores, so they need
to #include <linux/semaphore.h>.
(similar to staging-rtl8187se-needs-semaphore.h.patch)
drivers/staging/rtl8192e/ieee80211/ieee80211.h:2038: error: field 'ips_sem' has incomplete type
drivers/staging/rtl8192e/ieee80211/ieee80211.h:2249: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8192e/ieee80211/ieee80211.h:2250: error: field 'scan_sem' has incomplete type
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c:442: error: implicit declaration of function 'down'
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c:500: error: implicit declaration of function 'up'
drivers/staging/rtl8192e/ieee80 211/ieee80211_softmac.c:3165: error: implicit declaration of function 'sema_init'
drivers/staging/rtl8192su/ieee80211/ieee80211.h:1330: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8192su/ieee80211/ieee80211.h:1331: error: field 'scan_sem' has incomplete type
drivers/staging/rtl8192u/ieee80211/ieee80211.h:2010: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8192u/ieee80211/ieee80211.h:2011: error: field 'scan_sem' has incomplete type
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: comedi: fix coding style issues in ni_labpc.c
This is a patch to the ni_labpc.c file that fixes the brace warnings and
comments over 80 characters found by the checkpatch.pl tool. Some code
still goes over 80 characters because I didn't know what to do with it.
Signed-off-by: Stewart Robertson <stewart_r@aliencamel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Linus Luessing [Fri, 19 Feb 2010 15:18:08 +0000 (16:18 +0100)]
Staging: batman-adv: atomic variable for vis-srv activation
This fixes the bug discovered by Marek Lindner which did not allow
turning on the vis-server before an interface has been added. With this
patch we are using a global atomic variable for activating and
deactiating the vis-server-mode, which can be used before
inserting an interface.
Marek Lindner [Fri, 19 Feb 2010 15:18:06 +0000 (16:18 +0100)]
Staging: batman-adv: avoid having the same error message more than once
The routing code has 2 sections which warn about ttl exceeded. The
corresponding warnings were identical which makes it hard to debug. In
addition, batman-adv does not need to warn about ttl exceeded in case
we encountered an echo request as this is commonly used to generate
traceroute graphs.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Wunderlich [Fri, 19 Feb 2010 15:18:05 +0000 (16:18 +0100)]
Staging: batman-adv: don't lock while sending packets
As in other parts of batman-adv, we should not lock while sending a packet but
keep the lock held for as short as possible. Additionally, we should check
whether the interface is active, otherwise batman_if->net_dev might not be
available ...
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Acked-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sven Eckelmann [Fri, 19 Feb 2010 15:18:04 +0000 (16:18 +0100)]
Staging: batman-adv: depend on NET instead of PACKET in Kconfig
The code which uses the raw packet sockets was removed. The only related
dependencies are the skb and netdev handling code. This is provided by
NET in Kconfig.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mark Brown [Thu, 18 Feb 2010 17:19:17 +0000 (17:19 +0000)]
Staging: iio: Staticise non-exported functions
Staticise a number of functions which aren't exported outside their
source files, and also add a __user annotation for the buffer in
iio_event_chrdev_read().
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arthur Benilov [Tue, 16 Feb 2010 14:41:51 +0000 (15:41 +0100)]
Staging: vme: VMIVME-7805 board support
VMIVME-7805 board has a special control register that has to be used in
order to activate the VME bus access via the Universe II bridge.
This control register also handles endianess convertion.
Signed-off-by: Arthur Benilov <arthur.benilov@iba-group.com> Signed-off-by: Vincent Bossier <vincent.bossier@iba-group.com> Acked-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arthur Benilov [Tue, 16 Feb 2010 14:41:21 +0000 (15:41 +0100)]
Staging: vme: Allocate memory buffers for master windows
For VME device I/O operations on master windows the user driver tends
to use kern_buf buffer array which is not allocated. This causes an error
when reading from master window device files.
Signed-off-by: Arthur Benilov <arthur.benilov@iba-group.com> Signed-off-by: Vincent Bossier <vincent.bossier@iba-group.com> Acked-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arthur Benilov [Tue, 16 Feb 2010 14:40:58 +0000 (15:40 +0100)]
Staging: vme: Use A24 when requesting slave resource
When requesting slave resources A16 addressing mode flag is used to find
available windows. Since the ca91cx42 bridge only supports two A16 slave windows
but four are requested, the driver fails to initialize. The flag has been
changed to A24, which is supported by all slave windows.
Signed-off-by: Arthur Benilov <arthur.benilov@iba-group.com> Signed-off-by: Vincent Bossier <vincent.bossier@iba-group.com> Acked-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Martyn Welch [Thu, 18 Feb 2010 15:13:32 +0000 (15:13 +0000)]
Staging: vme: Correct ca91cx42 resource handling
The ca91cx42 driver currently incorrectly handles master windows, setting
and retrieving the sizing parameters incorrectly. Also, in the slave window
handling, it uses an incorrectly set variable.
Martyn Welch [Thu, 18 Feb 2010 15:13:05 +0000 (15:13 +0000)]
Staging: vme: Enable drivers to handle more than one bridge
At the moment the vme bridge drivers are written in a way that only
allows them to support one bridge at a time. Modify the drivers to
enable more than one bridge to be present per board.
Randy Dunlap [Tue, 16 Feb 2010 22:59:07 +0000 (14:59 -0800)]
Staging: rtl8187se: needs semaphore.h
rtl8187se needs to include semaphore.h to prevent build errors:
drivers/staging/rtl8187se/ieee80211/ieee80211.h:1004: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8187se/ieee80211/ieee80211.h:1005: error: field 'scan_sem' has incomplete type
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Bernie Thompson [Mon, 15 Feb 2010 14:46:35 +0000 (06:46 -0800)]
Staging: udlfb: explicit dependencies and warnings
Specify Kconfig dependencies, and include warnings for building as a module
udlfb is dependent on FB_DEFERRED_IO, FB_SYS_*, and FB_MODE_HELPERS
Because many kernels do not include defio (which cannot be built
as a module), yet users want to be able to build udlfb as a module later,
udlfb has ifdefs and these dependency warnings to help udlfb build with or
without certain dependencies, but also print warnings for any lost function.
Even though this kind of flexibility isn't common, we've gotten feedback
from a significant portion of users that they were frustrated without it.
Bernie Thompson [Mon, 15 Feb 2010 14:46:26 +0000 (06:46 -0800)]
Staging: udlfb: Support for fbdev mmap clients (defio)
Add support for fbdev mmap clients who don't send damage ioctls
Because DisplayLink devices are out on the other end of usb, their
"framebuffer" is just normal system memory. So memory mapped writes
don't automatically trigger anything. So up to this point, standard
fbdev clients who rely on mmap() will get an unchanging screen.
This patch makes udlfb a client of Jaya Kumar's defio framework - which sets
up page fault triggers, and those faults are accumulated and sent to udlfb
on a defferred basis, to process as damage notifications for the framebuffer.
Because this involves more overhead than a notification directly from
the application (e.g. just passing on X DAMAGE extension notifications),
a sysfs attribute is provided by udlfb to control defio support.
/sys/class/graphics/fb*/use_defio - writing a "0" to this file before
calling mmap() causes defio to not be initialized - instead udlfb
will rely on getting damage notifications directly through the damage ioctl.
There are unsolved rendering problems with defio (horizontal dead regions
on framebuffer, that accumulate over time) which still needs a fix.
Bernie Thompson [Mon, 15 Feb 2010 14:46:21 +0000 (06:46 -0800)]
Staging: udlfb: improved rendering performance
Rework rendering for improved performance
Approx 10-20% gain avg across several "benchmarks": x11perf, gtkperf, glxgears
Moves from a single pre-alloc'd urb protected by a long-held mutex
To a list of (4) pre-alloc'd urbs which can be dispatched asynchonously
Improved rendering algorithm to hardware with lower CPU consumption,
fewer system memory accesses, and slightly higher compression.
Better scalability to multiple processors, especially with
multiple framebuffers active.
Bernie Thompson [Mon, 15 Feb 2010 14:46:13 +0000 (06:46 -0800)]
Staging: udlfb: Rework startup and teardown to fix race conditions
Rework probe to use refcounts and std functions
Because the different parts of the driver (usb, fbdev) tear down
in different orders, the driver previously could crash accessing
data that had already been freed. Refcounting system used to handle.
Reworked probe to make use of refcounts, set mode using std fbops,
and set up sysfs and pre-allocated urbs.
Bernie Thompson [Mon, 15 Feb 2010 14:46:08 +0000 (06:46 -0800)]
Staging: udlfb: Add functions to expose sysfs metrics and controls
Add sysfs controls for edid and performance metrics
There are 8 new files exposed in /sys/class/graphics/fb*
edid - returns 128 byte edid blog, suitable for parsing with parse-edid
metrics_bytes_identical
metrics_bytes_rendered
metrics_bytes_sent
metrics_cpu_kcycles_used
metrics_misc
and metrics_reset, which resets all perf metrics to zero
The 6 perf metrics are of type atomic_t.
So these metrics return precise results for short benchmarks, but
any test approx a minute or longer runtime may roll over.
Bernie Thompson [Mon, 15 Feb 2010 14:46:04 +0000 (06:46 -0800)]
Staging: udlfb: clean up function naming
Move to more consistent naming scheme
All udlfb functions start with udlfb_
All functions for udlfb's fbdev interface start with udlfb_ops_
All functinos for udlfb's usb interface start with udlfb_usb_
Bernie Thompson [Mon, 15 Feb 2010 14:45:55 +0000 (06:45 -0800)]
Staging: udlfb: pre-allocated urb list helpers
Add functions to pre-allocate and free usb bulk urbs for core render path.
Udlfb currently allocates a single urb, guarded by a mutex, that is a key
bottleneck. Because udlfb sends so much data, preallocation is most efficient.
Functions will be used by new rendering functions in later patches.
It turns out that Mimio has a userspace solution for this product using
libusb, and the in-kernel driver is just getting in the way now and
causing problems. So they have asked that the in-kernel driver be
removed. As the staging driver wasn't quite working anyway, and Mimio
supports their libusb solution for all distros, I am removing the
in-kernel driver.
The libusb solution can be downloaded from:
http://www.mimio.com/downloads/mimio_studio_software/linux.asp
Cc: <mwilder@cs.nmsu.edu> Cc: Phil Hannent <phil@hannent.co.uk> Cc: Marc Rousseau <Marc.Rousseau@mimio.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>