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 <mi...@kernel.org> wrote:
> * Rasmus Villemoes <li...@rasmusvillemoes.dk> wrote:
>
>>
>> I'm not against making strlcpy more robust, but I think the theoretical race
>> is
>> far more likely to manifest through a memb
On Thu, Oct 08 2015, Ingo Molnar wrote:
> * Linus Torvalds wrote:
>
>> So I really refuse to worry about the snprintf() family of functions wrt
>> this
>> race. I don't think it was hugely important for strlcpy() either - more of a
>> "quality
On Fri, Oct 09 2015, Valdis Kletnieks <valdis.kletni...@vt.edu> wrote:
> Author: Rasmus Villemoes <li...@rasmusvillemoes.dk>
> Date: Wed Oct 7 15:09:20 2015 +1100
>
> slab.h: sprinkle __assume_aligned attributes
>
> causes *tons* of whinges if you d
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 <li...@rasmusvillemoes.dk>
---
include/linux/clock_cooling.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff
These are clearly just used during init.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
arch/x86/kernel/fpu/init.c | 4 ++--
arch/x86/kernel/fpu/xstate.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kern
There's no reason to duplicate the logic provided by scnprintf().
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/misc/mei/bus.c | 19 ---
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
scnprintf() exists to provide these semantics, so we might as well use
it.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/hid/hid-core.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.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
On Thu, Sep 10 2015, Linus Torvalds wrote:
> The VERY FIRST conversion patch I looked at was buggy. That makes me
> angry. The whole *AND*ONLY* point of this whole thing was to get rid
> of bugs, and be a obviously safe interface, and then the first
> conversion
On Thu, Sep 10 2015, Joe Perches <j...@perches.com> wrote:
> On Thu, 2015-09-10 at 09:04 +0200, Maurizio Lombardi wrote:
>> Hi Rasmus,
>>
>> On 09/09/2015 08:51 PM, Rasmus Villemoes wrote:
>> > I'm also a little confused; I don't see what printk has to do
We save a little .text and get rid of the sizeof(...) style
inconsistency.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/net/ethernet/cavium/liquidio/lio_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cavium/li
The double memset is a little ugly; using kzalloc avoids it altogether.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/net/ethernet/marvell/mv643xx_eth.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mv643xx_et
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 <li...@rasmusvillemoes.dk>
---
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..060dd3
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 <li...@rasmusvillemoes.dk>
---
I cranked $context_lines to 11 to make the kcallocs visible.
drivers/net/ethernet/q
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 <li...@rasmusvillemoes.dk>
---
drivers/acpi/scan.c | 4 ++--
1 file chan
This is preparation for using kstrdup_const to initialize that member.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/acpi/scan.c| 4 ++--
drivers/pnp/pnpacpi/core.c | 4 ++--
include/acpi/acpi_bus.h| 2 +-
3 files changed, 5 insertions(+), 5 del
ing struct acpi_hardware_id::id.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
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..48f
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 <li...@ra
On Mon, Sep 14 2015, Andrew Morton <a...@linux-foundation.org> wrote:
> On Wed, 9 Sep 2015 23:45:52 +0200 Rasmus Villemoes
> <li...@rasmusvillemoes.dk> wrote:
>
> Do we have other callsites whcih can benefit from switching to
> kvasprintf_const()? The [1/2] chang
On Mon, Sep 14 2015, Vitaly Kuznetsov wrote:
> +static __init void test_string_get_size_one(u64 size, u64 blk_size,
> + const enum string_size_units units,
> + const char *exp_result)
> +{
> +
On Wed, Sep 16 2015, Maurizio Lombardi wrote:
> Hi,
>
> I tried to fix the "*pb[l]" format issue while taking care of the problems
> discussed in this thread:
>
> https://lkml.org/lkml/2015/9/9/153
>
> I would like to know whether this approach is more acceptable to you:
>
>
On Tue, Sep 15 2015, Andy Shevchenko wrote:
> On Tue, 2015-09-15 at 15:55 +0200, Vitaly Kuznetsov wrote:
>> +static __init void test_string_get_size_one(u64 size, u64 blk_size,
>> +const enum
>> string_size_units units,
On Fri, Sep 11 2015, Viresh Kumar wrote:
> Long back 'bool' type used to be a typecast to 'int', but that changed
> in v2.6.19. And that is a typecast to _Bool now, which (mostly) takes
> just a byte. Anyway, the bool type in kernel is used to store true/false
> or 1/0
sert outside
function context?]
Only compile-tested.
From: Rasmus Villemoes <li...@rasmusvillemoes.dk>
Date: Wed, 16 Sep 2015 22:06:14 +0200
Subject: [RFC] lib/vsprintf.c: expand field_width to 24 bits
Maurizio Lombardi reported a problem with the %pb extension: It
doesn't work for suffic
On Fri, Sep 11 2015, Johannes Berg wrote:
> On Fri, 2015-09-11 at 13:10 +0200, Peter Zijlstra wrote:
>>
>> struct static_key_false array[n] = { STATIC_KEY_FALSE_INIT, };
>>
>> or something like that.
>
> Yeah, ok, this would be sufficient for me - no need to mix
On Tue, Sep 29 2015, Kees Cook wrote:
>> +static void __init
>> +test_string(void)
>> +{
>> + test("", "%s%.0s", "", "123");
>> + test("ABCD|abc|123", "%s|%.3s|%.*s", "ABCD", "abcdef", 3, "123456");
>> + test("1 | 2|3 | 4|5 ",
On Mon, Sep 28 2015, Andy Shevchenko wrote:
>> /*
>> - * Since %n poses a greater security risk than
>> utility, treat
>> - * it as an invalid format specifier. Warn about its
>> use so
>> - * that new
an int), but 440fd5283a87 ("drm/mm: Support 4 GiB and
larger ranges") strongly suggests that's not the case.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
By printing the newline character to entry, we can avoid accounting
for it manually in several places.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/base/regmap/regmap-debugfs.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/driver
Since we know the length of entry and that there's room enough in the
output buffer, using memcpy instead of snprintf is simpler and
cheaper.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/base/regmap/regmap-debugfs.c | 3 +--
1 file changed, 1 insertion(+), 2 del
arrays in sync.
$ scripts/bloat-o-meter /tmp/vmlinux vmlinux
add/remove: 2/1 grow/shrink: 1/0 up/down: 7073/-11312 (-4239)
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/scsi/constants.c | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
Calling strlen() no less than three times on entry is silly. Since
we're formatting into a buffer with plenty of room, there's no chance
of truncation, so snprintf() has actually returned the value we want,
meaning we don't even have to call strlen once.
Signed-off-by: Rasmus Villemoes <
On Tue, Sep 29 2015, Mark Brown <broo...@kernel.org> wrote:
> On Tue, Sep 29, 2015 at 12:29:01AM +0200, Rasmus Villemoes wrote:
>> snprintf cannot return a negative value (unless map->dev->driver->name
>> happens to be over 2G long). So remove the bogus check
m in the first place?
Just so we could have this interesting little chat. I don't think it was
intentional, but don't worry, they're gone.
>> > > +MODULE_AUTHOR("Rasmus Villemoes <li...@rasmusvillemoes.dk>");
>> > > +MODULE_LICENSE("GPL");
>>
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 64b50409fa07..38d910
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/gpu/drm/omapdrm/tcm-sita.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/tcm-sita.c
b/drivers/gpu/drm/omapdrm/tcm-sita.c
index efb609510540..6df1f2a1bc52
On Wed, Sep 09 2015, Rasmus Villemoes <li...@rasmusvillemoes.dk> wrote:
ping
> The kernel now has kstrdup_const/kfree_const for reusing .rodata
> (typically string literals) when possible; there's no reason to
> duplicate that logic in the tracing system. Moreover, as the
When there is only a single pid namespace, pid_nr_ns and pid_vnr
perform the same task as pid_nr, so we can save a little .text by
making them simple inlines.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
include/linux/pid.h | 11 +++
kernel/pid.c| 2 ++
2
This saves a little .text and is consistent with similar allocations
in the rest of the file.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/block/nvme-scsi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/nvme-scsi.c b/drivers
CH] drm/vmwgfx: check kmalloc return value
srf->sizes has been allocated and checked a few lines above; fix up
the copy-pasto so that we check srf->offsets.
Reported-by: kbuild test robot <l...@intel.com>
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/
On Wed, Sep 09 2015, Rasmus Villemoes <li...@rasmusvillemoes.dk> wrote:
ping
> To cover the common case of sorting an array of pointers, Daniel
> Wagner recently modified the library sort() to use a specific swap
> function for size==8, in addition to the size==4 case which was
&g
When there's only one global pid_namespace (init_pid_ns), the kref
field is unused (since both get_pid_ns and put_pid_ns are
no-ops). While we only save a few bytes by removing it, it could also
help catch users manipulating ->kref directly.
Signed-off-by: Rasmus Villemoes
A few suggestions for reducing the footprint of pid namespaces when
CONFIG_PID_NS=n. The savings are admittedly not huge:
$ scripts/bloat-o-meter /tmp/vmlinux.master vmlinux
add/remove: 0/7 grow/shrink: 30/25 up/down: 368/-1032 (-664)
Rasmus Villemoes (4):
pid_namespace: remove ->le
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/gpu/vga/vgaarb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index a0b433456107..3166e4bc4eb6 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/d
pid_namespace.c.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
kernel/pid.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/pid.c b/kernel/pid.c
index d422ddae0484..c9b595517c4f 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -358,12 +358,14 @@ out_free:
ensure that everyone outside kernel/pid_namespace.c
use the new accessors pid_ns_{parent,level}.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
include/linux/pid_namespace.h | 18 ++
kernel/acct.c | 4 ++--
kernel/pid.c
On Tue, Sep 29 2015, Kees Cook <keesc...@chromium.org> wrote:
> On Tue, Sep 29, 2015 at 12:10 AM, Rasmus Villemoes
> <li...@rasmusvillemoes.dk> wrote:
>
>> I guess I could, but do we really want to intentionally trigger
>> WARN_ON_ONCEs? Say some distro chooses to
On Tue, Sep 29 2015, Mark Brown <broo...@kernel.org> wrote:
> On Tue, Sep 29, 2015 at 12:29:02AM +0200, Rasmus Villemoes wrote:
>
> This patch is an example of why SubmittingPatches recommends splitting
> things up into one change per patch, it would be much easier to
On Wed, Sep 30 2015, ebied...@xmission.com (Eric W. Biederman) wrote:
> Rasmus Villemoes <li...@rasmusvillemoes.dk> writes:
>
>> A few suggestions for reducing the footprint of pid namespaces when
>> CONFIG_PID_NS=n. The savings are admittedly not huge:
>>
&
On Wed, Sep 30 2015, Mark Brown <broo...@kernel.org> wrote:
> On Wed, Sep 30, 2015 at 09:27:38AM +0200, Rasmus Villemoes wrote:
>
>> I agree, but only on the word 'great'. There is value in removing such
>> bogosities (or rather, their presence provides negative valu
Both sides of the assignment are const char*, so this cast is
unnecessary and confusing.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
kernel/params.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/params.c b/kernel/params.c
index b6554a
This saves a little .text and removes the sizeof(...) style
inconsistency. Use sizeof(*state) in accordance with CodingStyle.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/media/dvb-frontends/drxd_hard.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff
This saves a little .text and avoids the sizeof(...) style
inconsistency.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/scsi/fnic/fnic_fcs.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic
The macros KELVIN_TO_CELSIUS and CELSIUS_TO_KELVIN actually convert
between deciKelvins and Celsius, so rename them to reflect that. While
at it, use a statement expression in DECI_KELVIN_TO_CELSIUS to prevent
expanding the argument multiple times and get rid of a few casts.
Signed-off-by: Rasmus
136 160 +24
additional 113122824 -8488
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/scsi/constants.c | 25 +
drivers/scsi/sense_codes.h | 2 --
2 files changed, 21 insertions(+), 6 deletions
with a little overlap. Maybe arches
which do not allow unaligned stores gain even more.
I don't know if gcc can actually make use of alignments greater than 8
for anything, so one could probably drop the __assume_xyz_alignment
macros and just use __assume_aligned(8).
Signed-off-by: Rasmus Villemoes <
gcc 4.9 added the function attribute assume_aligned, indicating to the
caller that the returned pointer may be assumed to have a certain
minimal alignment. This is useful if, for example, the return value is
passed to memset(). Add a shorthand macro for that.
Signed-off-by: Rasmus Villemoes <
%n is no longer just ignored; it results in early return from
vsnprintf. Also add a request to add test cases for future %p
extensions.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
applies on top of
lib-documentation-synchronize-%p-formatting-documentation.patch and
it
1192106, but that is a false
positive: Coverity is not aware that mask != 0 implies that
find_last_bit will not return BITS_PER_LONG.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
kernel/time/timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kerne
struct
fadump_crash_info_header
As preparation for eliminating the indirect access to the various
global cpu_xyz_bits bitmaps via the pointer variables cpu_xyz_mask,
rename the cpu_online_mask of struct fadump_crash_info_header to
simply online_mask, to allow cpu_online_mask to become a macro.
Signed-off-
On Sun, Sep 27 2015, Rusty Russell wrote:
> But to be clear, it has outlived its usefulness, but it was not useless.
>
> In particular, there used to be a debug config where 'struct cpumask'
> wasn't defined, so we could catch people declaring 'struct cpumask' on
> the
On Thu, Sep 24 2015, Andi Kleen wrote:
>
> v2: Fix name of pool 0. Fix race with interrupts. Make
> iteration loops slightly more efficient. Add ifdefs to avoid
> any extra code on non-NUMA. Delay other pool use to when
> the original pool initialized and initialize the
On Tue, Sep 29 2015, Stephen Smalley <s...@tycho.nsa.gov> wrote:
> On 09/25/2015 06:34 PM, Rasmus Villemoes wrote:
>> sprintf returns the number of characters printed (excluding '\0'), so
>> we can use that and avoid duplicating the length computation.
>>
>> Si
snprintf cannot return a negative value (unless map->dev->driver->name
happens to be over 2G long). So remove the bogus check.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/base/regmap/regmap-debugfs.c | 4
1 file changed, 4 deletions(-)
diff --git
snprintf is silly,
when we know the length. Use memcpy instead.
* Making the newline part of entry, we can avoid having to account for
it separately in multiple places.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/base/regmap/regmap-debugfs.c | 19 +---
://lkml.org/lkml/2015/9/16/769
Rasmus Villemoes (4):
lib/vsprintf.c: handle invalid format specifiers more robustly
lib/vsprintf.c: also improve sanity check in bstr_printf()
lib/vsprintf.c: Remove SPECIAL handling in pointer()
test_printf: test printf family at runtime
lib/Kconfig.debug | 3
structions.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
v2: reword slightly, refer to POSIX/C99.
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 03fa10b4be96..98b0d7be3fb7 100644
--- a/lib/vspr
intention all along.
This is also the made-up value passed by sprintf and vsprintf.
I should have seen this copy-pasted instance back then, but let's just
do it now.
Acked-by: Kees Cook <keesc...@chromium.org>
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
v2: add
/arguments. If the offending specifier is in a printk() call we
unfortunately only get a "BUG: recent printk recursion!", but at least
direct users of the sprintf family will be caught.
Reviewed-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>
Acked-by: Kees Cook <keesc...@chromi
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
v2: fix some cosmetic issues, avoid annoying gcc warning for empty
format string, return success if and only if all tests passed, add
reviewed-by.
lib/Kconfig.debug | 3 +
lib/Makefile | 1 +
lib/test_pr
On Mon, Sep 28 2015, Andy Shevchenko <andriy.shevche...@linux.intel.com> wrote:
> On Fri, 2015-09-25 at 19:41 +0200, Rasmus Villemoes wrote:
>> This adds a simple module for testing the kernel's printf
>> facilities. Previously, some %p extensions have caused a wrong re
On Wed, Sep 09 2015, Joe Perches <j...@perches.com> 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
>>
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
(but non-const) array.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
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..ae97d7
let sort() pick an
appropriate and fast swap callback.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
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 b0623a
;
: c3 retq
: 0f 1f 00nopl (%rax)
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
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 <li...@rasmusvillemoes.dk>
---
lib/dynamic_debug.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
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 <li...@rasmusvillemoes.dk>
---
drivers/base/power/wakeup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff
nstead use kstrdup_const directly (which
would also require one to change all corresponding kfree calls to
kfree_const).
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
include/linux/kernel.h | 2 ++
lib/kasprintf.c| 16
2 files changed, 18 insertions(+)
diff
MALLOC_SHIFT_LOW==5. Whether these numbers are sufficient to
justify the ugliness I'll leave to others to decide.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
lib/kobject.c | 30 ++
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git
This is a purely mechanical move of the list of additional sense codes
to a separate file, in preparation for reducing the impact of choosing
CONFIG_SCSI_CONSTANTS=y by about 8k..
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/scsi/constants.c
/shrink: 1/1 up/down: 24/-8488 (-8464)
function old new delta
scsi_extd_sense_format 136 160 +24
additional 113122824 -8488
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes
).
Tested with a trivial module calling scsi_extd_sense_format with a few
random known codes and comparing the result to the expected value.
Rasmus Villemoes (2):
scsi: move Additional Sense Codes to separate file
scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k
drivers/scsi/constants
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
On Wed, Sep 23 2015, Andi Kleen wrote:
> @@ -467,7 +478,7 @@ static struct entropy_store blocking_pool = {
>
> static struct entropy_store nonblocking_pool = {
> .poolinfo = _table[1],
> - .name = "nonblocking",
> + .name = "nonblocking 0",
> .pull =
On Mon, Sep 21 2015, Andy Shevchenko wrote:
> On Mon, 2015-09-21 at 11:13 +0200, Martin Kletzander wrote:
>
>> Move all pointer-formatting documentation to one place instead of
>> keeping it in three places with different level of completeness.
I've had a
/arguments. If the offending specifier is in a printk() call we
unfortunately only get a "BUG: recent printk recursion!", but at least
direct users of the sprintf family will be caught.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
lib/vsprintf.c | 31 +
intention all along.
This is also the made-up value passed by sprintf and vsprintf.
I should have seen this copy-pasted instance back then, but let's just
do it now.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertio
://lkml.org/lkml/2015/9/16/769
Rasmus Villemoes (4):
lib/vsprintf.c: handle invalid format specifiers more robustly
lib/vsprintf.c: also improve sanity check in bstr_printf()
lib/vsprintf.c: Remove SPECIAL handling in pointer()
test_printf: test printf family at runtime
lib/Kconfig.debug | 3
always 2*sizeof(void*), we can
simplify the prologue of pointer() and save a few instructions.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 03fa10
conventional
table-driven approach.
For now, this is mostly a skeleton; contributions are very
welcome. Some tests are/will be slightly annoying to write, since the
expected output depends on stuff like CONFIG_*, sizeof(long), runtime
values etc.
Signed-off-by: Rasmus Villemoes <
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.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
include/linux/cpumask
indirection through the cpu_xyz_mask variables.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
kernel/cpu.c | 44 ++--
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 82cf9dff4295..fea4a3
-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
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/cpu.c
@@ -200,7
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.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes
, bloat-o-meter says we save ~3000 bytes.
Rasmus Villemoes (5):
kernel/cpu.c: change type of cpu_possible_bits and friends
kernel/cpu.c: export __cpu_*_mask
drivers/base/cpu.c: use __cpu_*_mask directly
kernel/cpu.c: eliminate cpu_*_mask
kernel/cpu.c: make set_cpu_* static inlines
drivers
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.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
include/linux/cpumask.
This is much simpler.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
security/selinux/ss/services.c | 8 +---
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 994c824a34c6..aa2bdcb20848
601 - 700 of 3339 matches
Mail list logo