Skip to content
Permalink
Browse files

Fix some coverity-found issues

Mostly with arg types within printf format strings.
  • Loading branch information...
acpibob committed Jul 31, 2019
1 parent 67d81e7 commit db2638ccaac84b61e92f34d60c3630ff5217f852
@@ -290,7 +290,7 @@

#define ASL_PARSE_TREE_DEBUG2 \
" %08X %04X %04X %01X %04X %04X %05X %05X "\
"%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d"
"%08p %08p %08p %08p %08X %08X %04X %02d %5d %5d %5d %5d"

/*
* Macros for ASL/ASL+ converter
@@ -276,7 +276,7 @@ NsDoOneNamespaceObject (

FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u [%u] %*s %4.4s - %s",
AslGbl_NumNamespaceObjects, Level, (Level * 3), " ",
&Node->Name, AcpiUtGetTypeName (Node->Type));
&Node->Name.Ascii, AcpiUtGetTypeName (Node->Type));

Op = Node->Op;
ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node->Object);
@@ -429,7 +429,7 @@ NsDoOneNamespaceObject (
{
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
" [Initial Length 0x%.2X elements]",
Op->Asl.Value.Integer);
(UINT32) Op->Asl.Value.Integer);
}
break;

@@ -452,7 +452,7 @@ NsDoOneNamespaceObject (
{
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
" [Initial Length 0x%.2X bytes]",
Op->Asl.Value.Integer);
(UINT32) Op->Asl.Value.Integer);
}
break;

@@ -1356,7 +1356,7 @@ PrDoIncludeBuffer (
{
if (!(i % 8))
{
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n ", c);
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n ");
}

FlPrintFile (ASL_FILE_PREPROCESSOR, " 0x%2.2X,", c);
@@ -1369,6 +1369,6 @@ PrDoIncludeBuffer (

/* Close the Name() operator */

FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n", BufferName);
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n");
fclose (BinaryBufferFile);
}
@@ -284,7 +284,7 @@ AcpiDbDisplayHistory (
{
if (AcpiGbl_HistoryBuffer[HistoryIndex].Command)
{
AcpiOsPrintf ("%3ld %s\n",
AcpiOsPrintf ("%3u %s\n",
AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum,
AcpiGbl_HistoryBuffer[HistoryIndex].Command);
}
@@ -785,7 +785,7 @@ AcpiDbGetLine (
{
AcpiOsPrintf (
"Buffer overflow while parsing input line (max %u characters)\n",
sizeof (AcpiGbl_DbParsedBuf));
(UINT32) sizeof (AcpiGbl_DbParsedBuf));
return (0);
}

@@ -544,14 +544,14 @@ AcpiDbDisplayStatistics (

for (i = 0; i < ACPI_TYPE_NS_NODE_MAX; i++)
{
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", AcpiUtGetTypeName (i),
AcpiOsPrintf ("%16.16s % 10u% 10u\n", AcpiUtGetTypeName (i),
AcpiGbl_NodeTypeCount [i], AcpiGbl_ObjTypeCount [i]);
}

AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
AcpiOsPrintf ("%16.16s % 10u% 10u\n", "Misc/Unknown",
AcpiGbl_NodeTypeCountMisc, AcpiGbl_ObjTypeCountMisc);

AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "TOTALS:",
AcpiOsPrintf ("%16.16s % 10u% 10u\n", "TOTALS:",
AcpiGbl_NumNodes, AcpiGbl_NumObjects);
break;

@@ -577,18 +577,16 @@ AcpiDbDisplayStatistics (
case CMD_STAT_MISC:

AcpiOsPrintf ("\nMiscellaneous Statistics:\n\n");
AcpiOsPrintf ("Calls to AcpiPsFind:.. ........% 7ld\n",
AcpiGbl_PsFindCount);
AcpiOsPrintf ("Calls to AcpiNsLookup:..........% 7ld\n",
AcpiGbl_NsLookupCount);
AcpiOsPrintf ("%-28s: %7lu\n", "Calls to AcpiPsFind",
(UINT64) AcpiGbl_PsFindCount);
AcpiOsPrintf ("%-28s: %7lu\n", "Calls to AcpiNsLookup",
(UINT64) AcpiGbl_NsLookupCount);

AcpiOsPrintf ("\n");

AcpiOsPrintf ("Mutex usage:\n\n");
AcpiOsPrintf ("\nMutex usage:\n\n");
for (i = 0; i < ACPI_NUM_MUTEX; i++)
{
AcpiOsPrintf ("%-28s: % 7ld\n",
AcpiUtGetMutexName (i), AcpiGbl_MutexInfo[i].UseCount);
AcpiOsPrintf ("%-28s: %7lu\n",
AcpiUtGetMutexName (i), (UINT64) AcpiGbl_MutexInfo[i].UseCount);
}
break;

@@ -761,6 +761,7 @@ AcpiDsCallControlMethod (
}
}

AcpiDsDeleteWalkState(NextWalkState);
return_ACPI_STATUS (Status);


@@ -289,7 +289,7 @@ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] =

#define ACPI_FDE_FIELD_COUNT 5
#define ACPI_FDE_BYTE_BUFFER_SIZE 5
#define ACPI_FDE_DWORD_BUFFER_SIZE (ACPI_FDE_FIELD_COUNT * sizeof (UINT32))
#define ACPI_FDE_DWORD_BUFFER_SIZE (ACPI_FDE_FIELD_COUNT * (UINT32) sizeof (UINT32))


/******************************************************************************

0 comments on commit db2638c

Please sign in to comment.
You can’t perform that action at this time.