On 2018-04-18 23:21, Linus Torvalds wrote:
> On Wed, Apr 18, 2018 at 1:12 AM, Martin Wilck wrote:
>>
>> No, it doesn't (gcc 7.3.0). -> https://paste.opensuse.org/27471594
>> It doesn't even warn on an expression like this:
>>
>> #define SIZE (1<<10)
>> static int
This saves a little .text and gets rid of the unmotivated line break and
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/scs
From: Rasmus Villemoes <rasmus.villem...@prevas.dk>
iscsi_parse_pr_out_transport_id launders the const away via a call to
strstr(), and then modifies the buffer (writing a nul byte) through
the return value. It's cleaner to be honest and simply declare the
parameter as "char*", fi
it
alone for now.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/scsi/hpsa.c | 40 +---
1 file changed, 13 insertions(+), 27 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index a1d6ab76a514..d74268ffb71e
On Tue, Jul 05 2016, Markus Mayer wrote:
> Add a collection of generic functions to convert strings to lowercase
> or uppercase.
>
> Changing the case of a string (with or without copying it first) seems
> to be a recurring requirement in the kernel that is currently being
>
On Fri, Jul 01 2016, Markus Mayer wrote:
> Add a function called strtolower() to convert strings to lower case
> in-place, overwriting the original string.
>
> This seems to be a recurring requirement in the kernel that is
> currently being solved by several duplicated
There's little point in breaking these strings over multiple lines.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
Reviewed-by: Hannes Reinecke <h...@suse.com>
---
drivers/scsi/constants.c | 27 +--
1 file changed, 9 insertions(+), 18 deletions(-)
costs
around 75 KB, but that was a little exaggerated. The actual number was
closer to 44K, and 36K with this patch.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
Reviewed-by: Hannes Reinecke <h...@suse.com>
Tested-by: Douglas Gilbert <dgilb...@interlog.com>
---
dr
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>
Reviewed-by: Hannes Reinecke <h...@suse.com>
36 KB, while it was about 44 KB
before. I took the liberty of including Hannes' Reviewed-by and
Douglas' Tested-by despite that addition.
Rasmus Villemoes (3):
scsi: make some Additional Sense strings more grep'able
scsi: move Additional Sense Codes to separate file
scsi: reduce
On Tue, Nov 24 2015, Rasmus Villemoes <li...@rasmusvillemoes.dk> wrote:
> This reduces the impact of choosing CONFIG_SCSI_CONSTANTS by about 8KB.
>
ping? does anyone feel like picking these up?
Rasmus
--
To unsubscribe from this list: send the line "unsubscribe linux-
ch simpler (and generates smaller code)
to use the %ph extension which was created for such short hexdumps.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/scsi/osd/osd_initiator.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/scsi/osd
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
).
Tested with a trivial module calling scsi_extd_sense_format with a few
random known codes and comparing the result to the expected value.
v2: prepend patch to unsplit a few string literals for greppability,
leave the NULL sentinel in the .c file in 2/3 (it's removed in 3/3
either way).
Rasmus Villemoes (
There's little point in breaking these strings over multiple lines.
Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
drivers/scsi/constants.c | 27 +--
1 file changed, 9 insertions(+), 18 deletions(-)
diff --git a/drivers/scsi/constants.c b/driver
/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
On Wed, Oct 28 2015, Don Brace <brace77...@gmail.com> wrote:
> On 10/27/2015 05:16 PM, Rasmus Villemoes wrote:
>> I'm not familiar with this code, but path_info_show() (added in
>> 8270b86243658 "hpsa: add sysfs entry path_info to show box and
>> bay information&
On Wed, Nov 04 2015, James Bottomley <james.bottom...@hansenpartnership.com>
wrote:
> On Wed, 2015-11-04 at 00:26 +0100, Rasmus Villemoes wrote:
>> On Tue, Nov 03 2015, James Bottomley <james.bottom...@hansenpartnership.com>
>> wrote:
>> >> Please s
inputs correctly, including zero for block size.
>
> Reported-by: Vitaly Kuznetsov <vkuzn...@redhat.com>
> Cc: sta...@vger.kernel.org# delay backport by two months for testing
> Fixes: b9f28d863594c429e1df35a0474d2663ca28b307
> Signed-off-by: James Bottomley <jbottom...@odin
On Tue, Nov 03 2015, James Bottomley <james.bottom...@hansenpartnership.com>
wrote:
> On Tue, 2015-11-03 at 23:13 +0100, Rasmus Villemoes wrote:
>> On Tue, Nov 03 2015, James Bottomley <james.bottom...@hansenpartnership.com>
>> wrote:
>>
>> >
at least PAGE_SIZE. s[c]nprintf doesn't care where
it is writing to, so this doesn't make the spin lock hold time any
longer. Using scnprintf ensures that output_len always represents the
number of bytes actually written to the buffer, so we'll report the
proper amount to the upper layer.
Signed-off-by: Ra
On Tue, Oct 06 2015, Rasmus Villemoes <li...@rasmusvillemoes.dk> wrote:
> On Mon, Oct 05 2015, Bart Van Assche <bart.vanass...@sandisk.com> wrote:
>
>> On 10/05/15 02:26, Rasmus Villemoes wrote:
>>> - {0x041A, "Logical unit not ready, start sto
On Mon, Oct 05 2015, Bart Van Assche <bart.vanass...@sandisk.com> wrote:
> On 10/05/15 02:26, Rasmus Villemoes wrote:
>> -{0x041A, "Logical unit not ready, start stop unit command in "
>> - "progress"},
>> -{0x041B, "Logical uni
On Mon, Oct 05 2015, Bart Van Assche <bart.vanass...@sandisk.com> 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;
>> +unsigne
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
).
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
/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
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
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
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
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(-)
On Mon, Sep 21 2015, Maurizio Lombardi <mlomb...@redhat.com> wrote:
> Hi Rasmus,
>
> On 09/16/2015 10:35 PM, Rasmus Villemoes wrote:
>>
>> I just remembered: I noticed a while ago that the qualifier member is
>> only used inside format_decode (in t
spectacularly.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
b/drivers/scsi/megaraid/megaraid_sas_base.c
index ff283d23788a..e7c6b9c946d6
Mentioning the enclosing function twice doesn't add value.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/3w-.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/3w-.c b/drivers/scsi/3w-.c
index c75f2048319f..67539e73fdad
On Thu, Jan 29 2015, Finn Thain fth...@telegraphics.com.au wrote:
I have one reservation about this patch series.
For example, the changes,
- seq_printf(m, %s, p);
+ seq_puts(m, p);
These calls are not equivalent because the bounds check is not the same.
seq_puts will fail when
On Wed, Dec 03 2014, Rasmus Villemoes li...@rasmusvillemoes.dk wrote:
These patches mostly replace seq_printf with simpler and faster
equivalents, e.g. seq_printf(m, something) = seq_puts(m,
something) and seq_printf(m, \n) = seq_putc(m, '\n). But before
my Coccinelle scripts could
Using seq_putc to print a single character saves at least a strlen()
call and a memory access, and may also give a small .text reduction.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/NCR5380.c | 2 +-
drivers/scsi/advansys.c | 34
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/BusLogic.c | 10 +-
drivers/scsi/NCR5380.c
The macro SPRINTF doesn't save a lot of typing or make the code more
readable, and depending on a specific identifier (m) in the
surrounding scope is generally frowned upon. Nuke it.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/NCR5380.c | 20 ++-
drivers/scsi
Consecutive seq_puts calls with literal strings may be replaced by a
single call, saving a little .text.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/advansys.c | 43 +++
drivers/scsi/atp870u.c | 5 ++---
drivers
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/advansys.c | 155
obfuscating, macros.
The patches don't change the semantics of the code (well, that's the
idea anyway), but should make it slightly smaller and faster.
Rasmus Villemoes (7):
scsi: Remove SPRINTF macro
scsi/g_NCR5380: Remove obfuscating macros
scsi/advansys: Replace seq_printf with seq_puts
scsi
The macro SPRINTF doesn't save a lot of typing or make the code more
readable, and depending on a specific identifier (m) in the
surrounding scope is generally frowned upon. Nuke it.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/NCR5380.c | 42 +++---
drivers
Using seq_putc to print a single character saves at least a strlen()
call and a memory access, and may also give a small .text reduction.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/NCR5380.c | 2 +-
drivers/scsi/advansys.c | 34
Consecutive seq_puts calls with literal strings may be replaced by a
single call, saving a little .text.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/advansys.c | 40 ++--
drivers/scsi/atp870u.c | 5 ++---
drivers/scsi
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/BusLogic.c | 10 +-
drivers/scsi/NCR5380.c
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/aha152x.c | 252
Using seq_printf to print a simple string is a lot more expensive than
it needs to be, since seq_puts exists. Replace seq_printf with
seq_puts when possible.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/advansys.c | 157
The macros PRINTP/ANDP make the code harder to read and depend on a
specific identifier name in the surrounding scope. Nuke them.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/g_NCR5380.c | 66 ++--
1 file changed, 30
@vger.kernel.org
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/ips.c| 2 +-
drivers/scsi/scsi_debug.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 52a216f..e5afc38 100644
--- a/drivers/scsi/ips.c
The four files aha1542.h, aha1740.h, gvp11.h and mvme147.h under
drivers/scsi/ contain two-thirds of an include guard, but do not
#define the macro. Add those #defines. git grep says the macro names
are not defined elsewhere.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
For good
The four files aha1542.h, aha1740.h, gvp11.h and mvme147.h under
drivers/scsi/ contain two-thirds of an include guard, but do not
elsewhere.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/scsi/aha1542.h | 1 +
drivers/scsi/aha1740.h | 1 +
drivers/scsi/gvp11.h | 1
Clearly the file was meant to contain an include guard, but it was
missing the #define part.
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
drivers/target/target_core_ua.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/target/target_core_ua.h b/drivers/target
Rasmus Villemoes li...@rasmusvillemoes.dk writes:
The four files aha1542.h, aha1740.h, gvp11.h and mvme147.h under
drivers/scsi/ contain two-thirds of an include guard, but do not
elsewhere.
Argh, git commit ate a line because it happened to start with #. This
was supposed to be something
Joe Lawrence joe.lawre...@stratus.com writes:
On Tue, 1 Jul 2014, Rasmus Villemoes wrote:
Rounding up to a multiple of 4 should be done using the ALIGN
macro. As a bonus, this also makes the generated code smaller.
In GetIocFacts(), sz is assigned to a few lines below without being
read
55 matches
Mail list logo