diff options
| author | Wolfram Sang <wsa@the-dreams.de> | 2018-01-04 00:50:51 +0300 |
|---|---|---|
| committer | Wolfram Sang <wsa@the-dreams.de> | 2018-01-04 00:50:51 +0300 |
| commit | fddfa22a4403cd19548de075ddada0c7c966a232 (patch) | |
| tree | f981a63ff0c1062aecb5ab48b0585ffe97a7c20b /include/linux/string.h | |
| parent | 639136d2a70ab9837befb22ad5b3d67cb4db2216 (diff) | |
| parent | 0f30aca72c3b68f4b6a443193b574f14106cd61e (diff) | |
| download | linux-fddfa22a4403cd19548de075ddada0c7c966a232.tar.xz | |
Merge tag 'at24-4.16-updates-for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-4.16
"AT24 updates for 4.16 merge window
The driver has been converted to using regmap instead of raw i2c and
smbus calls which shrank the code significantly.
Device tree binding document has been cleaned up. Device tree support in
the driver has been improved and we now support all at24 models as well
as two new DT properties (no-read-rollover and wp-gpios).
We no longer user unreadable magic values for driver data as the way it
was implemented caused problems for some EEPROM models - we switched to
regular structs.
Aside from that, there's a bunch of coding style fixes and minor
improvements all over the place."
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 410ecf17de3c..cfd83eb2f926 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -259,7 +259,10 @@ __FORTIFY_INLINE __kernel_size_t strlen(const char *p) { __kernel_size_t ret; size_t p_size = __builtin_object_size(p, 0); - if (p_size == (size_t)-1) + + /* Work around gcc excess stack consumption issue */ + if (p_size == (size_t)-1 || + (__builtin_constant_p(p[p_size - 1]) && p[p_size - 1] == '\0')) return __builtin_strlen(p); ret = strnlen(p, p_size); if (p_size <= ret) |
