[v2,0/3] lib/string_helpers et al.: Change return value of strreplace()

Message ID 20230323123704.37983-1-andriy.shevchenko@linux.intel.com
Headers
Series lib/string_helpers et al.: Change return value of strreplace() |

Message

Andy Shevchenko March 23, 2023, 12:37 p.m. UTC
  It's more convenient to have strreplace() to return the pointer to
 the string itself. This will help users to make their code better.

The patch 1 kills the only user of the returned value of strreplace(),
Patch 2 converts the return value of strreplace(). And patch 3 shows
how it may be useful. That said, the series can be routed via fs tree,
with or without the last patch.

In v2:
- removed not anymore used variable (LKP)
- added tag (Jan)
- fixed wording (Kees)
- actually return the pointer to the string itself

Andy Shevchenko (3):
  jbd2: Avoid printing outside the boundary of the buffer
  lib/string_helpers: Change returned value of the strreplace()
  kobject: Use return value of strreplace()

 fs/jbd2/journal.c      |  6 ++----
 include/linux/string.h |  2 +-
 lib/kobject.c          |  3 +--
 lib/string_helpers.c   | 12 ++++++++----
 4 files changed, 12 insertions(+), 11 deletions(-)
  

Comments

Andy Shevchenko April 5, 2023, 1:34 p.m. UTC | #1
On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote:
> It's more convenient to have strreplace() to return the pointer to
>  the string itself. This will help users to make their code better.
> 
> The patch 1 kills the only user of the returned value of strreplace(),
> Patch 2 converts the return value of strreplace(). And patch 3 shows
> how it may be useful. That said, the series can be routed via fs tree,
> with or without the last patch.

Since there are no comments, who can apply this (patches 1 and 2)?
Greg, are you fine with the kobject change?

> In v2:
> - removed not anymore used variable (LKP)
> - added tag (Jan)
> - fixed wording (Kees)
> - actually return the pointer to the string itself
> 
> Andy Shevchenko (3):
>   jbd2: Avoid printing outside the boundary of the buffer
>   lib/string_helpers: Change returned value of the strreplace()
>   kobject: Use return value of strreplace()
> 
>  fs/jbd2/journal.c      |  6 ++----
>  include/linux/string.h |  2 +-
>  lib/kobject.c          |  3 +--
>  lib/string_helpers.c   | 12 ++++++++----
>  4 files changed, 12 insertions(+), 11 deletions(-)
  
Greg KH April 5, 2023, 2:24 p.m. UTC | #2
On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote:
> On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote:
> > It's more convenient to have strreplace() to return the pointer to
> >  the string itself. This will help users to make their code better.
> > 
> > The patch 1 kills the only user of the returned value of strreplace(),
> > Patch 2 converts the return value of strreplace(). And patch 3 shows
> > how it may be useful. That said, the series can be routed via fs tree,
> > with or without the last patch.
> 
> Since there are no comments, who can apply this (patches 1 and 2)?
> Greg, are you fine with the kobject change?

Sure, want me to take them all through my driver-core tree?

thanks,

greg k-h
  
Andy Shevchenko April 5, 2023, 2:38 p.m. UTC | #3
On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote:
> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote:
> > > It's more convenient to have strreplace() to return the pointer to
> > >  the string itself. This will help users to make their code better.
> > > 
> > > The patch 1 kills the only user of the returned value of strreplace(),
> > > Patch 2 converts the return value of strreplace(). And patch 3 shows
> > > how it may be useful. That said, the series can be routed via fs tree,
> > > with or without the last patch.
> > 
> > Since there are no comments, who can apply this (patches 1 and 2)?
> > Greg, are you fine with the kobject change?
> 
> Sure, want me to take them all through my driver-core tree?

Fine by me! Dunno about others. Kees?
  
Kees Cook April 6, 2023, 2:58 a.m. UTC | #4
On April 5, 2023 7:38:40 AM PDT, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote:
>> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote:
>> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote:
>> > > It's more convenient to have strreplace() to return the pointer to
>> > >  the string itself. This will help users to make their code better.
>> > > 
>> > > The patch 1 kills the only user of the returned value of strreplace(),
>> > > Patch 2 converts the return value of strreplace(). And patch 3 shows
>> > > how it may be useful. That said, the series can be routed via fs tree,
>> > > with or without the last patch.
>> > 
>> > Since there are no comments, who can apply this (patches 1 and 2)?
>> > Greg, are you fine with the kobject change?
>> 
>> Sure, want me to take them all through my driver-core tree?
>
>Fine by me! Dunno about others. Kees?

Yeah, that's cool by me. :)
  
Andy Shevchenko June 5, 2023, 2:04 p.m. UTC | #5
On Wed, Apr 05, 2023 at 07:58:40PM -0700, Kees Cook wrote:
> On April 5, 2023 7:38:40 AM PDT, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> >On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote:
> >> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote:
> >> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote:
> >> > > It's more convenient to have strreplace() to return the pointer to
> >> > >  the string itself. This will help users to make their code better.
> >> > > 
> >> > > The patch 1 kills the only user of the returned value of strreplace(),
> >> > > Patch 2 converts the return value of strreplace(). And patch 3 shows
> >> > > how it may be useful. That said, the series can be routed via fs tree,
> >> > > with or without the last patch.
> >> > 
> >> > Since there are no comments, who can apply this (patches 1 and 2)?
> >> > Greg, are you fine with the kobject change?
> >> 
> >> Sure, want me to take them all through my driver-core tree?
> >
> >Fine by me! Dunno about others. Kees?
> 
> Yeah, that's cool by me. :)

Greg, does this slip through the cracks?
  
Greg KH June 5, 2023, 4:57 p.m. UTC | #6
On Mon, Jun 05, 2023 at 05:04:43PM +0300, Andy Shevchenko wrote:
> On Wed, Apr 05, 2023 at 07:58:40PM -0700, Kees Cook wrote:
> > On April 5, 2023 7:38:40 AM PDT, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > >On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote:
> > >> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote:
> > >> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote:
> > >> > > It's more convenient to have strreplace() to return the pointer to
> > >> > >  the string itself. This will help users to make their code better.
> > >> > > 
> > >> > > The patch 1 kills the only user of the returned value of strreplace(),
> > >> > > Patch 2 converts the return value of strreplace(). And patch 3 shows
> > >> > > how it may be useful. That said, the series can be routed via fs tree,
> > >> > > with or without the last patch.
> > >> > 
> > >> > Since there are no comments, who can apply this (patches 1 and 2)?
> > >> > Greg, are you fine with the kobject change?
> > >> 
> > >> Sure, want me to take them all through my driver-core tree?
> > >
> > >Fine by me! Dunno about others. Kees?
> > 
> > Yeah, that's cool by me. :)
> 
> Greg, does this slip through the cracks?

It did.  Can someone resend this?

thanks,

greg k-h
  
Andy Shevchenko June 5, 2023, 5:06 p.m. UTC | #7
On Mon, Jun 05, 2023 at 06:57:48PM +0200, Greg Kroah-Hartman wrote:
> On Mon, Jun 05, 2023 at 05:04:43PM +0300, Andy Shevchenko wrote:
> > On Wed, Apr 05, 2023 at 07:58:40PM -0700, Kees Cook wrote:
> > > On April 5, 2023 7:38:40 AM PDT, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > > >On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote:
> > > >> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote:
> > > >> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote:
> > > >> > > It's more convenient to have strreplace() to return the pointer to
> > > >> > >  the string itself. This will help users to make their code better.
> > > >> > > 
> > > >> > > The patch 1 kills the only user of the returned value of strreplace(),
> > > >> > > Patch 2 converts the return value of strreplace(). And patch 3 shows
> > > >> > > how it may be useful. That said, the series can be routed via fs tree,
> > > >> > > with or without the last patch.
> > > >> > 
> > > >> > Since there are no comments, who can apply this (patches 1 and 2)?
> > > >> > Greg, are you fine with the kobject change?
> > > >> 
> > > >> Sure, want me to take them all through my driver-core tree?
> > > >
> > > >Fine by me! Dunno about others. Kees?
> > > 
> > > Yeah, that's cool by me. :)
> > 
> > Greg, does this slip through the cracks?
> 
> It did.  Can someone resend this?

Done as v3.
20230605170553.7835-1-andriy.shevchenko@linux.intel.com