mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
string: introduce memweight()
memweight() is the function that counts the total number of bits set in memory area. Unlike bitmap_weight(), memweight() takes pointer and size in bytes to specify a memory area which does not need to be aligned to long-word boundary. [akpm@linux-foundation.org: rename `w' to `ret'] Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Anders Larsen <al@alarsen.net> Cc: Alasdair Kergon <agk@redhat.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Jan Kara <jack@suse.cz> Cc: Andreas Dilger <adilger.kernel@dilger.ca> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Tony Luck <tony.luck@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f7f9505677
commit
639b9e34f1
3 changed files with 42 additions and 1 deletions
|
@ -145,4 +145,7 @@ static inline bool strstarts(const char *str, const char *prefix)
|
|||
return strncmp(str, prefix, strlen(prefix)) == 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern size_t memweight(const void *ptr, size_t bytes);
|
||||
|
||||
#endif /* _LINUX_STRING_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue