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: 134192 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2634254lji; Tue, 24 Apr 2018 12:46:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+L9wKgofX50L5yKfivEyVu9xEC5s/iaTFpV4d1y2B2334qxPqCSttfluIVGvou181E6wKX X-Received: by 2002:a17:902:31a4:: with SMTP id x33-v6mr26301845plb.355.1524599207685; Tue, 24 Apr 2018 12:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524599207; cv=none; d=google.com; s=arc-20160816; b=LoAnO9WbNmhpuhnuv9yxDh/8uYKaO2JtyxJmRJlPKbq0BZkaVwQh7CabRh9m7+Cjez dKK1QsGECQQAN0zgHUwzRFg5kJc/ckBDPUy3jtboA302Jhlk4qOVMO48d5uqwHQCarBr FWWrdDeO9kBHaKZTheizfADeV218PnGG/BFWkim7OoaKo2+ZkreedlucJ8RIuAyTP0y2 ylNa/MLeZxva9w37n8wLASEzfkP/tZVMwTBdqrkOlHEWAXILMT4mUOPbdMknFfVcDxTL hLNQQPpOl20yXicY4FRYtS5rDY8q5JLJ8oVgy2iZ6ZSNP3lrf7CgRL/9ilP88AoE6nGS oxEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=EFBS/0BTcvHWzdwqYTv1uAlfwzJMaGnxfuiV9DrzPVY=; b=gM3Z71Ls/u2EkUQse81BQuqRvCvjGfBzyFk7kIKTj6mTeoTw6OfQyUeG+O+q48GLNd jZapQhyR4C7U0A9MduKBED4eAkFQAneIYehe62IME5okpAKwkScQWQaRccLFLj8Cbq7g eZzJ+/02cLLZGzf1p8lATeERLb4cXVrhpAJL2NeqOkdiVSohDLA+iP0n/+phrJGYjPiQ wI51/zNdPoqBKugB2tzp6+JevIrCg0Gr+tVw2aZ8C4CdPYOh0jrcyA19eSa8nA5PdmYn 5uPudOsjzp4uj4CktVCLziQxtHsLPpC8PXXzUcPglSDVGBpzZvoT7Qt1nO8uftE6BJrc pntA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XWPjGuLN; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g85si14499770pfg.192.2018.04.24.12.46.47; Tue, 24 Apr 2018 12:46:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XWPjGuLN; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750841AbeDXTqo (ORCPT + 11 others); 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-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 Drop the custom MIN/MAX macros in favour of the standard min/max from kernel.h Signed-off-by: Bjorn Andersson --- drivers/devfreq/devfreq.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 2.16.2 Reviewed-by: Chanwoo Choi 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);