Andy Shevchenko [Thu, 14 Jan 2010 13:07:23 +0000 (15:07 +0200)]
staging: wlags49: don't use custom implementation of atoi()
Kernel has its own method called simple_strtoul() to do such things.
Here we are using simple_strtoul(value, NULL, 0) because in original function
the recognized base is 10 or 16 and input data is assumed to be unsigned.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: iio: Fix incorrect existence check for a shared event pointer.
A second smatch detected error. First part fixes in a typo
in the comment directly above that I noticed whilst trying
to remember what this code actually does. Second part is
the actual fix. I'm fairly amazed this one never caused
trouble in testing as it is in one of the most common paths.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: otus: Fix ZM_SEQ_DEBUG macro for no-debug case
tcp_seq is only initialised in case where ZM_ENABLE_PERFORMANCE_EVALUATION
is defined. So move the call to ZM_SEQ_DEBUG() and the decleration of
tcp_seq in there too. This allows ZM_SEQ_DEBUG() to be removed from the
non-ZM_ENABLE_PERFORMANCE_EVALUATION case in the header file.
This resolves several compile warnings for the
non-ZM_ENABLE_PERFORMANCE_EVALUATION case.
However, the ZM_ENABLE_PERFORMANCE_EVALUATION
case seems to be completely broken.
$ gcc (Debian 4.4.2-8) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make
...
drivers/staging/otus/80211core/cagg.c: In function 'zfAggRxEnabled':
drivers/staging/otus/80211core/cagg.c:1872: warning: left-hand operand of
comma expression has no effect
drivers/staging/otus/80211core/cagg.c:1872: warning: left-hand operand of
comma expression has no effect
drivers/staging/otus/80211core/cagg.c:1872: warning: statement with no
effect
...
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
$ gcc (Debian 4.4.2-8) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make
...
drivers/staging/otus/ioctl.c: In function 'usbdrv_wpa_ioctl':
drivers/staging/otus/ioctl.c:2253: warning: ISO C90 forbids mixed declarations and code
...
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jarod Wilson [Thu, 7 Jan 2010 23:35:58 +0000 (18:35 -0500)]
staging: crystalhd: add missing fixes for userspace lib build
I somehow managed to not actually include these two fixes in the submission
that was committed to the staging tree. libcrystalhd should eventually be
built against the kernel-provided header, and needs the stdint.h include. The
VOID bit is to keep things in sync with the Mac OS X driver and library that
Scott Davilla is also working on.
Signed-off-by: Scott Davilla <davilla@4pi.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Peter Huewe [Thu, 7 Jan 2010 20:21:35 +0000 (21:21 +0100)]
Staging: wlan-ng: Add select WEXT_PRIV to Kconfig to prevent build failure
Without WEXT_PRIV set the p80211wext.c fails to build due to unknown fields in
the iw_handler_def struct.
Those fields are enclosed in WEXT_PRIV conditionals in the prototype
of iw_handler_def in include/net/iw_handler.h
Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Acked-by: Simon Horman <horms@verge.net.au> Cc: stable <stable@kernel.org> [2.6.33 only] Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Peter Huewe [Fri, 8 Jan 2010 08:10:13 +0000 (09:10 +0100)]
Staging: rtl8192u: Add select WEXT_PRIV to Kconfig to prevent build failure
Without WEXT_PRIV set the driver fails to build due to unknown fields in
the iw_handler_def struct.
Those fields are enclosed in WEXT_PRIV conditionals in the prototype
of iw_handler_def in include/net/iw_handler.h
Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Peter Huewe [Fri, 8 Jan 2010 08:09:12 +0000 (09:09 +0100)]
Staging: otus: Add select WEXT_PRIV to Kconfig to prevent build failure
Without WEXT_PRIV set the driver fails to build due to unknown fields in
the iw_handler_def struct.
Those fields are enclosed in WEXT_PRIV conditionals in the prototype
of iw_handler_def in include/net/iw_handler.h
Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andrew Lunn [Wed, 6 Jan 2010 06:30:48 +0000 (07:30 +0100)]
Staging: batman-adv: Update the README for mainline usage.
The module now only compiles inside mainline, so remove the comments
about different versions of the kernel it can be used with. Also
update comments about building with debug enabled and how to use the
VIS data now that it no longer natively outputs dot or JSON.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dan Carpenter [Wed, 30 Dec 2009 16:10:18 +0000 (18:10 +0200)]
Staging: rtl8192su: buffer overflow in r8192U_core.c
There was a buffer overflow in the original code. rf_path was 2 and it should
have been only 0 or 1.
I don't have the hardware for this, so I can't test it.
Looking at the code, there are two almost identical sections for updating the
hal variables. The first one was clearly wrong and had the array overflow as
well. The second one looked correct. I decided to use the second section as
is except for whitespace changes.
The differences between the two original sections:
1) The second one had more debug output.
2) The second one looped over rf_path instead of corrupting data.
3) The second one had these additional assigments.
if (rf_path == 0) {
priv->TxPowerLevelOFDM24G[i] = priv->RfTxPwrLevelOfdm1T[rf_path][i] ;
priv->TxPowerLevelCCK[i] = priv->RfTxPwrLevelCck[rf_path][i];
}
Signed-off-by: Dan Carpenter <error27@gmail.com> Cc: Jerry chuang <wlanfae@realtek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Horman [Wed, 23 Dec 2009 08:54:53 +0000 (19:54 +1100)]
Staging: rtl8192e: remove some functions from the __exit section
ieee80211_crypto_tkip_exit(), ieee80211_crypto_deinit() and
ieee80211_crypto_ccmp_exit() are called by ieee80211_rtl_init()
which are in section __init, so they can't be in section __exit.
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Horman [Wed, 23 Dec 2009 08:54:50 +0000 (19:54 +1100)]
Staging: rt2870: rtusb_probe() should be in section __devinit
$ make CONFIG_DEBUG_SECTION_MISMATCH=y
WARNING: drivers/staging/rt2870/rt2870sta.o(.text+0x2f4c5): Section
mismatch in reference from the function rtusb_probe() to the function .devinit.text:rt2870_probe()
The function rtusb_probe() references
the function __devinit rt2870_probe().
This is often because rtusb_probe lacks a __devinit
annotation or the annotation of rt2870_probe is wrong.
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: hv: match on DMI values to know if we should run.
The HV core mucks around with specific irqs and other low-level stuff
and takes forever to determine that it really shouldn't be running on a
machine. So instead, trigger off of the DMI system information and
error out much sooner. This also allows the module loading tools to
recognize that this code should be loaded on this type of system.
C. Bartlett [Wed, 3 Feb 2010 15:34:27 +0000 (15:34 +0000)]
Staging: hv: fix various coding style issues in RingBuffer.c
This is a patch to the RingBuffer.c file that corrects various coding style
warnings and errors found by checkpatch.pl
[ The real solution here is to get rid of this file entirely, and use the
kernel's internal ring buffer api, but until then, make these changes so as to
make checkpatch.pl happy, and keep others from continuously sending this type
of patch. - gkh]
Andrew Lunn [Sat, 2 Jan 2010 10:30:50 +0000 (11:30 +0100)]
Staging: batman-adv: Use printk(%pM) for MAC addresses
printk() since kernel version 2.6.29 has supported printing MAC
addresses directly, as an extension to the %p processing. This patch
makes use of this for printk() and bat_dbg(). This will remove the
overhead of using addr_to_string() which is normally never actually
output.
Fixed a typo found by Gus Wirth.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andrew Lunn [Sat, 2 Jan 2010 10:30:49 +0000 (11:30 +0100)]
Staging: batman-adv: Allow the MAC address to be set
Some embedded devices have very limited sources of entropy for the
random number generator. It has been observed that the random MAC
address on the interface bat0 is not always random. When testing with
a collection of identical hardware, sometimes the bat0 device the same
MAC address on multiple devices, causing mayhem. This patch allows the
MAC address to be set by the user.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: batman-adv: receive packets directly using skbs
This patch removes the (ugly and racy) packet receiving thread and the
kernel socket usage. Instead, packets are received directly by registering
the ethernet type and handling skbs instead of self-allocated buffers.
Some consequences and comments:
* we don't copy the payload data when forwarding/sending/receiving data
anymore. This should boost performance.
* packets from/to different interfaces can be (theoretically) processed
simultaneously. Only the big originator hash lock might be in the way.
* no more polling or sleeping/wakeup/scheduling issues when receiving
packets
* this might introduce new race conditions.
* aggregation and vis code still use packet buffers and are not (yet)
converted.
* all spinlocks were converted to irqsave/restore versions to solve
some lifelock issues when preempted. This might be overkill, some
of these locks might be reverted later.
* skb copies are only done if neccesary to avoid overhead
performance differences:
* we made some "benchmarks" with intel laptops.
* bandwidth on Gigabit Ethernet increased from ~500 MBit/s to ~920 MBit/s
* ping latency decresed from ~2ms to ~0.2 ms
I did some tests on my 9 node qemu environment and could confirm that
usual sending/receiving, forwarding, vis, batctl ping etc works.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Acked-by: Sven Eckelmann <sven.eckelmann@gmx.de> Acked-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
there are some kmallocs left which are not checked whether they succeeds or
not, which might lead to corrupted data structures if the system memory is
full. This patch should clean up the remaining unchecked kmalloc()s.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Marek Lindner [Sat, 2 Jan 2010 10:30:46 +0000 (11:30 +0100)]
Staging: batman-adv: splitting /proc vis file into vis_server and vis_data
The /proc vis file was used to enable/disable the vis server and to output
the vis data at the same time. This behaviour was confusing and lacked a
proper method to display the current vis server status.
This patch seperates the 2 functionalities:
* use vis_server to enable/disable the vis server and to retrieve its status
* use vis_data to retrieve the vis raw data (if the server is enabled)
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>
batman-adv used to export the vis data using different formats that were
switchable via /proc/net/batman-adv/vis_format. The various formats moved
to user space and rendered this configuration switch useless.
Signed-off-by: Linus Luessing <linus.luessing@web.de> 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>
Andrew Lunn [Sat, 2 Jan 2010 10:30:44 +0000 (11:30 +0100)]
Staging: batman-adv: moving vis output formats out of the kernel
The batman-adv kernel module is able to output visualization data using the
dot draw or JSON format. This patch transforms the output into a generic
format (called vis raw). User space tool may convert the raw data to support
a variety of formats without the need of modifying the kernel module.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Linus Lüssing [Sat, 2 Jan 2010 10:30:42 +0000 (11:30 +0100)]
Staging: batman-adv: Fixes rounding issues in vis.c
This patches fixes two rounding issues in vis.c for sending and
purging vis packets. Before, the timers and timeouts always got
rounded down to seconds, though we want a precision in
milliseconds.
This also fixes a kernel panic that occures when lowering the
timer for sending vis packets (vis_interval) to less than 1000ms
in main.c manually.
Signed-off-by: Linus Lüssing <linus.luessing@web.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 [Sat, 2 Jan 2010 10:30:41 +0000 (11:30 +0100)]
Staging: batman-adv: Use forw_bcast_list_lock always with disabled interrupts
forw_bcast_list_lock is spin_locked in both process and softirq context.
SoftIRQ calls the spinlock with disabled IRQ and normal process context
with enabled IRQs.
When process context is inside an spin_locked area protected by
forw_bcast_list_lock and gets interrupted by an IRQ, it could happen
that something tries to lock forw_bcast_list_lock again in SoftIRQ
context. It cannot proceed further since the lock is already taken
somewhere else, but no reschedule will happen inside the SoftIRQ
context. This leads to an complete kernel hang without any chance of
resurrection.
All functions called in process context must disable IRQs when they try
to get get that lock to to prevent any reschedule due to IRQs.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.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>
Jarod Wilson [Mon, 4 Jan 2010 23:02:27 +0000 (18:02 -0500)]
staging: add Broadcom Crystal HD driver
This patch supersedes the earlier ones sent by Manu Abraham to add
the Broadcom Crystal HD driver to the staging tree, per discussion
with him about it. I've been working with Broadcom's Naren Sankar
on this driver for a number of months, and had already talked Naren
about submitting this on Broadcom's behalf, didn't expect anyone
else to jump on submitting it as quickly as Manu did. ;)
This version is a one-shot deal, incorporating the original driver,
Manu's coding style clean-ups, udev device creation support from
Edgar 'gimli' Hucek, and a number of other small tweaks from myself
and Scott Davilla, the other individual who has been working closely
on this code with Naren and I.
I've tested this iteration of the code lightly on a mini pci-e board
in a ThinkPad T61p running x86_64 Fedora 12, with the expected results,
and will test further on other systems with other variants of the card
(I have three varieties of this device currently in hand). Scott has
also tested on assorted primarily i686 varieties of Ubuntu, and Naren
has tested with both Fedora and Ubuntu, iirc.
Note: only the 70012 is currently supported by this driver, 70015
support will follow later. Also note that Blu-Ray support isn't
enabled (at the firmware level), due to misc fun related to the
BD encryption scheme, DRM, etc. :\
I *do* have a git tree containing the driver, lib, gst plugin and
firmware that I'm working from at the moment[*], as there are inter-
dependencies between the driver and lib, and the driver can be used
with kernels going a ways back (I've only tested back to 2.6.18 as
it exists in Red Hat Enterprise Linux 5). I'm exporting from there,
into a linux-next tree, then generating patches from there. The goal
is to feed everything upstream as quickly as possible, but there are
users who want this code for earlier kernels too...
The firmware will be submitted for inclusion in dwmw2's linux-firmware
tree once there is a suitable redistribution-no-modification type of
license on it (I believe Naren is working with Broadcom legal to get
that in place).
include: lib doesn't build w/o the removed stdint include
So add it back...
Signed-off-by: Jarod Wilson <jarod@redhat.com>
commit c181070a330530b792d2b80e3ec6ab12a5a57394
Author: Scott Davilla <davilla@4pi.com>
Date: Mon Jan 4 13:38:37 2010 -0500
include: don't define VOID if its already defined
Signed-off-by: Scott Davilla <davilla@4pi.com> Signed-off-by: Jarod Wilson <jarod@redhat.com>
commit 33d8a2b691e81212e398f53770578d79650bf0bc
Author: Jarod Wilson <jarod@redhat.com>
Date: Mon Jan 4 13:12:10 2010 -0500
driver: create crystalhd device using udev
Based on:
http://sourceforge.net/apps/trac/archvdr/browser/trunk/archvdr/crystalhd/use_udev.patch
Signed-off-by: Edgar ( gimli ) Hucek <ebsi4711 at gmail dot com>
Formatting tweaks, error-handling path fixups and any bugs added by Jarod.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
commit c44c64dea5537814796fcbe2d9db0209383c78b9
Author: Manu Abraham <abraham.manu@gmail.com>
Date: Mon Jan 4 10:32:47 2010 -0500
crystalhd: coding style cleanups
Signed-off-by: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Jarod Wilson <jarod@redhat.com>
commit cffa6da7467ff697a656d1dfff54bb0513a053dc
Author: Jarod Wilson <jarod@redhat.com>
Date: Mon Jan 4 10:17:27 2010 -0500
crystalhd: run dos2unix over everything, this is linux source...
Signed-off-by: Jarod Wilson <jarod@redhat.com>
commit 7fa38a282db7af5a5746055f7c6cef8a9b8ee138
Author: Jarod Wilson <jarod@redhat.com>
Date: Mon Jan 4 10:02:33 2010 -0500
crystalhd: initial import of released Broadcom code
Unfortunately, we're unable to publicly publish all the history that got
us from the initial internal code to what was released here, but such is
life, we can just be happy we've got this open-sourced now. :)
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Naren Sankar <nsankar@broadcom.com> Signed-off-by: Scott Davilla <davilla@4pi.com> Signed-off-by: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Horman [Mon, 21 Dec 2009 04:09:53 +0000 (15:09 +1100)]
Staging: wlan-ng: initialise mibitem
$ gcc --version
gcc (Debian 4.4.2-5) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make
...
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_dorequest’:
drivers/staging/wlan-ng/p80211wext.c:139: warning: ‘mibitem.len’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:139: warning: ‘mibitem.status’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_giwretry’:
drivers/staging/wlan-ng/p80211wext.c:967: warning: ‘mibitem.len’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:967: warning: ‘mibitem.status’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:967: warning: ‘mibitem.data’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_siwretry’:
drivers/staging/wlan-ng/p80211wext.c:1057: warning: ‘mibitem.len’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:1057: warning: ‘mibitem.status’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_giwtxpow’:
drivers/staging/wlan-ng/p80211wext.c:1149: warning: ‘mibitem.len’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:1149: warning: ‘mibitem.status’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:1149: warning: ‘mibitem.data’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_siwtxpow’:
drivers/staging/wlan-ng/p80211wext.c:1123: warning: ‘mibitem.len’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:1123: warning: ‘mibitem.status’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_giwfrag’:
drivers/staging/wlan-ng/p80211wext.c:891: warning: ‘mibitem.len’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:891: warning: ‘mibitem.status’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:891: warning: ‘mibitem.data’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_siwfrag’:
drivers/staging/wlan-ng/p80211wext.c:933: warning: ‘mibitem.len’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:933: warning: ‘mibitem.status’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_giwrts’:
drivers/staging/wlan-ng/p80211wext.c:826: warning: ‘mibitem.len’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:826: warning: ‘mibitem.status’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:826: warning: ‘mibitem.data’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_siwrts’:
drivers/staging/wlan-ng/p80211wext.c:866: warning: ‘mibitem.len’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:866: warning: ‘mibitem.status’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_giwrate’:
drivers/staging/wlan-ng/p80211wext.c:775: warning: ‘mibitem.len’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:775: warning: ‘mibitem.status’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:775: warning: ‘mibitem.data’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_giwfreq’:
drivers/staging/wlan-ng/p80211wext.c:273: warning: ‘mibitem.len’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:273: warning: ‘mibitem.status’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:273: warning: ‘mibitem.data’ is used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_siwfreq’:
drivers/staging/wlan-ng/p80211wext.c:320: warning: ‘mibitem.len’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c: In function ‘p80211wext_siwmode’:
drivers/staging/wlan-ng/p80211wext.c:401: warning: ‘mibitem.len’ may be used uninitialized in this function
drivers/staging/wlan-ng/p80211wext.c:401: warning: ‘mibitem.status’ may be used uninitialized in this function
...
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Horman [Mon, 21 Dec 2009 04:07:50 +0000 (15:07 +1100)]
Staging: rtl8192su: Use z format qualifier for output of sizeof()
$ gcc --version
gcc (Debian 4.4.2-5) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make
...
drivers/staging/rtl8192su/ieee80211/rtl819x_BAProc.c: In function ‘ieee80211_rx_ADDBAReq’:
drivers/staging/rtl8192su/ieee80211/rtl819x_BAProc.c:342: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘unsigned int’
drivers/staging/rtl8192su/ieee80211/rtl819x_BAProc.c: In function ‘ieee80211_rx_ADDBARsp’:
drivers/staging/rtl8192su/ieee80211/rtl819x_BAProc.c:443: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘unsigned int’
drivers/staging/rtl8192su/ieee80211/rtl819x_BAProc.c: In function ‘ieee80211_rx_DELBA’:
drivers/staging/rtl8192su/ieee80211/rtl819x_BAProc.c:573: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘unsigned int’
...
Also some style fixes for these lines:
+ Fix excessively long lines
+ Remove leading space before struct
+ Remove unnecessary parentheses
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Justin Madru [Fri, 18 Dec 2009 23:52:53 +0000 (15:52 -0800)]
Staging: s5k3e2fx.c: simplify complexity by factoring
the code was looping, setting s_move[i] to the following calculations
if (actual_step>= 0)
s_move[i] = ((((i + 1) * gain + 0x200) - (i * gain + 0x200)) / 0x400);
else
s_move[i] = ((((i + 1) * gain - 0x200) - (i * gain - 0x200)) / 0x400);
but, this code reduces to the expression
s_move[i] = gain>> 10;
The reason for the complexity was to generate a step function with
integer division and rounding to land on specific values. But these calculations
can be simplified to the following code:
gain = ((actual_step<< 10) / 5)>> 10;
for (i = 0; i<= 4; i++)
s_move[i] = gain;
Signed-off-by: Justin Madru<jdm64@gawab.com> Reviewed-by: Ray Lee<ray-lk@madrabbit.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>