tools/testing/selftests/powerpc/stringloops/string.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/stringloops/string.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/powerpc/stringloops/string.c
Extension
.c
Size
347 bytes
Lines
22
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
/*
 * Copied from linux/lib/string.c
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 */

#include <stddef.h>

/**
 * strlen - Find the length of a string
 * @s: The string to be sized
 */
size_t test_strlen(const char *s)
{
	const char *sc;

	for (sc = s; *sc != '\0'; ++sc)
		/* nothing */;
	return sc - s;
}

Annotation

Implementation Notes