search for: kfree_const

Displaying 20 results from an estimated 24 matches for "kfree_const".

2016 Jun 30
6
[PATCH 0/6] lib: string: add function strtolower()
This series introduces a new generic function strtolower(), which converts strings to lowercase in-place, overwriting the original string. This kind of functionality is needed in several places in the kernel. Right now, everybody seems to be implementing their own copy of this function. So, we replace several custom "strtolower" implementations with this new library function. Another
2016 Jul 01
2
[PATCH 1/6] lib: string: add function strtolower()
...ng.h > +++ b/include/linux/string.h > @@ -116,6 +116,7 @@ extern void * memchr(const void *,int,__kernel_size_t); > #endif > void *memchr_inv(const void *s, int c, size_t n); > char *strreplace(char *s, char old, char new); > +char *strtolower(char *s); > > extern void kfree_const(const void *x); > > diff --git a/lib/string.c b/lib/string.c > index ed83562..6e3b560 100644 > --- a/lib/string.c > +++ b/lib/string.c > @@ -952,3 +952,17 @@ char *strreplace(char *s, char old, char new) > return s; > } > EXPORT_SYMBOL(strreplace); > + This need...
2020 Jun 16
0
[PATCH v4 0/3] mm, treewide: Rename kzfree() to kfree_sensitive()
...1364230c296b23e7584d.camel at perches.com/ Are there _any_ fastpath uses of kfree or vfree? Many patches have been posted recently to fix mispairings of specific types of alloc and free functions. To eliminate these mispairings at a runtime cost of four comparisons, should the kfree/vfree/kvfree/kfree_const functions be consolidated into a single kfree? Something like the below: void kfree(const void *addr) { if (is_kernel_rodata((unsigned long)addr)) return; if (is_vmalloc_addr(addr)) _vfree(addr); else _kfree(addr); } #define kvfree kfree #define vfree...
2016 Jul 09
2
[PATCH v3 1/7] lib: string: add functions to case-convert strings
..._t); > #endif > void *memchr_inv(const void *s, int c, size_t n); > char *strreplace(char *s, char old, char new); > +extern void strlcpytoupper(char *dst, const char *src, size_t len); > +extern void strlcpytolower(char *dst, const char *src, size_t len); > > extern void kfree_const(const void *x); > > @@ -169,4 +171,42 @@ static inline const char *kbasename(const char *path) > return tail ? tail + 1 : path; > } > > +/** > + * strcpytoupper - Copy string and convert to uppercase. > + * @dst: The buffer to store the result. > + * @src: The stri...
2020 Jun 11
2
[PATCH v1] virtio-mem: add memory via add_memory_driver_managed()
...O_MEM_MB_STATE_ONLINE_PARTIAL] || - vm->nb_mb_state[VIRTIO_MEM_MB_STATE_ONLINE_MOVABLE]) + vm->nb_mb_state[VIRTIO_MEM_MB_STATE_ONLINE_MOVABLE]) { dev_warn(&vdev->dev, "device still has system memory added\n"); - else + } else { virtio_mem_delete_resource(vm); + kfree_const(vm->resource_name); + } /* remove all tracking data - no locking needed */ vfree(vm->mb_state); -- 2.26.2
2020 Jun 11
2
[PATCH v1] virtio-mem: add memory via add_memory_driver_managed()
...O_MEM_MB_STATE_ONLINE_PARTIAL] || - vm->nb_mb_state[VIRTIO_MEM_MB_STATE_ONLINE_MOVABLE]) + vm->nb_mb_state[VIRTIO_MEM_MB_STATE_ONLINE_MOVABLE]) { dev_warn(&vdev->dev, "device still has system memory added\n"); - else + } else { virtio_mem_delete_resource(vm); + kfree_const(vm->resource_name); + } /* remove all tracking data - no locking needed */ vfree(vm->mb_state); -- 2.26.2
2016 Jun 30
0
[PATCH 1/6] lib: string: add function strtolower()
....aad605e 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -116,6 +116,7 @@ extern void * memchr(const void *,int,__kernel_size_t); #endif void *memchr_inv(const void *s, int c, size_t n); char *strreplace(char *s, char old, char new); +char *strtolower(char *s); extern void kfree_const(const void *x); diff --git a/lib/string.c b/lib/string.c index ed83562..6e3b560 100644 --- a/lib/string.c +++ b/lib/string.c @@ -952,3 +952,17 @@ char *strreplace(char *s, char old, char new) return s; } EXPORT_SYMBOL(strreplace); + +char *strtolower(char *s) +{ + char *p; + + if (unli...
2016 Jul 01
0
[PATCH 1/6] lib: string: add function strtolower()
...nux/string.h >> @@ -116,6 +116,7 @@ extern void * memchr(const void *,int,__kernel_size_t); >> #endif >> void *memchr_inv(const void *s, int c, size_t n); >> char *strreplace(char *s, char old, char new); >> +char *strtolower(char *s); >> >> extern void kfree_const(const void *x); >> >> diff --git a/lib/string.c b/lib/string.c >> index ed83562..6e3b560 100644 >> --- a/lib/string.c >> +++ b/lib/string.c >> @@ -952,3 +952,17 @@ char *strreplace(char *s, char old, char new) >> return s; >> } >> EXPORT...
2016 Jul 01
0
[PATCH 1/6] lib: string: add function strtolower()
...-116,6 +116,7 @@ extern void * memchr(const void *,int,__kernel_size_t); >>> #endif >>> void *memchr_inv(const void *s, int c, size_t n); >>> char *strreplace(char *s, char old, char new); >>> +char *strtolower(char *s); >>> >>> extern void kfree_const(const void *x); >>> >>> diff --git a/lib/string.c b/lib/string.c >>> index ed83562..6e3b560 100644 >>> --- a/lib/string.c >>> +++ b/lib/string.c >>> @@ -952,3 +952,17 @@ char *strreplace(char *s, char old, char new) >>> return s;...
2016 Jul 13
1
[PATCH v3 0/7] lib: string: add functions to case-convert strings
...char new); -extern void strlcpytoupper(char *dst, const char *src, size_t len); -extern void strlcpytolower(char *dst, const char *src, size_t len); +extern int strlcpytoupper(char *dst, const char *src, size_t len); +extern int strlcpytolower(char *dst, const char *src, size_t len); extern void kfree_const(const void *x); @@ -175,38 +175,46 @@ static inline const char *kbasename(const char *path) * strcpytoupper - Copy string and convert to uppercase. * @dst: The buffer to store the result. * @src: The string to convert to uppercase. + * + * Returns the number of characters copied. */ -stat...
2020 Jun 11
0
[PATCH v1] virtio-mem: add memory via add_memory_driver_managed()
...gt; - vm->nb_mb_state[VIRTIO_MEM_MB_STATE_ONLINE_MOVABLE]) > + vm->nb_mb_state[VIRTIO_MEM_MB_STATE_ONLINE_MOVABLE]) { > dev_warn(&vdev->dev, "device still has system memory added\n"); > - else > + } else { > virtio_mem_delete_resource(vm); > + kfree_const(vm->resource_name); > + } > > /* remove all tracking data - no locking needed */ > vfree(vm->mb_state); > -- > 2.26.2
2016 Jul 08
0
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...mchr(const void *,int,__kernel_size_t); #endif void *memchr_inv(const void *s, int c, size_t n); char *strreplace(char *s, char old, char new); +extern void strlcpytoupper(char *dst, const char *src, size_t len); +extern void strlcpytolower(char *dst, const char *src, size_t len); extern void kfree_const(const void *x); @@ -169,4 +171,42 @@ static inline const char *kbasename(const char *path) return tail ? tail + 1 : path; } +/** + * strcpytoupper - Copy string and convert to uppercase. + * @dst: The buffer to store the result. + * @src: The string to convert to uppercase. + */ +static inli...
2016 Jul 01
1
[PATCH 1/6] lib: string: add function strtolower()
...ng.h > +++ b/include/linux/string.h > @@ -116,6 +116,7 @@ extern void * memchr(const void *,int,__kernel_size_t); > #endif > void *memchr_inv(const void *s, int c, size_t n); > char *strreplace(char *s, char old, char new); > +char *strtolower(char *s); > > extern void kfree_const(const void *x); > > diff --git a/lib/string.c b/lib/string.c > index ed83562..6e3b560 100644 > --- a/lib/string.c > +++ b/lib/string.c > @@ -952,3 +952,17 @@ char *strreplace(char *s, char old, char new) > return s; > } > EXPORT_SYMBOL(strreplace); > + > +char...
2016 Jul 09
0
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...> void *memchr_inv(const void *s, int c, size_t n); >> char *strreplace(char *s, char old, char new); >> +extern void strlcpytoupper(char *dst, const char *src, size_t len); >> +extern void strlcpytolower(char *dst, const char *src, size_t len); >> >> extern void kfree_const(const void *x); >> >> @@ -169,4 +171,42 @@ static inline const char *kbasename(const char *path) >> return tail ? tail + 1 : path; >> } >> >> +/** >> + * strcpytoupper - Copy string and convert to uppercase. >> + * @dst: The buffer to store the...
2016 Jul 05
0
[PATCH v2 1/7] lib: string: add functions to case-convert strings
...rn void * memchr(const void *,int,__kernel_size_t); #endif void *memchr_inv(const void *s, int c, size_t n); char *strreplace(char *s, char old, char new); +char *strncpytoupper(char *dst, const char *src, size_t len); +char *strncpytolower(char *dst, const char *src, size_t len); extern void kfree_const(const void *x); @@ -169,4 +171,50 @@ static inline const char *kbasename(const char *path) return tail ? tail + 1 : path; } +/** + * strcpytoupper - Copy string and convert to uppercase. + * @dst: The buffer to store the result. + * @src: The string to convert to uppercase. + * + * Returns p...
2016 Jul 08
6
[PATCH v3 0/7] lib: string: add functions to case-convert strings
This series introduces a family of generic string case conversion functions. This kind of functionality is needed in several places in the kernel. Right now, everybody seems to be implementing their own copy of this functionality. Based on the discussion of the previous version of this series[1] and the use cases found in the kernel, it does look like having several flavours of case conversion
2016 Jul 10
1
[PATCH v3 0/7] lib: string: add functions to case-convert strings
On 7/8/2016 6:43 PM, Markus Mayer wrote: > This series introduces a family of generic string case conversion > functions. This kind of functionality is needed in several places in > the kernel. Right now, everybody seems to be implementing their own > copy of this functionality. > > Based on the discussion of the previous version of this series[1] and > the use cases found in
2016 Jul 13
0
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...t c, size_t n); >>>> char *strreplace(char *s, char old, char new); >>>> +extern void strlcpytoupper(char *dst, const char *src, size_t len); >>>> +extern void strlcpytolower(char *dst, const char *src, size_t len); >>>> >>>> extern void kfree_const(const void *x); >>>> >>>> @@ -169,4 +171,42 @@ static inline const char *kbasename(const char *path) >>>> return tail ? tail + 1 : path; >>>> } >>>> >>>> +/** >>>> + * strcpytoupper - Copy string and convert...
2016 Jul 11
2
[PATCH v3 1/7] lib: string: add functions to case-convert strings
...nv(const void *s, int c, size_t n); >>> char *strreplace(char *s, char old, char new); >>> +extern void strlcpytoupper(char *dst, const char *src, size_t len); >>> +extern void strlcpytolower(char *dst, const char *src, size_t len); >>> >>> extern void kfree_const(const void *x); >>> >>> @@ -169,4 +171,42 @@ static inline const char *kbasename(const char *path) >>> return tail ? tail + 1 : path; >>> } >>> >>> +/** >>> + * strcpytoupper - Copy string and convert to uppercase. >>> +...
2016 Aug 10
3
[PATCH v5 0/7] lib: string: add functions to case-convert strings
This series introduces a family of generic string case conversion functions. This kind of functionality is needed in several places in the kernel. Right now, everybody seems to be implementing their own copy of this functionality. Based on the discussion of the previous version of this series[1] and the use cases found in the kernel, it does look like having several flavours of case conversion