<commit_before>#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/export.h>
#include <linux/mod_devicetable.h>
#include <linux/errno.h>
#include <linux/irq.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>

#include "of_device_common.h"

unsigned int irq_of_parse_and_map(struct device_node *node, int index)
{
	struct platform_device *op = of_find_device_by_node(node);

	if (!op || index >= op->archdata.num_irqs)
		return 0;

	return op->archdata.irqs[index];
}
EXPORT_SYMBOL(irq_of_parse_and_map);

int of_address_to_resource(struct device_node *node, int index,
			   struct resource *r)
{
	struct platform_device *op = of_find_device_by_node(node);

	if (!op || index >= op->num_resources)
		return -EINVAL;

	memcpy(r, &op->archdata.resource[index], sizeof(*r));
	return 0;
}
EXPORT_SYMBOL_GPL(of_address_to_resource);

void __iomem *of_iomap(struct device_node *node, int index)
{
	struct platform_device *op = of_find_device_by_node(node);
	struct resource *r;<commit_msg>sparc: fix sparse warnings in of_device_common.c<commit_after>#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/export.h>
#include <linux/mod_devicetable.h>
#include <linux/errno.h>
#include <linux/irq.h>
#include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>

#include "of_device_common.h"

unsigned int irq_of_parse_and_map(struct device_node *node, int index)
{
	struct platform_device *op = of_find_device_by_node(node);

	if (!op || index >= op->archdata.num_irqs)
		return 0;

	return op->archdata.irqs[index];
}
EXPORT_SYMBOL(irq_of_parse_and_map);

int of_address_to_resource(struct device_node *node, int index,
			   struct resource *r)
{
	struct platform_device *op = of_find_device_by_node(node);

	if (!op || index >= op->num_resources)
		return -EINVAL;

	memcpy(r, &op->archdata.resource[index], sizeof(*r));
	return 0;
}
EXPORT_SYMBOL_GPL(of_address_to_resource);

void __iomem *of_iomap(struct device_node *node, int index)
{
	struct platform_device *op = of_find_device_by_node(node);
	struct resource *r;
{'fraction_non_alphanumeric': 0.13351877607788595, 'fraction_numerical': 0.0018544274455261937, 'mean_word_length': 6.122112211221122, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4536740', 'n_tokens_mistral': 833, 'n_tokens_neox': 804, 'n_words': 166}