lkml.org 
[lkml]   [2006]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH/RFC] s390: Hypervisor File System
From
Date
On Mon, 2006-04-24 at 19:17 +0200, Michael Holzheu wrote:
> What about something like that:
>
> /**
> * strrtrim - Remove trailing characters specified in @reject
> * @s: The string to be searched
> * @reject: The string of letters to avoid
> */
> static inline void strrtrim(char *s, const char *reject)

Better to make it out-of-line to save kernel text.

> {
> char *p;
> const char *r;
>
> for (p = s + strlen(s) - 1; s <= p; p--) {
> for (r = reject; (*r != '\0') && (*p != *r); r++)
> /* nothing */;
> if (*r == '\0')
> break;
> }
> *(p + 1) = '\0';
> }
>
> Regards
> Michael
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-25 08:29    [W:0.057 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site