From: Bjorn Andersson Date: Tue, 24 Apr 2018 19:46:39 +0000 (-0700) Subject: PM / devfreq: Drop custom MIN/MAX macros X-Git-Tag: submit/tizen/20190329.020226~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f77528467b60dca6e015e5562dc63a49bc4494b6;p=platform%2Fkernel%2Flinux-exynos.git PM / devfreq: Drop custom MIN/MAX macros Drop the custom MIN/MAX macros in favour of the standard min/max from kernel.h Change-Id: Ic519d8d2be7ec63e412221cdb55d85bad43f1be1 Signed-off-by: Bjorn Andersson Reviewed-by: Chanwoo Choi Signed-off-by: MyungJoo Ham [cw00.choi: Backported from mainline kernel] Signed-off-by: Chanwoo Choi --- diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 3da86a25af1b..dbf971a10123 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -29,9 +29,6 @@ #include #include "governor.h" -#define MAX(a,b) ((a > b) ? a : b) -#define MIN(a,b) ((a < b) ? a : b) - static struct class *devfreq_class; /* @@ -361,8 +358,8 @@ int update_devfreq(struct devfreq *devfreq) * max_freq * min_freq */ - max_freq = MIN(devfreq->scaling_max_freq, devfreq->max_freq); - min_freq = MAX(devfreq->scaling_min_freq, devfreq->min_freq); + max_freq = min(devfreq->scaling_max_freq, devfreq->max_freq); + min_freq = max(devfreq->scaling_min_freq, devfreq->min_freq); if (min_freq && freq < min_freq) { freq = min_freq; @@ -1283,7 +1280,7 @@ static ssize_t min_freq_show(struct device *dev, struct device_attribute *attr, { struct devfreq *df = to_devfreq(dev); - return sprintf(buf, "%lu\n", MAX(df->scaling_min_freq, df->min_freq)); + return sprintf(buf, "%lu\n", max(df->scaling_min_freq, df->min_freq)); } static ssize_t max_freq_store(struct device *dev, struct device_attribute *attr, @@ -1319,7 +1316,7 @@ static ssize_t max_freq_show(struct device *dev, struct device_attribute *attr, { struct devfreq *df = to_devfreq(dev); - return sprintf(buf, "%lu\n", MIN(df->scaling_max_freq, df->max_freq)); + return sprintf(buf, "%lu\n", min(df->scaling_max_freq, df->max_freq)); } static DEVICE_ATTR_RW(max_freq);