Re: [PATCH 1/6] Coccinelle: Semantic patch for replacing puts with putc

2014-09-12 Thread SF Markus Elfring
> Using seq_puts to write a one-character string is suboptimal, > since puts has to call strlen(). Are there any more functions which work with such strings in a similar way? Would it make sense to look also at other function names? Regards, Markus -- To unsubscribe from this list: send the line

[PATCH 1/6] Coccinelle: Semantic patch for replacing puts with putc

2014-09-12 Thread Rasmus Villemoes
Using seq_puts to write a one-character string is suboptimal, since puts has to call strlen(). Replace those instances with putc. This also tends to give a tiny code size reduction at the call site. seq_put[sc] return -1 on error, 0 on success. trace_seq_put[sc] return how much was written, which

[PATCH 1/6] Coccinelle: Semantic patch for replacing puts with putc

2014-09-12 Thread Rasmus Villemoes
Using seq_puts to write a one-character string is suboptimal, since puts has to call strlen(). Replace those instances with putc. This also tends to give a tiny code size reduction at the call site. seq_put[sc] return -1 on error, 0 on success. trace_seq_put[sc] return how much was written, which

Re: [PATCH 1/6] Coccinelle: Semantic patch for replacing puts with putc

2014-09-12 Thread SF Markus Elfring
Using seq_puts to write a one-character string is suboptimal, since puts has to call strlen(). Are there any more functions which work with such strings in a similar way? Would it make sense to look also at other function names? Regards, Markus -- To unsubscribe from this list: send the line