summaryrefslogtreecommitdiff
path: root/assembler
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@kernel.org>2024-04-10 16:32:35 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2024-04-10 18:32:06 +0200
commitf1313305ecb7d46f7c05e2a4b86d05890a7895a1 (patch)
treed8274744d322d824df9692b9c5b1fccf9ed3b6b6 /assembler
parent58ca03eee63954a7834cbeb6206cb3b32e6d0b7b (diff)
assembler: fix calloc calls with inverted arguments
The new gcc version 14 now complains when calloc is called with inverted arguments. use the script from: a0ee73a8f359 ("benchmarks: fix calloc calls with inverted arguments") To fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Diffstat (limited to 'assembler')
-rw-r--r--assembler/gram.y6
-rw-r--r--assembler/main.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/assembler/gram.y b/assembler/gram.y
index 77975e072..79873b222 100644
--- a/assembler/gram.y
+++ b/assembler/gram.y
@@ -216,7 +216,7 @@ brw_program_add_instruction(struct brw_program *p,
{
struct brw_program_instruction *list_entry;
- list_entry = calloc(sizeof(struct brw_program_instruction), 1);
+ list_entry = calloc(1, sizeof(struct brw_program_instruction));
list_entry->type = GEN4ASM_INSTRUCTION_GEN;
list_entry->insn.gen = instruction->insn.gen;
brw_program_append_entry(p, list_entry);
@@ -228,7 +228,7 @@ brw_program_add_relocatable(struct brw_program *p,
{
struct brw_program_instruction *list_entry;
- list_entry = calloc(sizeof(struct brw_program_instruction), 1);
+ list_entry = calloc(1, sizeof(struct brw_program_instruction));
list_entry->type = GEN4ASM_INSTRUCTION_GEN_RELOCATABLE;
list_entry->insn.gen = instruction->insn.gen;
list_entry->reloc = instruction->reloc;
@@ -239,7 +239,7 @@ static void brw_program_add_label(struct brw_program *p, const char *label)
{
struct brw_program_instruction *list_entry;
- list_entry = calloc(sizeof(struct brw_program_instruction), 1);
+ list_entry = calloc(1, sizeof(struct brw_program_instruction));
list_entry->type = GEN4ASM_INSTRUCTION_LABEL;
list_entry->insn.label.name = strdup(label);
brw_program_append_entry(p, list_entry);
diff --git a/assembler/main.c b/assembler/main.c
index 2d39d4536..77cc98b80 100644
--- a/assembler/main.c
+++ b/assembler/main.c
@@ -397,7 +397,7 @@ int main(int argc, char **argv)
if (entry1 && is_label(entry1) && is_entry_point(entry1)) {
// insert NOP instructions until (inst_offset+1) % 4 == 0
while (((inst_offset+1) % 4) != 0) {
- tmp_entry = calloc(sizeof(*tmp_entry), 1);
+ tmp_entry = calloc(1, sizeof(*tmp_entry));
tmp_entry->insn.gen.header.opcode = BRW_OPCODE_NOP;
entry->next = tmp_entry;
tmp_entry->next = entry1;