summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fsl-mc/bus/dprc-driver.c
diff options
context:
space:
mode:
authorLaurentiu Tudor <laurentiu.tudor@nxp.com>2017-06-22 16:35:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-23 18:44:00 +0200
commit410ab9b5f8a925ce082ddd001c4e73aab8b699de (patch)
treede8629d09b2b36929b2b1db232f13b055439d3d9 /drivers/staging/fsl-mc/bus/dprc-driver.c
parentd2176b325f8a640d7adbf882f4e0f29767d04b8e (diff)
downloadlinux-410ab9b5f8a925ce082ddd001c4e73aab8b699de.tar.bz2
staging: fsl-mc: drop macros with possible side effects
Several macros were triggering this checkpatch.pl warning: "Macro argument reuse '$arg' - possible side-effects?" Fix the warning by turning them into real functions. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-mc/bus/dprc-driver.c')
-rw-r--r--drivers/staging/fsl-mc/bus/dprc-driver.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
index d723c69a9151..80c080f20da1 100644
--- a/drivers/staging/fsl-mc/bus/dprc-driver.c
+++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
@@ -21,15 +21,18 @@
#define FSL_MC_DPRC_DRIVER_NAME "fsl_mc_dprc"
-#define FSL_MC_DEVICE_MATCH(_mc_dev, _obj_desc) \
- (strcmp((_mc_dev)->obj_desc.type, (_obj_desc)->type) == 0 && \
- (_mc_dev)->obj_desc.id == (_obj_desc)->id)
-
struct dprc_child_objs {
int child_count;
struct dprc_obj_desc *child_array;
};
+static bool fsl_mc_device_match(struct fsl_mc_device *mc_dev,
+ struct dprc_obj_desc *obj_desc)
+{
+ return !strcmp(mc_dev->obj_desc.type, obj_desc->type) &&
+ mc_dev->obj_desc.id == obj_desc->id;
+}
+
static int __fsl_mc_device_remove_if_not_in_mc(struct device *dev, void *data)
{
int i;
@@ -45,7 +48,7 @@ static int __fsl_mc_device_remove_if_not_in_mc(struct device *dev, void *data)
struct dprc_obj_desc *obj_desc = &objs->child_array[i];
if (strlen(obj_desc->type) != 0 &&
- FSL_MC_DEVICE_MATCH(mc_dev, obj_desc))
+ fsl_mc_device_match(mc_dev, obj_desc))
break;
}
@@ -105,7 +108,7 @@ static int __fsl_mc_device_match(struct device *dev, void *data)
struct dprc_obj_desc *obj_desc = data;
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
- return FSL_MC_DEVICE_MATCH(mc_dev, obj_desc);
+ return fsl_mc_device_match(mc_dev, obj_desc);
}
static struct fsl_mc_device *fsl_mc_device_lookup(struct dprc_obj_desc