Eliezer Tamir writes:
> +While busy polling my improve latency of some application, care must be
> +taken when using it since this will increase both CPU utilization power
> usage.
s/my/may/; missing 'and' before 'power usage'. [And should
'application' be plural?]
Rasmus
--
To unsubscribe fr
Al Viro writes:
> On Thu, Jul 11, 2013 at 02:42:54PM -0700, Linus Torvalds wrote:
>> But with an *old* kernel, O_TMPFILE will just silently be ignored as
>> an unrecognized flag, and things won't work. If you do
>>
>> fd = open("dirname", O_CREAT | O_TMPFILE | O_RDWR, 0666);
>>
>> it may be t
Al Viro writes:
> On Fri, Jul 12, 2013 at 12:02:45PM +0000, Rasmus Villemoes wrote:
>
>> But isn't the problem the case where dirname does not exist? I.e., the
>> application has to make sure that "/some/where" exists and is a directory
>> before open(&quo
fdget() is implemented using fget_light(). Its companion fdput()
currently open-codes the behaviour of fput_light(). This is slightly
confusing. To follow the documentation in fs/file.c:688ff to the
letter, use fput_light() in fdput().
Signed-off-by: Rasmus Villemoes
---
include/linux/file.h
Use IS_ERR_VALUE() instead of comparing the new offset to a hard-coded
value of -MAX_ERRNO (which is also off-by-one due to the use of ~
instead of -).
Signed-off-by: Rasmus Villemoes
---
drivers/char/mem.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char
Ping...
Rasmus Villemoes writes:
> This patch is very similar to 84d96d897671: Perform some basic
> validation of the input to mremap() before taking the
> ¤t->mm->mmap_sem lock. This also makes the MREMAP_FIXED =>
> MREMAP_MAYMOVE dependency slightly more explicit.
>
8997_dev *max8998 = d->host_data;
I may be wrong, but this sure looks like a typo (or copy-pasto).
--
Rasmus Villemoes
<http://rasmusvillemoes.dk/>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger
Linus Torvalds writes:
> On Fri, Jul 12, 2013 at 12:39 PM, Al Viro wrote:
>>
>> [suggested by Rasmus Villemoes] make O_DIRECTORY | O_RDWR part of O_TMPFILE;
>> that will fail on old kernels in a lot more cases than what I came up with.
>
> So see earlier about why I
Alex Thorlton writes:
> This patch implements functionality to allow processes to disable the use of
> transparent hugepages through the prctl syscall.
A few comments:
Is there a reason it shouldn't be possible for a process to un-disable/reenable
thp?
> +static inline int transparent_hugep
cific, the _ASM_POWERPC_RWSEM_H and #ifdef CONFIG_PPC64
seem malplaced.
Rasmus Villemoes (4):
asm-generic: Make sure include guards contain the substring
ASM_GENERIC
asm-generic: Use different include guards
asm-generic: Add missing include guards
asm-generic: Fix typo in comment
-hits are:
arch/mn10300/include/asm/rtc.h uses _ASM_RTC_H and includes
asm-generic/rtc.h which uses __ASM_RTC_H__
arch/hexagon/include/asm/cacheflush.h uses _ASM_CACHEFLUSH_H and
includes asm-generic/cacheflush.h which uses __ASM_CACHEFLUSH_H
Signed-off-by: Rasmus Villemoes
---
include/asm-generic
Add include guards to include/asm-generic/{ide_iops,unistd,xor}.h.
Signed-off-by: Rasmus Villemoes
---
include/asm-generic/ide_iops.h |4
include/asm-generic/unistd.h |5 +
include/asm-generic/xor.h |4
3 files changed, 13 insertions(+)
diff --git a/include/asm
Fix the comment so that it matches the actual name of the include
guard used.
Signed-off-by: Rasmus Villemoes
---
include/asm-generic/bitops/arch_hweight.h |2 +-
include/asm-generic/bitops/atomic.h |2 +-
include/asm-generic/pci_iomap.h |2 +-
include/asm-generic
For consistency, use different include guards in
include/asm-generic/dma-mapping-{broken,common}.h, even though it is
unlikely (if not outright a bug) to ever include both.
Signed-off-by: Rasmus Villemoes
---
include/asm-generic/dma-mapping-broken.h |6 +++---
include/asm-generic/dma
1;
+ return false;return true;
}
Is there a way to prevent this, or is this the kind of thing which
must be handled in post-processing?
Signed-off-by: Rasmus Villemoes
---
scripts/coccinelle/misc/boolreturn.cocci | 51 ++
1 file changed, 51 insertions
This semantic patch replaces "return {0,1};" with "return
{false,true};" in functions returning bool.
Signed-off-by: Rasmus Villemoes
---
v2: Simplified script, and eliminate whitespace mangling at the same
time. Thanks to Julia Lawall.
scripts/coccinelle/misc/boo
This semantic patch replaces "return {0,1};" with "return
{false,true};" in functions returning bool.
Signed-off-by: Rasmus Villemoes
---
v2: Simplified script, and eliminate whitespace mangling at the same
time. Thanks to Julia Lawall.
v3: Further improvements from Julia. I
In madvise(), there doesn't seem to be any reason for taking the
¤t->mm->mmap_sem before start and len_in have been
validated. Incidentally, this removes the need for the out: label.
Signed-off-by: Rasmus Villemoes
---
diff --git a/mm/madvise.c b/mm/madvise.c
index c58c94b..d2a
On 2016-07-15 15:46, Guenter Roeck wrote:
On 07/15/2016 01:15 AM, Rasmus Villemoes wrote:
+static bool bcm2835_wdt_is_running(struct bcm2835_wdt *wdt)
+{
+uint32_t cur;
+
+cur = readl(wdt->base + PM_RSTC);
+
+return !!(cur & PM_RSTC_WRCFG_FULL_RESET);
+}
+
sta
On 2016-07-15 16:29, Guenter Roeck wrote:
On 07/15/2016 12:32 AM, Rasmus Villemoes wrote:
The initial timeout should be specified as module option or as
devicetree parameter, and there should be no additional configuration
option.
I was under the impression that device tree was exclusively
fd = open("/proc/self/status", O_RDONLY);
read(fd, buf, sizeof(buf));
close(fd);
}
Signed-off-by: Rasmus Villemoes
---
fs/proc/array.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/proc/array.c b/fs/proc/array.c
index
bin2hex doesn't. [All but one user of ecryptfs_to_hex explicitly
nul-terminates the result anyway.]
Signed-off-by: Rasmus Villemoes
---
fs/ecryptfs/crypto.c | 15 ---
fs/ecryptfs/ecryptfs_kernel.h | 8 +++-
2 files changed, 7 insertions(+), 16 deletions(-)
diff --git
On Wed, Sep 21 2016, Kees Cook wrote:
> On Tue, Sep 20, 2016 at 3:28 PM, Rasmus Villemoes
> wrote:
>> format_decode and vsnprintf occasionally show up in perf top, so I
>> went looking for places that might not need the full printf
>> power. With the help of kprobes, I
On 2016-07-21 02:31, Guenter Roeck wrote:
On Thu, Jul 21, 2016 at 12:08:52AM +0200, Rasmus Villemoes wrote:
I hear you. "configure hardware" is a slippery term, though. After all,
one would typically configure the initial timeout in hardware, just as
any "normal" timeout.
Every other dentry_operations instance is const, and this one might as
well be.
Signed-off-by: Rasmus Villemoes
---
mm/shmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index fd8b2b5741b1..693ffdc5899a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
The actual definition in fs/nsfs.c is already const.
Signed-off-by: Rasmus Villemoes
---
Maybe fs/nsfs.c (and fs/buffer.c) should grow includes of
internal.h. I think they are the only two providing stuff declared
there but not including it.
fs/internal.h | 2 +-
1 file changed, 1 insertion
Using a local variable we can prevent gcc from reloading
aio_ring_file->f_inode->i_mapping twice, eliminating 2x2 dependent
loads.
Signed-off-by: Rasmus Villemoes
---
fs/aio.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/aio.c b/fs/aio.c
index fb8e45
aDate is always the empty string, so entirely pointless. The aRevision
formatting might as well be done as part of the pr_debug() call - that
also avoids it altogether if pr_debug is compiled out.
Signed-off-by: Rasmus Villemoes
---
drivers/usb/musb/musb_core.c | 12 +---
1 file changed
, change the two variables to
signed, making the counting-down for loop look more familiar, and
apparently also making gcc generate slightly smaller code.
[1] https://lkml.org/lkml/2016/6/20/493
[2] https://lkml.org/lkml/2017/6/19/345
Signed-off-by: Rasmus Villemoes
---
Michal, something like this
On 2017-05-25 02:56, Guenter Roeck wrote:
> On 05/22/2017 07:06 AM, Rasmus Villemoes wrote:
>> diff --git a/Documentation/watchdog/watchdog-parameters.txt
>> b/Documentation/watchdog/watchdog-parameters.txt
>> index 914518a..4801ec6 100644
>> --- a/Documentation/watch
This will be useful when the condition becomes slightly more
complicated in the next patch.
Reviewed-by: Guenter Roeck
Reviewed-by: Esben Haabendal
Signed-off-by: Rasmus Villemoes
---
drivers/watchdog/watchdog_dev.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff
, and the ability to set the
default value for the watchdog.open_timeout command line parameter via
Kconfig is split into a separate patch.
Compared to v2/v3, this drops the ability to set the open_timeout via
a device property; I'll leave implementing that to those who actually
need it.
R
more than 5 seconds after
the bootloader hands control to the kernel (250 ms until the driver gets
registered and kernel handling starts, 4500 ms of kernel handling, and
then up to 250 ms from the last ping until userspace takes over).
Signed-off-by: Rasmus Villemoes
---
Documentation/watchdog
, and is
of course immensely useful for development purposes while one has
console acccess, as well as usable in the cases where one can make a
permanent update of the kernel command line.
Signed-off-by: Rasmus Villemoes
---
Documentation/watchdog/watchdog-parameters.txt | 3 ++-
drivers/wat
On 25 October 2017 at 01:57, Tobin C. Harding wrote:
> On Tue, Oct 24, 2017 at 09:25:20PM +0200, Rasmus Villemoes wrote:
>>
>> I haven't followed the discussion too closely, but has it been
>> considered to exempt NULL from hashing?
>
[snip]
>
>
This serves as human-readable documentation as well as allowing the
format_template plugin to complain about any static initializers of this
struct member that do not have the same set of printf specifiers.
Signed-off-by: Rasmus Villemoes
---
include/linux/usb.h | 2 +-
1 file changed, 1
is attribute to smp_hotplug_thread::thread_comm and modifying
kernel/watchdog.c slightly, an example of the error message produced for
violations is:
kernel/watchdog.c:528:1: error: initializer string 'watchdog/%u %d' contains
extra format specifier '%d' compared to format templ
This serves as human-readable documentation as well as allowing the
format_template plugin to complain about any static initializers of this
struct member that do not have the same set of printf specifiers.
Signed-off-by: Rasmus Villemoes
---
drivers/staging/speakup/spk_types.h | 2 +-
1 file
This serves as human-readable documentation as well as allowing the
format_template plugin to complain about any static initializers of this
struct member that do not have the same set of printf specifiers.
Signed-off-by: Rasmus Villemoes
---
drivers/hwmon/applesmc.c | 2 +-
1 file changed, 1
This serves as human-readable documentation as well as allowing the
format_template plugin to complain about any static initializers of this
struct member that do not have the same set of printf specifiers.
Signed-off-by: Rasmus Villemoes
---
include/linux/smpboot.h | 2 +-
1 file changed, 1
We've already done data->irq and data->hwirq, and also unconditionally
dereference data in the irq_data_get_irq_chip_data() call.
Signed-off-by: Rasmus Villemoes
---
kernel/irq/irqdomain.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/irq/irqdomain.c b
in this
series.
Rasmus Villemoes (7):
net: core: improve sanity checking in __dev_alloc_name
net: core: move dev_alloc_name_ns a little higher
net: core: eliminate dev_alloc_name{,_ns} code duplication
net: core: drop pointless check in __dev_alloc_name
net: core: check dev_valid_name in _
t_by_name using that buffer rather than name.
Signed-off-by: Rasmus Villemoes
---
net/core/dev.c | 14 +-
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 7c08b4ca7b76..e29eea26f9c1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -
We currently only exclude non-sysfs-friendly names via
dev_get_valid_name; there doesn't seem to be a reason to allow such
names when we're called via dev_alloc_name.
This does duplicate the dev_valid_name check in the dev_get_valid_name()
case; we'll fix that shortly.
Signed
No functional change.
Signed-off-by: Rasmus Villemoes
---
net/core/dev.c | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 87e19804757b..240ae6bc1097 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1105,6
If we're given format string with no %d, -EEXIST is a saner error code.
Signed-off-by: Rasmus Villemoes
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index c0a92cf27566..7c08b4ca7b76 100644
--- a/net/core/dev.c
+++
The only caller passes a stack buffer as buf, so it won't equal the
passed-in name. Moreover, we're already using buf as a scratch buffer
inside the if (p) {} block, so if buf and name were the same, that
snprintf() call would be overwriting its own format string.
Signed-off-by: Rasmus
dev_alloc_name contained a BUG_ON(), which I moved to dev_alloc_name_ns;
the only other caller of that already has the same BUG_ON.
Signed-off-by: Rasmus Villemoes
---
net/core/dev.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/net/core/dev.c b/net/core
sily crash the kernel (using an appropriate %p extension,
we'll likely dereference some completely bogus pointer).
In the normal case where strlen() is sane, we don't even save anything
by limiting to IFNAMSIZ, so just use strchr().
Signed-off-by: Rasmus Villemoes
---
net/core/dev.c |
The LS1021A can be reset via the dcfg regmap in the same way as the
arm64 layerscape SoCs, so add the corresponding DT node.
Signed-off-by: Rasmus Villemoes
---
arch/arm/boot/dts/ls1021a.dtsi | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm
that.
Signed-off-by: Rasmus Villemoes
---
arch/arm/boot/dts/ls1021a.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index 3ff2b8a9f01a..9cdec545decc 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boo
On Thu, Nov 09 2017, Linus Torvalds wrote:
> The code disassembles to
>
>0: 83 c9 08 or $0x8,%ecx
>3: 40 f6 c6 04 test $0x4,%sil
>7: 0f 45 d1 cmovne %ecx,%edx
>a: 89 d1mov%edx,%ecx
>c: 80 cd 04 or $0
On 14 November 2017 at 07:57, Rakib Mullick wrote:
> Currently, during __bitmap_weight() calculation hweight_long() is used.
> Inside a hweight_long() a check has been made to figure out whether a
> hweight32() or hweight64() version to use.
>
> diff --git a/lib/bitmap.c b/lib/bitmap.c
> index d8f
From: Esben Haabendal
Add usb2 and usb3 labels to USB2 and USB3 controller device tree nodes,
for easier modification in board dts files.
Signed-off-by: Esben Haabendal
Signed-off-by: Rasmus Villemoes
---
arch/arm/boot/dts/ls1021a.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions
From: Esben Haabendal
This avoids the warning
hw perfevents: no interrupt-affinity property for /pmu, guessing.
Signed-off-by: Esben Haabendal
[RV: adapt commit log to the warning emitted in current mainline]
Signed-off-by: Rasmus Villemoes
---
arch/arm/boot/dts/ls1021a.dtsi | 1 +
1 file
On 14 November 2017 at 00:54, Linus Torvalds
wrote:
> On Mon, Nov 13, 2017 at 3:30 PM, Linus Torvalds
> wrote:
>>
>> So let's just rewrite that mnt_flags conversion that way, justr to get
>> gcc to generate the obvious code.
>
> Oh wow. I tried to do the same thing in fs/namespace.c where it does
On 14 November 2017 at 23:43, Linus Torvalds
wrote:
> On Tue, Nov 14, 2017 at 2:24 PM, Rasmus Villemoes
> wrote:
>>
>> Can you be more specific? That's not what I see with gcc 7.1.
>
> I have gcc-7.2.1, and it made a horrible mess of the do_mount() code.
Odd. 7.
inux/kernel/git/tglx/history.git/commit/?id=c1c48e61c251f57e7a3f1bf11b3c462b2de9dcb5
Signed-off-by: Rasmus Villemoes
---
drivers/char/random.c | 53 ---
1 file changed, 25 insertions(+), 28 deletions(-)
diff --git a/drivers/char/random.c b/drivers
d_mask being a single bit; it's all whole-sale |= and &=).
However, a sufficiently aggressive optimizer may use the UB of 1<<31
to decide that doesn't happen, and hence elide the sign-extension
code, so that subsequent calls can indeed get ffz > 31. In any case,
this is the righ
On Mon, Oct 05 2015, Ingo Molnar wrote:
> * Linus Torvalds wrote:
>
>> So I finally pulled it. I like the patch, I like the new interface,
>> but despite that I wasn't really sure if I wanted to pull it in - thus
>> the long delay of me just seeing this in my list of pending pulls for
>> almost
indirection through the cpu_xyz_mask variables.
Acked-by: Rusty Russell
Signed-off-by: Rasmus Villemoes
---
kernel/cpu.c | 44 ++--
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 82cf9dff4295..fea4a3ce3011
Replace the variables cpu_possible_mask, cpu_online_mask,
cpu_present_mask and cpu_active_mask with macros expanding to
expressions of the same type and value, eliminating some indirection.
Acked-by: Rusty Russell
Signed-off-by: Rasmus Villemoes
---
include/linux/cpumask.h | 8
kernel
Russell
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rasmus Villemoes
---
drivers/base/cpu.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 91bbb1959d8d..691eeea2f19a 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base
Almost all callers of the set_cpu_* functions pass an explicit true
or false. Making them static inline thus replaces the function calls
with a simple set_bit/clear_bit, saving some .text.
Acked-by: Rusty Russell
Signed-off-by: Rasmus Villemoes
---
include/linux/cpumask.h | 43
Exporting the cpumasks __cpu_possible_mask and friends will allow us
to remove the extra indirection through the cpu_*_mask variables. It
will also allow the set_cpu_* functions to become static inlines,
which will give a .text reduction.
Acked-by: Rusty Russell
Signed-off-by: Rasmus Villemoes
riate
immediate address into %rdi before each call.
[1] See Rusty's kind explanation
http://thread.gmane.org/gmane.linux.kernel/2047078/focus=2047722 for
some historic context.
Rasmus Villemoes (6):
powerpc/fadump: rename cpu_online_mask member of struct
fadump_crash_info_header
kernel/c
On Mon, Oct 05 2015, Bart Van Assche wrote:
> On 10/05/15 02:26, Rasmus Villemoes wrote:
>> -{0x041A, "Logical unit not ready, start stop unit command in "
>> - "progress"},
>> -{0x041B, "Logical unit not ready, sanitize in progre
On Mon, Oct 05 2015, Bart Van Assche wrote:
> On 10/05/15 02:26, Rasmus Villemoes wrote:
>> struct error_info {
>> unsigned short code12; /* 0x0302 looks better than 0x03,0x02 */
>> -const char * text;
>> +unsigned short size;
>> };
>
On Tue, Oct 06 2015, Julian Calaby wrote:
> Hi Rasmus,
>
>>
>> diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
>> index 47aaccd5e68e..ccd34b0481cd 100644
>> --- a/drivers/scsi/constants.c
>> +++ b/drivers/scsi/constants.c
>> @@ -292,17 +292,31 @@ bool scsi_opcode_sa_name(int opco
Signed-off-by: Rasmus Villemoes
---
arch/powerpc/include/asm/fadump.h | 2 +-
arch/powerpc/kernel/fadump.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/fadump.h
b/arch/powerpc/include/asm/fadump.h
index 493e72f64b35..b4407d0add27 100644
On Tue, Oct 06 2015, Jiri Slaby wrote:
> When dumping flags with which the kernel was built, we print them one
> by one in separate printks. Let's use pr_cont as they are
> continuation prints.
>
> Signed-off-by: Jiri Slaby
> Cc: Thomas Gleixner
> Cc: Ingo Molnar
> Cc: "H. Peter Anvin"
> Cc:
suggest better names, and/or to flame this idea to death.
Signed-off-by: Rasmus Villemoes
---
include/linux/kconfig.h | 75 +
1 file changed, 75 insertions(+)
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
index b33c7797eb57..ac209
Jiri Slaby noted that these #ifdef protected printks should really be
pr_cont. However, we might as well get completely rid of both the
multiple printk calls and the tiny #ifdef sections by just building an
appropriate string and passing that to the first printk call.
Signed-off-by: Rasmus
On Tue, Oct 06 2015, Ingo Molnar wrote:
> * Rasmus Villemoes wrote:
>
>>
>> I'm not against making strlcpy more robust, but I think the theoretical race
>> is
>> far more likely to manifest through a member of the printf family.
>
> So the printf fa
On Wed, Oct 07 2015, Ingo Molnar wrote:
> We have procfs and sysfs as well, where format strings are indeed dominant,
> but
> are you sure this race exists in snprintf() in that form? I.e. can the return
> value of snprintf() be different from the true length of the output string,
> if the
>
On Wed, Oct 07 2015, Michal Marek wrote:
> On 2015-10-06 23:05, Rasmus Villemoes wrote:
>> It's not hard to generalize the macro magic used to build the
>> IS_ENABLED macro and friends to produce a few other potentially useful
>> macros:
>>
>> CHOOSE_EXPR(C
I've lost track of what's up and down in this, but now that I look at
this again let me throw in my two observations of stupid gcc behaviour:
For the current code, both debian's gcc (4.7) and 5.1 partially inlines
_find_next_bit, namely the "if (!nbits || start >= nbits)" test. I know it
does it to
Using the same include guard as linux/cpu_cooling.h will cause build
breakage if those headers are ever used from the same TU.
Signed-off-by: Rasmus Villemoes
---
include/linux/clock_cooling.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux
We save a little .text and get rid of the sizeof(...) style
inconsistency.
Signed-off-by: Rasmus Villemoes
---
drivers/net/ethernet/cavium/liquidio/lio_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c
b/drivers/net
The double memset is a little ugly; using kzalloc avoids it altogether.
Signed-off-by: Rasmus Villemoes
---
drivers/net/ethernet/marvell/mv643xx_eth.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c
b/drivers/net/ethernet
These are just a few k[czm]alloc/memset related cleanups.
Rasmus Villemoes (4):
net: cavium: liquidio: use kzalloc in setup_glist()
net: jme: use kzalloc() instead of kmalloc+memset
net: mv643xx_eth: use kzalloc
net: qlcnic: delete redundant memsets
drivers/net/ethernet/cavium/liquidio
Using kzalloc saves a tiny bit on .text.
Signed-off-by: Rasmus Villemoes
---
drivers/net/ethernet/jme.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 6e9a792097d3..060dd3922974 100644
--- a/drivers/net
In all cases, mbx->req.arg and mbx->rsp.arg have just been allocated
using kcalloc(), so these six memsets are redundant.
Signed-off-by: Rasmus Villemoes
---
I cranked $context_lines to 11 to make the kcallocs visible.
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 2 --
d
On Wed, Sep 09 2015, Joe Perches wrote:
> On Wed, 2015-09-09 at 10:38 +0200, Rasmus Villemoes wrote:
>> The double memset is a little ugly; using kzalloc avoids it altogether.
> []
>> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c
>> b/drivers/net/ethern
On Wed, Sep 09 2015, Joe Perches wrote:
> On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote:
>> When printing a bitmap using the "%*pb[l]" printk format
>> a 16 bit variable (field_width) is used to store the size of the bitmap.
>> In some cases 16 bits are not sufficient, the variable o
f
a static char (but non-const) array.
Signed-off-by: Rasmus Villemoes
---
kernel/trace/trace_events.c | 24
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 7ca09cdc20c2..ae97d73b31fa 100644
---
let sort() pick an
appropriate and fast swap callback.
Signed-off-by: Rasmus Villemoes
---
kernel/trace/ftrace.c | 13 +
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b0623ac785a2..186bafa9935d 100644
--- a/kernel
__futex_data>
: c3 retq
: 0f 1f 00nopl (%rax)
Signed-off-by: Rasmus Villemoes
---
Resending since this was never picked up - and I assume it's actually
ok. Also, this time the alignment is spelled 2*sizeof(long) to avoid
wasting 8 bytes
Using kstrdup_const, thus reusing .rodata when possible, saves around
2 kB of runtime memory on my laptop/.config combination.
Signed-off-by: Rasmus Villemoes
---
lib/dynamic_debug.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib
Using kstrdup_const allows us to save a little runtime memory (and a
string copy) in the common case where name is a string literal.
Signed-off-by: Rasmus Villemoes
---
drivers/base/power/wakeup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power
nstead use kstrdup_const directly (which
would also require one to change all corresponding kfree calls to
kfree_const).
Signed-off-by: Rasmus Villemoes
---
include/linux/kernel.h | 2 ++
lib/kasprintf.c| 16
2 files changed, 18 insertions(+)
diff --git a/include/linux/kernel.h
be quadrupled
when KMALLOC_SHIFT_LOW==5. Whether these numbers are sufficient to
justify the ugliness I'll leave to others to decide.
Signed-off-by: Rasmus Villemoes
---
lib/kobject.c | 30 ++
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/lib/kob
Empirically, acpi_add_id is mostly called with string literals, so
using kstrdup_const for initializing struct acpi_hardware_id::id saves
a little run-time memory and a string copy.
Signed-off-by: Rasmus Villemoes
---
drivers/acpi/scan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions
This is preparation for using kstrdup_const to initialize that member.
Signed-off-by: Rasmus Villemoes
---
drivers/acpi/scan.c| 4 ++--
drivers/pnp/pnpacpi/core.c | 4 ++--
include/acpi/acpi_bus.h| 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi
stifying struct acpi_hardware_id::id.
Signed-off-by: Rasmus Villemoes
---
drivers/acpi/acpi_pnp.c | 4 ++--
include/acpi/acpi_bus.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
index c58940b231d6..48fc3ad13a4b 100644
--- a/drivers/
so we can eliminate some stack buffers and quite a bit of
code by just using %pUL directly.
In wmi_dev_uevent I'm not sure whether there's room for a
nul-terminator in env->buf, so I've just replaced wmi_gtoa with the
equivalent sprintf call.
Signed-off-by: Rasmus Villemoes
---
arg is long int, so arg = (arg << 22) >> 22 makes the upper 22 bits of
arg equal to bit 9 (or bit 41). But we then mask away all but bits 0-9, so
this is entirely redundant.
Signed-off-by: Rasmus Villemoes
---
gcc seems to be smart enough to realize this - the generated code is
the s
, destination string.
Signed-off-by: Rasmus Villemoes
---
Probably not -stable-worthy. I can only find two callers, one of which
ignores the return value.
mm/maccess.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/maccess.c b/mm/maccess.c
index 34fe24759ed1..d318db246826 100644
at least we get rid of the
dead code which pretended to check for access faults.
Signed-off-by: Rasmus Villemoes
---
There are other things worth looking at. i40e_dbg_netdev_ops_buf is a
static buffer of size 256, which can be filled from user space (in
i40e_dbg_netdev_ops_write). That function c
On Tue, Oct 06 2015, Rasmus Villemoes wrote:
> v2: fix build failure on ppc, add acks.
Does anyone want to take these through their tree?
Rasmus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More m
1 - 100 of 1998 matches
Mail list logo