lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNtUpMe41HEztHLw@smile.fi.intel.com>
Date:   Tue, 15 Aug 2023 13:34:12 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Kent Gibson <warthog618@...il.com>, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH] gpio: sim: replace memmove() + strstrip() with
 skip_spaces() + strim()

On Sat, Aug 12, 2023 at 08:57:48PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> 
> Turns out we can avoid the memmove() by using skip_spaces() and strim().
> We did that in gpio-consumer, let's do it in gpio-sim.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

...

> +	strim(trimmed);
>  
> -	return dup;
> +	return trimmed;

Can be also

	return strim(trimmed);

If it's only about \n replacement, then

	return strreplace(trimmed, '\n', '\0');

would work and in the next release be changed to kstrdup_and_replace().

>  }

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ