Re: [PATCH] drivers/staging/tidspbridge: using strlcpy instead of strncpy

2013-02-01 Thread Chen Gang
于 2013年02月02日 14:51, Chen Gang 写道: > > need use src lengh instead of dest length for strncpy. > need using strlcpy instead of strncpy, for the NUL terminated string. > > > Signed-off-by: root oh, sorry, the Signed-off-by is incorrect. excuse me, I changed my platform without setting

[PATCH] drivers/staging/tidspbridge: using strlcpy instead of strncpy

2013-02-01 Thread Chen Gang
need use src lengh instead of dest length for strncpy. need using strlcpy instead of strncpy, for the NUL terminated string. Signed-off-by: root --- drivers/staging/tidspbridge/rmgr/dbdcd.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/tidspb

Re: [PATCH 1/2] staging: comedi: export comedi_set_hw_dev()

2013-02-01 Thread Dan Carpenter
On Fri, Feb 01, 2013 at 02:54:59PM -0600, H Hartley Sweeten wrote: > On Friday, February 01, 2013 1:50 PM, Dan Carpenter wrote: > > On Fri, Feb 01, 2013 at 02:43:17PM -0600, H Hartley Sweeten wrote: > >> On Friday, February 01, 2013 6:23 AM, Ian Abbott wrote: > >>> diff --git a/drivers/staging/come

RE: [PATCH 1/2] staging: comedi: export comedi_set_hw_dev()

2013-02-01 Thread H Hartley Sweeten
On Friday, February 01, 2013 1:50 PM, Dan Carpenter wrote: > On Fri, Feb 01, 2013 at 02:43:17PM -0600, H Hartley Sweeten wrote: >> On Friday, February 01, 2013 6:23 AM, Ian Abbott wrote: >>> diff --git a/drivers/staging/comedi/comedidev.h >>> b/drivers/staging/comedi/comedidev.h >>> index f4541ae.

[PATCH 16/16] zcache/zbud: Fix __init mismatch

2013-02-01 Thread Konrad Rzeszutek Wilk
We get: WARNING: drivers/staging/zcache/zcache.o(.text+0x13a1): Section mismatch in reference from the function zcache_init() to the function .init.text:zbud_init() The function zcache_init() references the function __init zbud_init(). This is often because zcache_init lacks a __init annotation or

[PATCH 09/16] zcache: Move the last of the debugfs counters out

2013-02-01 Thread Konrad Rzeszutek Wilk
We now have in zcache-main only the counters that are are not debugfs related. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/debug.h | 80 +++- drivers/staging/zcache/zcache-main.c | 71 2 files changed, 87

[PATCH 07/16] zcache: Move debugfs code out of zcache-main.c file.

2013-02-01 Thread Konrad Rzeszutek Wilk
Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/Makefile | 3 +- drivers/staging/zcache/debug.c | 113 drivers/staging/zcache/debug.h | 183 ++ drivers/staging/zcache/zcache-main.c | 247 +-

[PATCH 12/16] zcache/zbud: Fix compiler warnings.

2013-02-01 Thread Konrad Rzeszutek Wilk
We get tons of: drivers/staging/zcache/zbud.c: In function ‘zbud_debugfs_init’: drivers/staging/zcache/zbud.c:323:2: warning: passing argument 4 of ‘debugfs_create_size_t’ from incompatible pointer type [enabled by default] In file included from drivers/staging/zcache/zbud.c:305:0: This fixes it

[PATCH 15/16] ramster: Fix compile warnings due to usage of debugfs_create_size_t

2013-02-01 Thread Konrad Rzeszutek Wilk
We get tons of "note: expected ‘size_t *’ but argument is of type ‘long int *’" warnings. This fixes it. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/ramster/ramster.c | 34 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/driver

[PATCH 06/16] zcache: Make the debug code use pr_debug

2013-02-01 Thread Konrad Rzeszutek Wilk
as if you are debugging this driver you would be using 'debug' on the command line anyhow - and this would dump the debug data on the proper loglevel. While at it also remove the unconditional #define ZCACHE_DEBUG. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zcache-main.c |

[PATCH 14/16] zcache/zbud: Provide the accessory functions for counter decrease.

2013-02-01 Thread Konrad Rzeszutek Wilk
Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zbud.c | 38 -- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/drivers/staging/zcache/zbud.c b/drivers/staging/zcache/zbud.c index cff596c..e139cd6 100644 --- a/drivers/staging/zca

[PATCH 13/16] zcache/zbud: Add incremental accessory counters

2013-02-01 Thread Konrad Rzeszutek Wilk
that are going to be used for debug fs entries. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zbud.c | 58 +-- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/drivers/staging/zcache/zbud.c b/drivers/staging/zcache/zbud.c i

[PATCH 08/16] zcache/debug: Use an array to initialize/use debugfs attributes.

2013-02-01 Thread Konrad Rzeszutek Wilk
It makes it neater and also allows us to piggyback on that in the zcache_dump function. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/debug.c | 141 ++--- 1 file changed, 47 insertions(+), 94 deletions(-) diff --git a/drivers/staging/zcache/

[PATCH 11/16] zcache/debug: Coalesce all debug under CONFIG_ZCACHE_DEBUG

2013-02-01 Thread Konrad Rzeszutek Wilk
and also define this extra attribute in the Kconfig entry. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/Kconfig | 8 drivers/staging/zcache/debug.c | 2 +- drivers/staging/zcache/zcache-main.c | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-)

[PATCH 10/16] zcache: Module license is defined twice.

2013-02-01 Thread Konrad Rzeszutek Wilk
The other (same license) is at the end of the file. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zcache-main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index 8341d79..8830359 100644 --- a/

[PATCH 05/16] zcache: Fix compile warnings due to usage of debugfs_create_size_t

2013-02-01 Thread Konrad Rzeszutek Wilk
When we compile we get tons of: include/linux/debugfs.h:80:16: note: expected ‘size_t *’ but argument is of type ‘long int *’ drivers/staging/zcache/zcache-main.c:279:2: warning: passing argument 4 of ‘debugfs_create_size_t’ from incompatible pointer type [enabled by d efault] which is b/c we end

[PATCH 03/16] zcache: Provide accessory functions for counter decrease.

2013-02-01 Thread Konrad Rzeszutek Wilk
This way we can have all wrapped with these functions and can disable/enable this with CONFIG_DEBUG_FS. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zcache-main.c | 88 +--- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/drivers

[RFC PATCH] Various fixes for zcache.

2013-02-01 Thread Konrad Rzeszutek Wilk
Hey Greg, and Dan, I posted these patches some time ago, and I think Dan Ack-ed them but they are based on the patches which enables frontswap to have backends as modules. So PLEASE just consider them RFC and _NOT_ apply them - as they won't cleanly apply. They are based on this posting: https:/

[PATCH 04/16] zcache: The last of the atomic reads has now an accessory function.

2013-02-01 Thread Konrad Rzeszutek Wilk
And now we can move the code to its own file. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zcache-main.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index a55a95b

[PATCH 01/16] zcache: s/int/bool/ on the various options.

2013-02-01 Thread Konrad Rzeszutek Wilk
There are so many, but this allows us to at least have them right in as bool. [v1: Rebase on ramster->zcache move] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zcache-main.c | 46 ++-- 1 file changed, 23 insertions(+), 23 deletions(-) diff --gi

[PATCH 02/16] zcache: Provide accessory functions for counter increase

2013-02-01 Thread Konrad Rzeszutek Wilk
This is the first step in moving the debugfs code out of the main file in-to another file. And also allow the code to run without CONFIG_DEBUG_FS defined. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zcache-main.c | 103 +++ 1 file changed, 68 i

Re: [PATCH 1/2] staging: comedi: export comedi_set_hw_dev()

2013-02-01 Thread Dan Carpenter
On Fri, Feb 01, 2013 at 02:43:17PM -0600, H Hartley Sweeten wrote: > On Friday, February 01, 2013 6:23 AM, Ian Abbott wrote: > > diff --git a/drivers/staging/comedi/comedidev.h > > b/drivers/staging/comedi/comedidev.h > > index f4541ae..33207fb 100644 > > --- a/drivers/staging/comedi/comedidev.h >

RE: [PATCH 1/2] staging: comedi: export comedi_set_hw_dev()

2013-02-01 Thread H Hartley Sweeten
On Friday, February 01, 2013 6:23 AM, Ian Abbott wrote: > Chnage the inline `comedi_set_hw_dev()` to an exported function and > change it's return type from `void` to `int` so we can impose some > restrictions (in a later patch) and return an error if necessary. > > Only a few comedi drivers call t

[PATCH 15/15] xen/tmem: Add missing %s in the printk statement.

2013-02-01 Thread Konrad Rzeszutek Wilk
Seems that it got lost. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/tmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c index 2f939e5..4f3ff99 100644 --- a/drivers/xen/tmem.c +++ b/drivers/xen/tmem.c @@ -401,7 +401,7 @@ stat

[PATCH 14/15] zcache/tmem: Better error checking on frontswap_register_ops return value.

2013-02-01 Thread Konrad Rzeszutek Wilk
In the past it either used to be NULL or the "older" backend. Now we also return -Exx error codes. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zcache-main.c | 5 - drivers/xen/tmem.c | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git

[PATCH 12/15] cleancache: Use static_key instead of cleancache_ops and cleancache_enabled.

2013-02-01 Thread Konrad Rzeszutek Wilk
As ways to determine whether to allow certain functions to be called. This makes it easier to understand the code - the three functions that can be called by the filesystem irregardless whether a backend is set or not cleancache_init_fs, cleancache_init_shared_fs, and cleancache_invalidate_fs. Th

[PATCH 13/15] frontswap: Get rid of swap_lock dependency

2013-02-01 Thread Konrad Rzeszutek Wilk
From: Minchan Kim Frontswap initialization routine depends on swap_lock, which want to be atomic about frontswap's first appearance. IOW, frontswap is not present and will fail all calls OR frontswap is fully functional but if new swap_info_struct isn't registered by enable_swap_info, swap subsys

[PATCH 10/15] frontswap: Use static_key instead of frontswap_enabled and frontswap_ops

2013-02-01 Thread Konrad Rzeszutek Wilk
As ways to determine whether to allow certain functions to be called. This makes it easier to understand the code - the two functions that can be called irregardless whether a backend is set or not is the frontswap_init and frontswap_invalidate_area. The rest of the frontswap functions end up being

[PATCH 09/15] frontswap: Remove the check for frontswap_enabled.

2013-02-01 Thread Konrad Rzeszutek Wilk
With the support for loading of backends as modules (see for example: "staging: zcache: enable zcache to be built/loaded as a module"), the frontswap_enabled is always set to true ("mm: frontswap: lazy initialization to allow tmem backends to build/run as modules"). The next patch "frontswap: Use

[PATCH 08/15] xen/tmem: Remove the subsys call.

2013-02-01 Thread Konrad Rzeszutek Wilk
We get: drivers/xen/xen-selfballoon.c:577:134: warning: initialization from incompatible pointer type [enabled by default] We actually do not need this function to be called before tmem is loaded. So lets remove the subsys_init. If tmem is built in as a module this is still OK as xen_selfballoon

[PATCH 11/15] cleancache: Remove the check for cleancache_enabled.

2013-02-01 Thread Konrad Rzeszutek Wilk
With the support for loading of backends as modules, the cleancache_enabled is always set to true. The next subsequent patches are going to convert the cleancache_enabled to be a bit more selective and be on/off depending on whether the backend has registered - and not whether the cleancache API is

[PATCH 06/15] staging: zcache: enable zcache to be built/loaded as a module

2013-02-01 Thread Konrad Rzeszutek Wilk
Allow zcache to be built/loaded as a module. Note runtime dependency disallows loading if cleancache/frontswap lazy initialization patches are not present. Zsmalloc support has not yet been merged into zcache but, once merged, could now easily be selected via a module_param. If built-in (not bui

[PATCH 04/15] cleancache: Make cleancache_init use a pointer for the ops

2013-02-01 Thread Konrad Rzeszutek Wilk
Instead of using a backend_registered to determine whether a backend is enabled. This allows us to remove the backend_register check and just do 'if (cleancache_ops)' [v1: Rebase on top of b97c4b430b0a405a57c78607b520d8000329e259 (ramster->zcache move] Signed-off-by: Konrad Rzeszutek Wilk --- dr

[PATCH 07/15] xen: tmem: enable Xen tmem shim to be built/loaded as a module

2013-02-01 Thread Konrad Rzeszutek Wilk
From: Dan Magenheimer Allow Xen tmem shim to be built/loaded as a module. Xen self-ballooning and frontswap-selfshrinking are now also "lazily" initialized when the Xen tmem shim is loaded as a module, unless explicitly disabled by module parameters. Note runtime dependency disallows loading if

[PATCH 03/15] frontswap: Make frontswap_init use a pointer for the ops.

2013-02-01 Thread Konrad Rzeszutek Wilk
This simplifies the code in the frontswap - we can get rid of the 'backend_registered' test and instead check against frontswap_ops. [v1: Rebase on top of 703ba7fe5e085f2c85eeb451c2ac13cf275c7cb2 (ramster->zcache move] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/staging/zcache/zcache-main.c

[PATCH 01/15] mm: cleancache: lazy initialization to allow tmem backends to build/run as modules

2013-02-01 Thread Konrad Rzeszutek Wilk
From: Dan Magenheimer With the goal of allowing tmem backends (zcache, ramster, Xen tmem) to be built/loaded as modules rather than built-in and enabled by a boot parameter, this patch provides "lazy initialization", allowing backends to register to cleancache even after filesystems were mounted.

[PATCH 05/15] staging: zcache: enable ramster to be built/loaded as a module

2013-02-01 Thread Konrad Rzeszutek Wilk
From: Dan Magenheimer Enable module support for ramster. Note runtime dependency disallows loading if cleancache/frontswap lazy initialization patches are not present. If built-in (not built as a module), the original mechanism of enabling via a kernel boot parameter is retained, but this shoul

[PATCH 02/15] mm: frontswap: lazy initialization to allow tmem backends to build/run as modules

2013-02-01 Thread Konrad Rzeszutek Wilk
From: Dan Magenheimer With the goal of allowing tmem backends (zcache, ramster, Xen tmem) to be built/loaded as modules rather than built-in and enabled by a boot parameter, this patch provides "lazy initialization", allowing backends to register to frontswap even after swapon was run. Before a b

[PATCH v2] Make frontswap+cleancache and its friend be modularized.

2013-02-01 Thread Konrad Rzeszutek Wilk
Parts of this patch have been posted in the post (way back in November), but this patchset expanded it a bit. The goal of the patches is to make the different frontswap/cleancache API backends be modules - and load way way after the swap system (or filesystem) has been initialized. Naturally one ca

RE: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V

2013-02-01 Thread KY Srinivasan
> -Original Message- > From: devel [mailto:devel-boun...@linuxdriverproject.org] On Behalf Of KY > Srinivasan > Sent: Friday, February 01, 2013 10:11 AM > To: Stefano Stabellini; H. Peter Anvin > Cc: o...@aepfle.de; gre...@linuxfoundation.org; jasow...@redhat.com; > x...@kernel.org; linux

Re: [PATCHv4 3/7] zswap: add to mm/

2013-02-01 Thread Seth Jennings
On 02/01/2013 09:31 AM, Seth Jennings wrote: > On 01/31/2013 08:38 PM, Minchan Kim wrote: >> On Thu, Jan 31, 2013 at 01:06:46PM -0600, Seth Jennings wrote: >>> On 01/31/2013 01:07 AM, Minchan Kim wrote: On Tue, Jan 29, 2013 at 03:40:23PM -0600, Seth Jennings wrote: > zswap is a thin compre

Re: [PATCHv4 3/7] zswap: add to mm/

2013-02-01 Thread Seth Jennings
On 01/31/2013 08:38 PM, Minchan Kim wrote: > On Thu, Jan 31, 2013 at 01:06:46PM -0600, Seth Jennings wrote: >> On 01/31/2013 01:07 AM, Minchan Kim wrote: >>> On Tue, Jan 29, 2013 at 03:40:23PM -0600, Seth Jennings wrote: zswap is a thin compression backend for frontswap. It receives pages

Re: [PATCHv4 0/7] zswap: compressed swap caching

2013-02-01 Thread Seth Jennings
On 01/31/2013 07:39 PM, Simon Jeons wrote: > Hi Seth, > On Tue, 2013-01-29 at 15:40 -0600, Seth Jennings wrote: >> Performance, Kernel Building: >> >> Setup >> >> Gentoo w/ kernel v3.7-rc7 >> Quad-core i5-2500 @ 3.3GHz >> 512MB DDR3 1600MHz (limited with mem=512m on boot) >> Filesystem an

RE: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V

2013-02-01 Thread KY Srinivasan
> -Original Message- > From: Stefano Stabellini [mailto:stefano.stabell...@eu.citrix.com] > Sent: Friday, February 01, 2013 8:20 AM > To: H. Peter Anvin > Cc: Jan Beulich; KY Srinivasan; o...@aepfle.de; b...@alien8.de; > a...@canonical.com; x...@kernel.org; t...@linutronix.de; > devel@lin

[PATCH 2/2] staging: comedi: ni_labpc: correct differential channel sequence for AI commands

2013-02-01 Thread Ian Abbott
Tuomas reported problems getting meaningful output from a Lab-PC+ in differential mode for AI cmds, but AI insn reads gave correct readings. He tracked it down to two problems, one of which is addressed by this patch. It seems the setting of the channel bits for particular scanning modes was inc

[PATCH 0/2] staging: comedi: ni_labpc: AI cmd differential mode fixes

2013-02-01 Thread Ian Abbott
Here are a couple of patches to fix problems with AI commands in differential mode (particularly for single-channel acquisition) for NI Lab-PC+ cards and presumably the other Lab-PC cards supported by the driver (the relationship between channel multiplexor bits, scan enable bit and multiplexor bit

[PATCH 1/2] staging: comedi: ni_labpc: set up command4 register *after* command3

2013-02-01 Thread Ian Abbott
Tuomas reported problems getting meaningful output from a Lab-PC+ in differential mode for AI cmds, but AI insn reads gave correct readings. He tracked it down to two problems, one of which is addressed by this patch. It seems that writing to the command3 register after writing to the command4 r

Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V

2013-02-01 Thread Stefano Stabellini
On Thu, 31 Jan 2013, H. Peter Anvin wrote: > On 01/30/2013 12:53 AM, Jan Beulich wrote: > > > > I'm not convinced that's the right approach - any hypervisor > > could do similar emulation, and hence you either want to make > > sure you run on Hyper-V (by excluding all others), or you > > tolerate

[PATCH 2/2] staging: comedi: restrict comedi_set_hw_dev() usage

2013-02-01 Thread Ian Abbott
Don't allow comedi drivers to change `dev->hw_dev` using `comedi_set_hw_dev()` if it's already been set. Return `-EEXIST` in that case. `dev->hw_dev` needs to be set to NULL by the core during clean-up of the comedi device, so add a local function `comedi_clear_hw_dev()` to do that. Signed-off-b

[PATCH 0/2] comedi_set_hw_dev() changes

2013-02-01 Thread Ian Abbott
We don't want a comedi device driver to change the `struct comedi_device`'s `hw_dev` member once it has been set (usually automatically by `comedi_auto_attach()`), so change `comedi_set_hw_dev()` to prevent this. Also change it to an external function instead of an inline function. 1) staging: co

[PATCH 1/2] staging: comedi: export comedi_set_hw_dev()

2013-02-01 Thread Ian Abbott
Chnage the inline `comedi_set_hw_dev()` to an exported function and change it's return type from `void` to `int` so we can impose some restrictions (in a later patch) and return an error if necessary. Only a few comedi drivers call this, although they don't need to if the hardware device has been

[PATCH 0/2] staging: comedi: hide subdevice_minor functions

2013-02-01 Thread Ian Abbott
The `comedi_alloc_subdevice_minor()` and `comedi_free_subdevice_minor()` functions are only for use by the comedi core, but are currently declared in the header file shared by all comedi drivers instead of the header file internal to the comedi core. Also `comedi_alloc_subdevice_minor()` has more

[PATCH 1/2] staging: comedi: move comedi_alloc_subdevice_minor declarations

2013-02-01 Thread Ian Abbott
Move the declarations of `comedi_alloc_subdevice_minor()` and `comedi_free_subdevice_minor()` from "comedidev.h" to "comedi_internal.h" since they are only of interest to the comedi core, and are not exported to the low-level comedi drivers. Signed-off-by: Ian Abbott --- drivers/staging/comedi/c

[PATCH 2/2] staging: comedi: change comedi_alloc_subdevice_minor parameters

2013-02-01 Thread Ian Abbott
`comedi_alloc_subdevice_minor()` doesn't really need a parameter pointing to a `struct comedi_device` as it can get this information from the parameter pointing to a `struct comedi_subdevice`. Just pass the subdevice parameter. Signed-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c

[PATCH] Staging: wlan-ng: Fix tab coding style issue in hfa384x.h

2013-02-01 Thread Garrick He
From: Garrick He Fix all 'please, no space before tabs' warning found by checkpatch.pl Signed-off-by: Garrick He --- drivers/staging/wlan-ng/hfa384x.h | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x.h b/dri