Skip to content

Commit

Permalink
genirq/msi: Make a few functions static
Browse files Browse the repository at this point in the history
None of these functions are used outside of the MSI core.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250309084110.204054172@linutronix.de
  • Loading branch information
Thomas Gleixner committed Mar 13, 2025
1 parent 01499ae commit 5376252
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 38 deletions.
5 changes: 0 additions & 5 deletions include/linux/msi.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ struct device_attribute;
struct irq_domain;
struct irq_affinity_desc;

void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
#ifdef CONFIG_GENERIC_MSI_IRQ
void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg);
#else
Expand Down Expand Up @@ -603,8 +602,6 @@ void msi_remove_device_irq_domain(struct device *dev, unsigned int domid);
bool msi_match_device_irq_domain(struct device *dev, unsigned int domid,
enum irq_domain_bus_token bus_token);

int msi_domain_alloc_irqs_range_locked(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last);
int msi_domain_alloc_irqs_range(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last);
int msi_domain_alloc_irqs_all_locked(struct device *dev, unsigned int domid, int nirqs);
Expand All @@ -613,8 +610,6 @@ struct msi_map msi_domain_alloc_irq_at(struct device *dev, unsigned int domid, u
const struct irq_affinity_desc *affdesc,
union msi_instance_cookie *cookie);

void msi_domain_free_irqs_range_locked(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last);
void msi_domain_free_irqs_range(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last);
void msi_domain_free_irqs_all_locked(struct device *dev, unsigned int domid);
Expand Down
40 changes: 7 additions & 33 deletions kernel/irq/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,11 @@ static int msi_domain_add_simple_msi_descs(struct device *dev, struct msi_ctrl *
return ret;
}

void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
{
*msg = entry->msg;
}

void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg)
{
struct msi_desc *entry = irq_get_msi_desc(irq);

__get_cached_msi_msg(entry, msg);
*msg = entry->msg;
}
EXPORT_SYMBOL_GPL(get_cached_msi_msg);

Expand Down Expand Up @@ -1352,49 +1347,28 @@ static int msi_domain_alloc_locked(struct device *dev, struct msi_ctrl *ctrl)
}

/**
* msi_domain_alloc_irqs_range_locked - Allocate interrupts from a MSI interrupt domain
* msi_domain_alloc_irqs_range - Allocate interrupts from a MSI interrupt domain
* @dev: Pointer to device struct of the device for which the interrupts
* are allocated
* @domid: Id of the interrupt domain to operate on
* @first: First index to allocate (inclusive)
* @last: Last index to allocate (inclusive)
*
* Must be invoked from within a msi_lock_descs() / msi_unlock_descs()
* pair. Use this for MSI irqdomains which implement their own descriptor
* allocation/free.
*
* Return: %0 on success or an error code.
*/
int msi_domain_alloc_irqs_range_locked(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last)
int msi_domain_alloc_irqs_range(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last)
{
struct msi_ctrl ctrl = {
.domid = domid,
.first = first,
.last = last,
.nirqs = last + 1 - first,
};

return msi_domain_alloc_locked(dev, &ctrl);
}

/**
* msi_domain_alloc_irqs_range - Allocate interrupts from a MSI interrupt domain
* @dev: Pointer to device struct of the device for which the interrupts
* are allocated
* @domid: Id of the interrupt domain to operate on
* @first: First index to allocate (inclusive)
* @last: Last index to allocate (inclusive)
*
* Return: %0 on success or an error code.
*/
int msi_domain_alloc_irqs_range(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last)
{
int ret;

msi_lock_descs(dev);
ret = msi_domain_alloc_irqs_range_locked(dev, domid, first, last);
ret = msi_domain_alloc_locked(dev, &ctrl);
msi_unlock_descs(dev);
return ret;
}
Expand Down Expand Up @@ -1618,8 +1592,8 @@ static void msi_domain_free_locked(struct device *dev, struct msi_ctrl *ctrl)
* @first: First index to free (inclusive)
* @last: Last index to free (inclusive)
*/
void msi_domain_free_irqs_range_locked(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last)
static void msi_domain_free_irqs_range_locked(struct device *dev, unsigned int domid,
unsigned int first, unsigned int last)
{
struct msi_ctrl ctrl = {
.domid = domid,
Expand Down

0 comments on commit 5376252

Please sign in to comment.