This patch just simply unifies the coding style.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 239 +---
sound/soc/fsl/fsl_ssi.h | 2 +-
sound/soc/fsl/fsl_ssi_dbg.c |
Since this i2smode also includes the setting of Network mode, it
should have it in the name. This patch also adds its MASK define.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 24
Some regmap code looks redudant. So simplify it.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 27 +++
Some regmap code looks redudant. So simplify it.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 27 +++
sound/soc/fsl/fsl_ssi.h | 4
2 files changed, 15 insertions(+), 16 deletions(-)
This patches unifies the error message in the "failed to " format.
It also reduces the length of one line and adds spaces to an operator.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
This patches unifies the error message in the "failed to " format.
It also reduces the length of one line and adds spaces to an operator.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 16
1 file
Shortens the variable name to save space, useful for dev_err outputs.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 32
This patch renames CCSR_SSI_xxx to REG_SSI_xxx and SSI_xxx_yyy style.
It also slightly reduces the length of them to save some space.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
Shortens the variable name to save space, useful for dev_err outputs.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 32
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git
This patch renames CCSR_SSI_xxx to REG_SSI_xxx and SSI_xxx_yyy style.
It also slightly reduces the length of them to save some space.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 374
Shorten the private data structure to save some wrapped lines.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 456
==Changelog==
v3->v4
* Revised PATCH-03 "Refine all comments" by adding Timur's inputs
* Rebased all other patches
v2->v3
* Added Tested-by and Reviewed-by from Maciej
* Revised PATCH-03 "Refine all comments" by adding Maciej's advice
* Revised PATCH-05 "Refine indentations and wrappings"
*
Shorten the private data structure to save some wrapped lines.
Signed-off-by: Nicolin Chen
Tested-by: Maciej S. Szmigiero
Reviewed-by: Maciej S. Szmigiero
---
sound/soc/fsl/fsl_ssi.c | 456 +++-
1 file changed, 220 insertions(+), 236 deletions(-)
==Changelog==
v3->v4
* Revised PATCH-03 "Refine all comments" by adding Timur's inputs
* Rebased all other patches
v2->v3
* Added Tested-by and Reviewed-by from Maciej
* Revised PATCH-03 "Refine all comments" by adding Maciej's advice
* Revised PATCH-05 "Refine indentations and wrappings"
*
Hi Shawn,
Sorry for bother. I just couldn’t find this patch on your git tree.
Could you help to check?
Thanks a lot.
Best regards,
Yangbo Lu
> -Original Message-
> From: Shawn Guo [mailto:shawn...@kernel.org]
> Sent: 2017年11月30日 8:29
> To: Y.b. Lu
> Cc:
Hi Shawn,
Sorry for bother. I just couldn’t find this patch on your git tree.
Could you help to check?
Thanks a lot.
Best regards,
Yangbo Lu
> -Original Message-
> From: Shawn Guo [mailto:shawn...@kernel.org]
> Sent: 2017年11月30日 8:29
> To: Y.b. Lu
> Cc: devicet...@vger.kernel.org;
On 12/17/2017 02:30 PM, Tobin C. Harding wrote:
> Recently the behaviour of printk specifier %pK was changed. The
> documentation does not currently mirror this.
>
> Update documentation for sysctl kpt_restrict.
>
> Signed-off-by: Tobin C. Harding
> ---
>
On 12/17/2017 02:30 PM, Tobin C. Harding wrote:
> Recently the behaviour of printk specifier %pK was changed. The
> documentation does not currently mirror this.
>
> Update documentation for sysctl kpt_restrict.
>
> Signed-off-by: Tobin C. Harding
> ---
> Documentation/sysctl/kernel.txt | 3
Hi Philipp,
just a couple of small nitpicks.
> + u32 b_clk_freq;
[...]
> + /* Base clock frequency (optional) */
> + if (of_property_read_u32(dn, "clock-frequency", _clk_freq)) {
> + b_clk_freq = SUNXI_IR_BASE_CLK;
> + }
> +
how about you intialize 'b_clk_freq' to
Hi Philipp,
just a couple of small nitpicks.
> + u32 b_clk_freq;
[...]
> + /* Base clock frequency (optional) */
> + if (of_property_read_u32(dn, "clock-frequency", _clk_freq)) {
> + b_clk_freq = SUNXI_IR_BASE_CLK;
> + }
> +
how about you intialize 'b_clk_freq' to
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
head: 779f4e1c6c7c661db40dfebd6dd6bda7b5f88aa3
commit: d17a1d97dc208d664c91cc387ffb752c7f85dc61 x86/mm/kasan: don't use
vmemmap_populate() to initialize shadow
date: 5 weeks ago
config:
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
head: 779f4e1c6c7c661db40dfebd6dd6bda7b5f88aa3
commit: d17a1d97dc208d664c91cc387ffb752c7f85dc61 x86/mm/kasan: don't use
vmemmap_populate() to initialize shadow
date: 5 weeks ago
config:
- Forwarded message from bugzilla-dae...@bugzilla.kernel.org -
Date: Fri, 15 Dec 2017 22:24:36 +
From: bugzilla-dae...@bugzilla.kernel.org
To: bugzilla@gmail.com
Subject: [Bug 198171] New: [AMD][X399] Inconsistent PCIe lane linking count
- Forwarded message from bugzilla-dae...@bugzilla.kernel.org -
Date: Fri, 15 Dec 2017 22:24:36 +
From: bugzilla-dae...@bugzilla.kernel.org
To: bugzilla@gmail.com
Subject: [Bug 198171] New: [AMD][X399] Inconsistent PCIe lane linking count
On 12/18/2017 06:18 AM, Matthew Wilcox wrote:
On Sun, Dec 17, 2017 at 01:47:21PM +, Wang, Wei W wrote:
On Saturday, December 16, 2017 3:22 AM, Matthew Wilcox wrote:
On Fri, Dec 15, 2017 at 10:49:15AM -0800, Matthew Wilcox wrote:
- xbit_clear() can't return an error. Neither can
On 12/18/2017 06:18 AM, Matthew Wilcox wrote:
On Sun, Dec 17, 2017 at 01:47:21PM +, Wang, Wei W wrote:
On Saturday, December 16, 2017 3:22 AM, Matthew Wilcox wrote:
On Fri, Dec 15, 2017 at 10:49:15AM -0800, Matthew Wilcox wrote:
- xbit_clear() can't return an error. Neither can
- Forwarded message from bugzilla-dae...@bugzilla.kernel.org -
Date: Sun, 17 Dec 2017 15:04:51 +
From: bugzilla-dae...@bugzilla.kernel.org
To: bugzilla@gmail.com
Subject: [Bug 198181] New: BUG at drivers/pci/msi.c:352 when unplugging a sysfs
authorized thunderbolt 3 dock
- Forwarded message from bugzilla-dae...@bugzilla.kernel.org -
Date: Sun, 17 Dec 2017 15:04:51 +
From: bugzilla-dae...@bugzilla.kernel.org
To: bugzilla@gmail.com
Subject: [Bug 198181] New: BUG at drivers/pci/msi.c:352 when unplugging a sysfs
authorized thunderbolt 3 dock
On 12/16/2017 01:20 AM, Marc Zyngier wrote:
On 15/12/17 16:17, Lorenzo Pieralisi wrote:
[+Marc]
On Thu, Dec 14, 2017 at 10:21:23AM +0800, cao@windriver.com wrote:
From: Zou Cao
When PCIE host setup, 32 MSI irq descriptions are created, but its
msi_desc is NULL,
On 12/16/2017 01:20 AM, Marc Zyngier wrote:
On 15/12/17 16:17, Lorenzo Pieralisi wrote:
[+Marc]
On Thu, Dec 14, 2017 at 10:21:23AM +0800, cao@windriver.com wrote:
From: Zou Cao
When PCIE host setup, 32 MSI irq descriptions are created, but its
msi_desc is NULL, msi_desc is bound in
Since more and more Mediatek's SoC can use this driver to
control spi-nor flash, functions' name with "mt8173_" is
no longer properly. Replacing "mt8173_" with "mtk_" will
be more accurate to describe these functions' usable scope.
Signed-off-by: Guochun Mao
---
Since more and more Mediatek's SoC can use this driver to
control spi-nor flash, functions' name with "mt8173_" is
no longer properly. Replacing "mt8173_" with "mtk_" will
be more accurate to describe these functions' usable scope.
Signed-off-by: Guochun Mao
---
Since more and more Mediatek's SoC can use this driver to control
spi-nor flash, functions' name with "mt8173_" is no longer properly.
Replacing "mt8173_" with "mtk_" will be more accurate to describe
these functions' usable scope.
Guochun Mao (1):
mtd: mtk-nor: modify functions' name more
Since more and more Mediatek's SoC can use this driver to control
spi-nor flash, functions' name with "mt8173_" is no longer properly.
Replacing "mt8173_" with "mtk_" will be more accurate to describe
these functions' usable scope.
Guochun Mao (1):
mtd: mtk-nor: modify functions' name more
The cfs_get_random_bytes() interface adds nothing of value
to get_random_byte() (which it uses internally). So just use the
standard interface.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lustre/include/obd_class.h |2 +-
.../lustre/lustre/obdclass/lustre_handles.c
The cfs_get_random_bytes() interface adds nothing of value
to get_random_byte() (which it uses internally). So just use the
standard interface.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lustre/include/obd_class.h |2 +-
.../lustre/lustre/obdclass/lustre_handles.c|2
The only places that cfs_srand is called, the random bits are
mixed with bits from get_random_bytes(). So it is equally effective
to add entropy to either pool.
So we can replace calls to cfs_srand() with calls that add the
entropy with add_device_randomness(). That function adds time-based
The cfs prng is no longer used, so discard it.
Signed-off-by: NeilBrown
---
.../staging/lustre/include/linux/libcfs/libcfs.h | 10 -
drivers/staging/lustre/lnet/libcfs/Makefile|2
drivers/staging/lustre/lnet/libcfs/prng.c | 137
3
All occurrences of
cfs_rand() % X
are replaced with
prandom_u32_max(X)
cfs_rand() is a simple Linear Congruential PRNG. prandom_u32_max()
is at least as random, is seeded with more randomness, and uses
cpu-local state to avoid cross-cpu issues.
This is the first step is discarding the
The only places that cfs_srand is called, the random bits are
mixed with bits from get_random_bytes(). So it is equally effective
to add entropy to either pool.
So we can replace calls to cfs_srand() with calls that add the
entropy with add_device_randomness(). That function adds time-based
The cfs prng is no longer used, so discard it.
Signed-off-by: NeilBrown
---
.../staging/lustre/include/linux/libcfs/libcfs.h | 10 -
drivers/staging/lustre/lnet/libcfs/Makefile|2
drivers/staging/lustre/lnet/libcfs/prng.c | 137
3 files changed, 1
All occurrences of
cfs_rand() % X
are replaced with
prandom_u32_max(X)
cfs_rand() is a simple Linear Congruential PRNG. prandom_u32_max()
is at least as random, is seeded with more randomness, and uses
cpu-local state to avoid cross-cpu issues.
This is the first step is discarding the
Lustre has its own internal PRNG code.
This adds nothing of value to the Linux standard prng code,
so switch over to using the standard interfaces.
This adds a few callers to add_device_randomness(), which
helps everyone, and removes unnecessary code.
Thanks,
NeilBrown
---
NeilBrown (4):
Lustre has its own internal PRNG code.
This adds nothing of value to the Linux standard prng code,
so switch over to using the standard interfaces.
This adds a few callers to add_device_randomness(), which
helps everyone, and removes unnecessary code.
Thanks,
NeilBrown
---
NeilBrown (4):
There are now no users. workqueues are doing the job
that this used to do.
Signed-off-by: NeilBrown
---
.../staging/lustre/include/linux/libcfs/libcfs.h |1
.../lustre/include/linux/libcfs/libcfs_workitem.h | 104
drivers/staging/lustre/lnet/libcfs/Makefile
There are now no users. workqueues are doing the job
that this used to do.
Signed-off-by: NeilBrown
---
.../staging/lustre/include/linux/libcfs/libcfs.h |1
.../lustre/include/linux/libcfs/libcfs_workitem.h | 104
drivers/staging/lustre/lnet/libcfs/Makefile|2
Instead of the cfs workitem library, use workqueues.
As lnet wants to provide a cpu mask of allowed cpus, it
needs to be a WQ_UNBOUND work queue so that tasks can
run on cpus other than where they were submitted.
apply_workqueue_atts needs to be exported for lustre to use it.
Signed-off-by:
In every case, the value passed via wi_data can be determined
from the cfs_workitem pointer using container_of().
So use container_of(), and discard wi_data.
Signed-off-by: NeilBrown
---
.../lustre/include/linux/libcfs/libcfs_workitem.h |5 +
Instead of the cfs workitem library, use workqueues.
As lnet wants to provide a cpu mask of allowed cpus, it
needs to be a WQ_UNBOUND work queue so that tasks can
run on cpus other than where they were submitted.
apply_workqueue_atts needs to be exported for lustre to use it.
Signed-off-by:
In every case, the value passed via wi_data can be determined
from the cfs_workitem pointer using container_of().
So use container_of(), and discard wi_data.
Signed-off-by: NeilBrown
---
.../lustre/include/linux/libcfs/libcfs_workitem.h |5 +
Lustre has a "workitem" subsystem with much the same
functionality as the Linux workqueue subsystem.
This patch converts all users of workitem to workqueue,
then removes workitem.
This requires that "apply_workqueue_attrs" be exported
to modules, so this intro and the patch which does
the
lustre has a work-item queuing scheme that provides the
same functionality as linux work_queues.
To make the code easier for linux devs to follow, change
to use work_queues.
Signed-off-by: NeilBrown
---
.../staging/lustre/include/linux/libcfs/libcfs.h |2
Lustre has a "workitem" subsystem with much the same
functionality as the Linux workqueue subsystem.
This patch converts all users of workitem to workqueue,
then removes workitem.
This requires that "apply_workqueue_attrs" be exported
to modules, so this intro and the patch which does
the
lustre has a work-item queuing scheme that provides the
same functionality as linux work_queues.
To make the code easier for linux devs to follow, change
to use work_queues.
Signed-off-by: NeilBrown
---
.../staging/lustre/include/linux/libcfs/libcfs.h |2
lustre_fill_super() calls client_fill_super() without holding a
reference to the module containing client_fill_super. If that
module is unloaded at a bad time, this can crash.
To be able to get a reference to the module using
try_get_module(), we need a pointer to the module.
So replace
This arg is always NULL and is never used.
So discard it from this and related functions.
Signed-off-by: NeilBrown
---
.../staging/lustre/lustre/include/lustre_disk.h|3 +--
.../staging/lustre/lustre/llite/llite_internal.h |2 +-
lustre_fill_super() calls client_fill_super() without holding a
reference to the module containing client_fill_super. If that
module is unloaded at a bad time, this can crash.
To be able to get a reference to the module using
try_get_module(), we need a pointer to the module.
So replace
This arg is always NULL and is never used.
So discard it from this and related functions.
Signed-off-by: NeilBrown
---
.../staging/lustre/lustre/include/lustre_disk.h|3 +--
.../staging/lustre/lustre/llite/llite_internal.h |2 +-
drivers/staging/lustre/lustre/llite/llite_lib.c
This is used to pass a void* and NULL to lustre_fill_super().
It is easier just to pass the void*.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lustre/obdclass/obd_mount.c | 19 ---
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git
This is used to pass a void* and NULL to lustre_fill_super().
It is easier just to pass the void*.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lustre/obdclass/obd_mount.c | 19 ---
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git
Lustre mounts do not need a dev, as we can see from lustre_mount()
calling mount_nodev(). So remove the flag which could cause
confusion elsewhere.
Also format lustre_fs_types so that fields line up.
Signed-off-by: NeilBrown
---
These patches make improvements to the lustre code
for supporting the mount system call.
There is a user-visible change: "lustre" now appears in
/proc/filesystem with the "nodev" flag present. Previously
it didn't have this flag, which was incorrect.
There is also a bugfix: there is a possible
Lustre mounts do not need a dev, as we can see from lustre_mount()
calling mount_nodev(). So remove the flag which could cause
confusion elsewhere.
Also format lustre_fs_types so that fields line up.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lustre/obdclass/obd_mount.c | 10
These patches make improvements to the lustre code
for supporting the mount system call.
There is a user-visible change: "lustre" now appears in
/proc/filesystem with the "nodev" flag present. Previously
it didn't have this flag, which was incorrect.
There is also a bugfix: there is a possible
From: Randy Dunlap
Fix build errors due to missing header file.
Fixes these build errors:
drivers/input//touchscreen/hideep.c: In function 'hideep_power_on':
drivers/input//touchscreen/hideep.c:670:3: error: implicit declaration of
function 'gpiod_set_value_cansleep';
From: Randy Dunlap
Fix build errors due to missing header file.
Fixes these build errors:
drivers/input//touchscreen/hideep.c: In function 'hideep_power_on':
drivers/input//touchscreen/hideep.c:670:3: error: implicit declaration of
function 'gpiod_set_value_cansleep'; did you mean
On Sun, Dec 17, 2017 at 04:04:14PM -0800, Joe Perches wrote:
> On Mon, 2017-12-18 at 10:53 +1100, Tobin C. Harding wrote:
> > Depends on: commit bd6b239cdbb2 ("kallsyms: don't leak address when
> > symbol not found")
> >
> > Currently vsprintf for specifiers %p[SsB] relies on the behaviour of
> >
On Sun, Dec 17, 2017 at 04:04:14PM -0800, Joe Perches wrote:
> On Mon, 2017-12-18 at 10:53 +1100, Tobin C. Harding wrote:
> > Depends on: commit bd6b239cdbb2 ("kallsyms: don't leak address when
> > symbol not found")
> >
> > Currently vsprintf for specifiers %p[SsB] relies on the behaviour of
> >
These are no longer used.
Signed-off-by: NeilBrown
---
.../lustre/include/linux/libcfs/libcfs_private.h | 19 ---
1 file changed, 19 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
These are no longer used.
Signed-off-by: NeilBrown
---
.../lustre/include/linux/libcfs/libcfs_private.h | 19 ---
1 file changed, 19 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
The size of the data structure is primarily controlled
by the iovec size, which is limited to 256.
Entries in this vector are 12 bytes, so the whole
will always fit in a page.
So it is safe to use kmalloc (kvmalloc not needed).
So replace LIBCFS_ALLOC with kmalloc.
Signed-off-by: NeilBrown
The size of the data structure is primarily controlled
by the iovec size, which is limited to 256.
Entries in this vector are 12 bytes, so the whole
will always fit in a page.
So it is safe to use kmalloc (kvmalloc not needed).
So replace LIBCFS_ALLOC with kmalloc.
Signed-off-by: NeilBrown
---
Just call kzalloc(GFP_ATOMIC) directly.
We don't need the warning on failure.
Signed-off-by: NeilBrown
---
.../lustre/lustre/obdclass/lprocfs_status.c|7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git
this allocation is called from several places, but all are
during initialization, so GFP_NOFS is not needed.
So use kvmalloc and GFP_KERNEL.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lnet/libcfs/libcfs_mem.c |6 +++---
1 file changed, 3 insertions(+), 3
Just call kzalloc(GFP_ATOMIC) directly.
We don't need the warning on failure.
Signed-off-by: NeilBrown
---
.../lustre/lustre/obdclass/lprocfs_status.c|7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
this allocation is called from several places, but all are
during initialization, so GFP_NOFS is not needed.
So use kvmalloc and GFP_KERNEL.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lnet/libcfs/libcfs_mem.c |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
This allocation is reasonably small.
As the function is called "*_locked", it might not be safe
to perform a GFP_KERNEL allocation, so be safe and
use GFP_NOFS.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lnet/lnet/router.c |5 ++---
1 file changed, 2 insertions(+),
This allocation is reasonably small.
As the function is called "*_locked", it might not be safe
to perform a GFP_KERNEL allocation, so be safe and
use GFP_NOFS.
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lnet/lnet/router.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
None of these need GFP_NOFS so allocate directly.
Change matching LIBCFS_FREE() to kfree() or kvfree().
Signed-off-by: NeilBrown
---
.../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 19 +++
drivers/staging/lustre/lnet/lnet/lib-eq.c |9 -
None of these need to be GFP_NOFS, so use GFP_KERNEL explicitly
with kmalloc(), kvmalloc(), or kvmalloc_array().
Changing matching LIBCFS_FREE() to kfree() or kvfree()
Signed-off-by: NeilBrown
---
.../lustre/lnet/libcfs/linux/linux-module.c|4 +-
These are not called from filesystem context, so use
GFP_KERNEL, not LIBCFS_ALLOC().
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lnet/selftest/console.c | 57 +---
drivers/staging/lustre/lnet/selftest/framework.c |4 +
None of these need GFP_NOFS so allocate directly.
Change matching LIBCFS_FREE() to kfree() or kvfree().
Signed-off-by: NeilBrown
---
.../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 19 +++
drivers/staging/lustre/lnet/lnet/lib-eq.c |9 -
None of these need to be GFP_NOFS, so use GFP_KERNEL explicitly
with kmalloc(), kvmalloc(), or kvmalloc_array().
Changing matching LIBCFS_FREE() to kfree() or kvfree()
Signed-off-by: NeilBrown
---
.../lustre/lnet/libcfs/linux/linux-module.c|4 +-
These are not called from filesystem context, so use
GFP_KERNEL, not LIBCFS_ALLOC().
Signed-off-by: NeilBrown
---
drivers/staging/lustre/lnet/selftest/console.c | 57 +---
drivers/staging/lustre/lnet/selftest/framework.c |4 +
The buffers allocated in router_proc are to temporarily
hold strings created for procfs files.
So they do not need to be zeroed and are safe to use
GFP_KERNEL.
So use kmalloc() directly except in two cases where it
isn't trivial to confirm that the size is always small.
In those cases, use
The buffers allocated in router_proc are to temporarily
hold strings created for procfs files.
So they do not need to be zeroed and are safe to use
GFP_KERNEL.
So use kmalloc() directly except in two cases where it
isn't trivial to confirm that the size is always small.
In those cases, use
All of the "name" buffers here are at most LST_NAME_SIZE+1
bytes, so 33 bytes at most.
They are only used temporarily during the life of the function
that allocates them.
So it is much simpler to just allocate on the stack.
Worst case is lst_tet_add_ioct(), which allocates
3 for these which 99
So that we can use the common cpumask allocation functions,
switch to cpumask_var_t.
We need to be careful not the free a cpumask_var_t until the
variable has been initialized, and it cannot be initialized
directly.
So we must be sure either that it is filled with zeros, or
that
When an allocation happens from process context rather than
filesystem context, it is best to use GFP_KERNEL rather than
LIBCFS_ALLOC() which always uses GFP_NOFS.
This include initialization during, or prior to, mount,
and code run from separate worker threads.
So for some of these cases, switch
All usages of the form
LIBCFS_ALLOC(variable, sizeof(variable))
or
LIBCFS_ALLOC(variable, sizeof(variable's-type))
are changed to
variable = kzalloc(sizeof(...), GFP_NOFS);
Similarly, all
LIBCFS_FREE(variable, sizeof(variable))
become
kfree(variable);
None of these need the vmalloc
All of the "name" buffers here are at most LST_NAME_SIZE+1
bytes, so 33 bytes at most.
They are only used temporarily during the life of the function
that allocates them.
So it is much simpler to just allocate on the stack.
Worst case is lst_tet_add_ioct(), which allocates
3 for these which 99
So that we can use the common cpumask allocation functions,
switch to cpumask_var_t.
We need to be careful not the free a cpumask_var_t until the
variable has been initialized, and it cannot be initialized
directly.
So we must be sure either that it is filled with zeros, or
that
When an allocation happens from process context rather than
filesystem context, it is best to use GFP_KERNEL rather than
LIBCFS_ALLOC() which always uses GFP_NOFS.
This include initialization during, or prior to, mount,
and code run from separate worker threads.
So for some of these cases, switch
All usages of the form
LIBCFS_ALLOC(variable, sizeof(variable))
or
LIBCFS_ALLOC(variable, sizeof(variable's-type))
are changed to
variable = kzalloc(sizeof(...), GFP_NOFS);
Similarly, all
LIBCFS_FREE(variable, sizeof(variable))
become
kfree(variable);
None of these need the vmalloc
These functions just call LIBCFS_ALLOC() which in-turn
calls kvmalloc().
In none of these cases is the 'vmalloc' option needed.
LIBCFS_ALLOC also produces a warning if NULL is returned,
but that can be provided with CONFIG_SLAB_DEBUG.
LIBCFS_ALLOC zeros the memory, so we need to use
__GFP_ZERO
Lustre has some "convenience" macros for allocating and freeing
memory.
They:
- warn if called from interrupt context
- use kvmalloc
- assume GFP_NOFS (which kvmalloc doesn't support)
- print an error if the allocation fails
- initialize the memory to zeroes.
though the _ATOMIC version skips
These trivial wrappers hurt readability and
as they use kvmalloc, they are overly generic.
So discard them and use kmalloc/kfree as is
normal in Linux.
Signed-off-by: NeilBrown
---
.../lustre/include/linux/libcfs/libcfs_private.h |3 ---
These functions just call LIBCFS_ALLOC() which in-turn
calls kvmalloc().
In none of these cases is the 'vmalloc' option needed.
LIBCFS_ALLOC also produces a warning if NULL is returned,
but that can be provided with CONFIG_SLAB_DEBUG.
LIBCFS_ALLOC zeros the memory, so we need to use
__GFP_ZERO
Lustre has some "convenience" macros for allocating and freeing
memory.
They:
- warn if called from interrupt context
- use kvmalloc
- assume GFP_NOFS (which kvmalloc doesn't support)
- print an error if the allocation fails
- initialize the memory to zeroes.
though the _ATOMIC version skips
These trivial wrappers hurt readability and
as they use kvmalloc, they are overly generic.
So discard them and use kmalloc/kfree as is
normal in Linux.
Signed-off-by: NeilBrown
---
.../lustre/include/linux/libcfs/libcfs_private.h |3 ---
drivers/staging/lustre/lnet/lnet/net_fault.c
301 - 400 of 828 matches
Mail list logo