drivers/acpi/acpica/utnonansi.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/utnonansi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/utnonansi.c- Extension
.c- Size
- 4452 bytes
- Lines
- 175
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
Dependency Surface
acpi/acpi.haccommon.h
Detected Declarations
function acpi_ut_strlwrfunction acpi_ut_struprfunction acpi_ut_stricmpfunction acpi_ut_safe_strcpyfunction acpi_ut_safe_strcatfunction acpi_ut_safe_strncatfunction acpi_ut_safe_strncpy
Annotated Snippet
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/*******************************************************************************
*
* Module Name: utnonansi - Non-ansi C library functions
*
******************************************************************************/
#include <acpi/acpi.h>
#include "accommon.h"
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME("utnonansi")
/*
* Non-ANSI C library functions - strlwr, strupr, stricmp, and "safe"
* string functions.
*/
/*******************************************************************************
*
* FUNCTION: acpi_ut_strlwr (strlwr)
*
* PARAMETERS: src_string - The source string to convert
*
* RETURN: None
*
* DESCRIPTION: Convert a string to lowercase
*
******************************************************************************/
void acpi_ut_strlwr(char *src_string)
{
char *string;
ACPI_FUNCTION_ENTRY();
if (!src_string) {
return;
}
/* Walk entire string, lowercasing the letters */
for (string = src_string; *string; string++) {
*string = (char)tolower((int)*string);
}
}
/*******************************************************************************
*
* FUNCTION: acpi_ut_strupr (strupr)
*
* PARAMETERS: src_string - The source string to convert
*
* RETURN: None
*
* DESCRIPTION: Convert a string to uppercase
*
******************************************************************************/
void acpi_ut_strupr(char *src_string)
{
char *string;
ACPI_FUNCTION_ENTRY();
if (!src_string) {
return;
}
/* Walk entire string, uppercasing the letters */
for (string = src_string; *string; string++) {
*string = (char)toupper((int)*string);
}
}
/******************************************************************************
*
* FUNCTION: acpi_ut_stricmp (stricmp)
*
* PARAMETERS: string1 - first string to compare
* string2 - second string to compare
*
* RETURN: int that signifies string relationship. Zero means strings
* are equal.
*
* DESCRIPTION: Case-insensitive string compare. Implementation of the
* non-ANSI stricmp function.
*
******************************************************************************/
int acpi_ut_stricmp(char *string1, char *string2)
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`.
- Detected declarations: `function acpi_ut_strlwr`, `function acpi_ut_strupr`, `function acpi_ut_stricmp`, `function acpi_ut_safe_strcpy`, `function acpi_ut_safe_strcat`, `function acpi_ut_safe_strncat`, `function acpi_ut_safe_strncpy`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.