Changeset 737 for GPL/branches/uniaud32-exp/lib32/misc.c
- Timestamp:
- Sep 18, 2022, 7:39:50 AM (3 years ago)
- File:
-
- 1 edited
-
GPL/branches/uniaud32-exp/lib32/misc.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-exp/lib32/misc.c
r639 r737 28 28 #include <linux/init.h> 29 29 #include <linux/fs.h> 30 #include <linux/of.h> 30 31 #include <linux/poll.h> 31 32 #define CONFIG_PROC_FS 1 … … 784 785 free_pages((unsigned long) ptr, pg); 785 786 } 787 788 /** 789 * of_node_put() - Decrement refcount of a node 790 * @node: Node to dec refcount, NULL is supported to simplify writing of 791 * callers 792 */ 793 void of_node_put(struct device_node *node) 794 { 795 if (node) 796 kobject_put(&node->kobj); 797 } 798 799 /** 800 * sysfs_streq - return true if strings are equal, modulo trailing newline 801 * @s1: one string 802 * @s2: another string 803 * 804 * This routine returns true iff two strings are equal, treating both 805 * NUL and newline-then-NUL as equivalent string terminations. It's 806 * geared for use with sysfs input strings, which generally terminate 807 * with newlines but are compared against values without newlines. 808 */ 809 bool sysfs_streq(const char *s1, const char *s2) 810 { 811 while (*s1 && *s1 == *s2) { 812 s1++; 813 s2++; 814 } 815 816 if (*s1 == *s2) 817 return true; 818 if (!*s1 && *s2 == '\n' && !s2[1]) 819 return true; 820 if (*s1 == '\n' && !s1[1] && !*s2) 821 return true; 822 return false; 823 } 824 EXPORT_SYMBOL(sysfs_streq);
Note:
See TracChangeset
for help on using the changeset viewer.
