From patchwork Tue Apr 24 19:46:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10360865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 032AA602D6 for ; Tue, 24 Apr 2018 19:46:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E709C27FA1 for ; Tue, 24 Apr 2018 19:46:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA4452847B; Tue, 24 Apr 2018 19:46:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62BBF27FA1 for ; Tue, 24 Apr 2018 19:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750841AbeDXTqo (ORCPT ); Tue, 24 Apr 2018 15:46:44 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:42588 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791AbeDXTqn (ORCPT ); Tue, 24 Apr 2018 15:46:43 -0400 Received: by mail-pf0-f196.google.com with SMTP id o16so13127307pfk.9 for ; Tue, 24 Apr 2018 12:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=EFBS/0BTcvHWzdwqYTv1uAlfwzJMaGnxfuiV9DrzPVY=; b=XWPjGuLNpv4/rXHwj2VmMk2w1C9uKWfbG/nX/ffC8rNcQjn78f7Qd7hu12V2W83P6W LHQ6VQyC/VuEM+A3Y5CXi5ejRRu3G1eb3M7SFz/Dw6AtOQfQd3dL4FcBG7lvtnHtlWhk IqS1rtrvjidx/OszGEujH62mptudtyFAcLSA4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EFBS/0BTcvHWzdwqYTv1uAlfwzJMaGnxfuiV9DrzPVY=; b=kSeEg02CZnSHap0Zw2fxEopS6zqYTYr6b04xz54CeeVFKj1wXOrCiRQVbVsyKW/XAM 2YSEhIrv3YPUUwE8jvl7VWg2G8FUqyVb4qqwzC2gD/iZc68dyfqzM4MNk7iJLjWLSAj4 dVlbvb/LxETDIJ1N0EO7OSSQkyhb9htGZoxTEg+/wWcQCoadaPYNg6qE3sbM9irIro9F jm5/F5e1z4KygOuOgGED12opYdFMNde0o/Yj5FXqCESfT5fPaa9gng56KuQlufd8Tr5Y xS//RPJPTmqHpUdJ+Yj+wx1Ri+G7/wMX5GTtB4oclgg2DNwKc8GNnXepHMAqz8RUuiwg YbUw== X-Gm-Message-State: ALQs6tANQKT1PvAWbN1pHWgUE6zD0+6y03u5PDGyKvdUxLLsvue785eU GAYktjAW/Qv4twcNsWdzMf1q9A== X-Google-Smtp-Source: AB8JxZog3mlli55FQNa7Ga2mrgrMUwffKruvu3JLhxbD70mhILAWDaC7zw4xtA9gj9mfW52vMAJL3g== X-Received: by 10.98.9.145 with SMTP id 17mr4141929pfj.34.1524599203234; Tue, 24 Apr 2018 12:46:43 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id y6sm28643707pfd.18.2018.04.24.12.46.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 12:46:42 -0700 (PDT) From: Bjorn Andersson To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / devfreq: Drop custom MIN/MAX macros Date: Tue, 24 Apr 2018 12:46:39 -0700 Message-Id: <20180424194639.22804-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.16.2 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drop the custom MIN/MAX macros in favour of the standard min/max from kernel.h Signed-off-by: Bjorn Andersson Reviewed-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index fe2af6aa88fc..2067cd229ce3 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -28,9 +28,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; /* @@ -280,8 +277,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; @@ -1149,7 +1146,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, @@ -1185,7 +1182,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);