Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153895977
D38115.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D38115.diff
View Options
diff --git a/sys/arm/arm/machdep_intr.c b/sys/arm/arm/machdep_intr.c
--- a/sys/arm/arm/machdep_intr.c
+++ b/sys/arm/arm/machdep_intr.c
@@ -52,14 +52,12 @@
#include "pic_if.h"
#ifdef SMP
-#define INTR_IPI_NAMELEN (MAXCOMLEN + 1)
-
struct intr_ipi {
intr_ipi_handler_t * ii_handler;
void * ii_handler_arg;
intr_ipi_send_t * ii_send;
void * ii_send_arg;
- char ii_name[INTR_IPI_NAMELEN];
+ char ii_name[INTRNAME_LEN];
u_long * ii_count;
};
@@ -188,7 +186,7 @@
ii->ii_handler_arg = h_arg;
ii->ii_send = send;
ii->ii_send_arg = s_arg;
- strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN);
+ strlcpy(ii->ii_name, name, sizeof(ii->ii_name));
ii->ii_count = intr_ipi_setup_counters(name);
}
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -104,13 +104,12 @@
typedef void intr_ipi_send_t(void *, cpuset_t, u_int);
typedef void intr_ipi_handler_t(void *);
-#define INTR_IPI_NAMELEN (MAXCOMLEN + 1)
struct intr_ipi {
intr_ipi_handler_t * ii_handler;
void * ii_handler_arg;
intr_ipi_send_t * ii_send;
void * ii_send_arg;
- char ii_name[INTR_IPI_NAMELEN];
+ char ii_name[INTRNAME_LEN];
u_long * ii_count;
};
@@ -372,7 +371,7 @@
ii->ii_handler_arg = arg;
ii->ii_send = pic_ipi_send;
ii->ii_send_arg = isrc;
- strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN);
+ strlcpy(ii->ii_name, name, sizeof(ii->ii_name));
ii->ii_count = intr_ipi_setup_counters(name);
PIC_ENABLE_INTR(intr_irq_root_dev, isrc);
diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
--- a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -2,6 +2,7 @@
* Copyright (c) 2015-2016 Svatopluk Kraus
* Copyright (c) 2015-2016 Michal Meloun
* All rights reserved.
+ * Copyright © 2023 Elliott Mitchell
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -81,8 +82,6 @@
#include "pic_if.h"
#include "msi_if.h"
-#define INTRNAME_LEN (2*MAXCOMLEN + 1)
-
#ifdef DEBUG
#define debugf(fmt, args...) do { printf("%s(): ", __func__); \
printf(fmt,##args); } while (0)
@@ -475,7 +474,7 @@
isrc->isrc_flags = flags;
va_start(ap, fmt);
- vsnprintf(isrc->isrc_name, INTR_ISRC_NAMELEN, fmt, ap);
+ vsnprintf(isrc->isrc_name, sizeof(isrc->isrc_name), fmt, ap);
va_end(ap);
mtx_lock(&isrc_table_lock);
diff --git a/sys/sys/intr.h b/sys/sys/intr.h
--- a/sys/sys/intr.h
+++ b/sys/sys/intr.h
@@ -71,7 +71,7 @@
#endif
typedef int intr_child_irq_filter_t(void *arg, uintptr_t irq);
-#define INTR_ISRC_NAMELEN (MAXCOMLEN + 1)
+#define INTRNAME_LEN (2*MAXCOMLEN + 1)
#define INTR_ISRCF_IPI 0x01 /* IPI interrupt */
#define INTR_ISRCF_PPI 0x02 /* PPI interrupt */
@@ -84,7 +84,7 @@
device_t isrc_dev; /* where isrc is mapped */
u_int isrc_irq; /* unique identificator */
u_int isrc_flags;
- char isrc_name[INTR_ISRC_NAMELEN];
+ char isrc_name[INTRNAME_LEN];
cpuset_t isrc_cpu; /* on which CPUs is enabled */
u_int isrc_index;
u_long * isrc_count;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 25, 2:52 PM (2 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32130647
Default Alt Text
D38115.diff (3 KB)
Attached To
Mode
D38115: intrng: merge INTR_ISRC_NAMELEN into INTRNAME_LEN
Attached
Detach File
Event Timeline
Log In to Comment