Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp956369pxf; Thu, 25 Mar 2021 19:28:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+zbZgrjHpe4fisDzYYdxA++Q4ZROomZgifQQ45b+aK/mFjv5pfM81K7pJOx3YFnIXIRhl X-Received: by 2002:a50:fd15:: with SMTP id i21mr12018986eds.384.1616725712080; Thu, 25 Mar 2021 19:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616725712; cv=none; d=google.com; s=arc-20160816; b=aZCDaVGcaz3u3AzfcjhsknV0NHUeveo3qlLiamTNNuWzuwv13Tj/hu8ICeqLMuqY3u NtxC97L86GbwXW5qexsnI0MeqtSXqtNC8wcpQfWa8Ptq75GqCQeNyWpUqsbFECVVcLJy PHXwOuvW2S1HHoI/hyX2nvh6twvD9c9EBRFPHw0kyLxLtYGKkcwgIJokcKJ9UlTvdvoN H0uWhOQam/TzTjOZpPIpQZSNjsF1yx5/bYXxjUnFqWIzOmB6PiPGG0y5nhb8fnT1Dlir d25HjRhr4He0wVRJcKaOmWOuGd8cOPef5E1Tq8Oy5IuTo0j/PcKFHEpqBfTzz0lNWQQs VpGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=GjCKnapgYqtVM5/TbyHcN/WPmhyNwfEUA8O+Z7xGIxk=; b=kUO7EGKTqkv7zVoG0HSrTZhZk97A+tf+TDMa1gw6cOYw/mSGNu6RoCn3/LTf/u9Plb Z9D5kcT0YLQ74EbiMwzLw51kIrTxMBacfI+1dV74G0FbqMVplYq/9bjno0+FK2naWi7F DUOqO17vziToX7CR+MjmiE+4N94AakcoTAitUVk/JCYUgwK1FU3ZuMNRxomeRuZGxAOH F8MP3C89PuvIeX7Qp0pZLlzEJf/1FgG7eUMq35IDjUmnkAU6tCY0xtMtMm2EsxzwurJR /8Z4fvLOLMZcCF63Dqv7mg9KAEw1uSkBG+hHCZDZqkM1J4OvbHzkUnrVp78eyX7PpaCX TqmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p3si5529808ejn.395.2021.03.25.19.28.09; Thu, 25 Mar 2021 19:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231201AbhCZC0I (ORCPT + 99 others); Thu, 25 Mar 2021 22:26:08 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14550 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbhCZC0A (ORCPT ); Thu, 25 Mar 2021 22:26:00 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F65PB0XRQzPmQq; Fri, 26 Mar 2021 10:23:26 +0800 (CST) Received: from huawei.com (10.175.112.208) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Fri, 26 Mar 2021 10:25:53 +0800 From: Wang Wensheng To: , , , CC: Subject: [PATCH] tick: Use the wrapped function to clear the logic Date: Fri, 26 Mar 2021 02:23:28 +0000 Message-ID: <20210326022328.3266-1-wangwensheng4@huawei.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.208] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function tick_check_replacement() is the combination of tick_check_percpu() and tick_check_preferred(). It make the code easier to understand to use the self-described one function. Signed-off-by: Wang Wensheng --- kernel/time/tick-common.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 9d3a225..e15bc0e 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -348,12 +348,7 @@ void tick_check_new_device(struct clock_event_device *newdev) td = &per_cpu(tick_cpu_device, cpu); curdev = td->evtdev; - /* cpu local device ? */ - if (!tick_check_percpu(curdev, newdev, cpu)) - goto out_bc; - - /* Preference decision */ - if (!tick_check_preferred(curdev, newdev)) + if (!tick_check_replacement(curdev, newdev)) goto out_bc; if (!try_module_get(newdev->owner)) -- 2.9.4