Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread Andrew Morton
On Mon, 03 Feb 2014 17:28:16 -0800 Sebastian Capella 
 wrote:

> Quoting David Rientjes (2014-02-03 17:05:04)
> > The last we heard, I think Sebastian is looking to redo this series and 
> > this patch is no longer needed.  Sebastian?
> Hi David, Alexey,
> 
> I am in the process of reworking the patches.  I'm not sure if Andrew
> was just interested in having the kstrimdup utility function available.
> 
> Isn't it too late to impose userspace trimming of newlines for sysfs?
> It seems already fairly common and expected for the kernel to eat the
> trailing whitespace, or at least ignore it.  If we change this won't we
> be breaking userspace / tools / instructions / etc?
> 

We have quite a lot of codesites which open-code the newline trimming. 
Providing a library function to do this will result in goodness.

That being said, I don't plan to merge kstrimdup() until it has some users.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread David Rientjes
On Mon, 3 Feb 2014, Sebastian Capella wrote:

> I am in the process of reworking the patches.  I'm not sure if Andrew
> was just interested in having the kstrimdup utility function available.
> 

I think the point Alexey is making is that whitespace is already stripped 
by the shell unless quoted; it seemed that you may have had a usecase 
where the string to be written would not be stripped by the shell for 
whatever reason and there was no convenient way to do it specifically for 
the file you were modifying?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread Sebastian Capella
Quoting David Rientjes (2014-02-03 17:05:04)
> The last we heard, I think Sebastian is looking to redo this series and 
> this patch is no longer needed.  Sebastian?
Hi David, Alexey,

I am in the process of reworking the patches.  I'm not sure if Andrew
was just interested in having the kstrimdup utility function available.

Isn't it too late to impose userspace trimming of newlines for sysfs?
It seems already fairly common and expected for the kernel to eat the
trailing whitespace, or at least ignore it.  If we change this won't we
be breaking userspace / tools / instructions / etc?

I'll try to post the new patches soon.

Thanks,

Sebastian

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


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread David Rientjes
On Mon, 3 Feb 2014, Alexey Dobriyan wrote:

> > kstrimdup() creates a whitespace-trimmed duplicate of the passed in
> > null-terminated string.  This is useful for strings coming from sysfs that
> > often include trailing whitespace due to user input.
> 
> I think kernel should be strict in what it accepts, otherwise
> case-insensivity and
> what not will be added some day.
> 
> Shell will trim whitespace for you.
> 

The last we heard, I think Sebastian is looking to redo this series and 
this patch is no longer needed.  Sebastian?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread Alexey Dobriyan
On Sat, Feb 1, 2014 at 12:45 AM,   wrote:
> kstrimdup() creates a whitespace-trimmed duplicate of the passed in
> null-terminated string.  This is useful for strings coming from sysfs that
> often include trailing whitespace due to user input.

I think kernel should be strict in what it accepts, otherwise
case-insensivity and
what not will be added some day.

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


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread Alexey Dobriyan
On Sat, Feb 1, 2014 at 12:45 AM,  a...@linux-foundation.org wrote:
 kstrimdup() creates a whitespace-trimmed duplicate of the passed in
 null-terminated string.  This is useful for strings coming from sysfs that
 often include trailing whitespace due to user input.

I think kernel should be strict in what it accepts, otherwise
case-insensivity and
what not will be added some day.

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


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread David Rientjes
On Mon, 3 Feb 2014, Alexey Dobriyan wrote:

  kstrimdup() creates a whitespace-trimmed duplicate of the passed in
  null-terminated string.  This is useful for strings coming from sysfs that
  often include trailing whitespace due to user input.
 
 I think kernel should be strict in what it accepts, otherwise
 case-insensivity and
 what not will be added some day.
 
 Shell will trim whitespace for you.
 

The last we heard, I think Sebastian is looking to redo this series and 
this patch is no longer needed.  Sebastian?
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread Sebastian Capella
Quoting David Rientjes (2014-02-03 17:05:04)
 The last we heard, I think Sebastian is looking to redo this series and 
 this patch is no longer needed.  Sebastian?
Hi David, Alexey,

I am in the process of reworking the patches.  I'm not sure if Andrew
was just interested in having the kstrimdup utility function available.

Isn't it too late to impose userspace trimming of newlines for sysfs?
It seems already fairly common and expected for the kernel to eat the
trailing whitespace, or at least ignore it.  If we change this won't we
be breaking userspace / tools / instructions / etc?

I'll try to post the new patches soon.

Thanks,

Sebastian

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


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread David Rientjes
On Mon, 3 Feb 2014, Sebastian Capella wrote:

 I am in the process of reworking the patches.  I'm not sure if Andrew
 was just interested in having the kstrimdup utility function available.
 

I think the point Alexey is making is that whitespace is already stripped 
by the shell unless quoted; it seemed that you may have had a usecase 
where the string to be written would not be stripped by the shell for 
whatever reason and there was no convenient way to do it specifically for 
the file you were modifying?
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: + mm-utilc-add-kstrimdup.patch added to -mm tree

2014-02-03 Thread Andrew Morton
On Mon, 03 Feb 2014 17:28:16 -0800 Sebastian Capella 
sebastian.cape...@linaro.org wrote:

 Quoting David Rientjes (2014-02-03 17:05:04)
  The last we heard, I think Sebastian is looking to redo this series and 
  this patch is no longer needed.  Sebastian?
 Hi David, Alexey,
 
 I am in the process of reworking the patches.  I'm not sure if Andrew
 was just interested in having the kstrimdup utility function available.
 
 Isn't it too late to impose userspace trimming of newlines for sysfs?
 It seems already fairly common and expected for the kernel to eat the
 trailing whitespace, or at least ignore it.  If we change this won't we
 be breaking userspace / tools / instructions / etc?
 

We have quite a lot of codesites which open-code the newline trimming. 
Providing a library function to do this will result in goodness.

That being said, I don't plan to merge kstrimdup() until it has some users.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/