Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1274796ybe; Thu, 5 Sep 2019 12:58:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPj5kuNrjzWV/Pdhd0di9SXvnZUmNyp0pki9xfU8I5doQ5hY3SKSf0SZxsLP0ro4WZeyaG X-Received: by 2002:a17:902:b583:: with SMTP id a3mr5286765pls.52.1567713538815; Thu, 05 Sep 2019 12:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567713538; cv=none; d=google.com; s=arc-20160816; b=zjOPVEG8Y28lUIROYrGQKoDKDiluPeMLaMsLvhT/ygz2trH7DDXB2FbuRVh3VpLdKR uOFjZGVVq5UA3/GuoNDPjAe9C5XrhByWaVBoOsubGyIRFA5CJ1HtqY5kW6YD1XH0BkRQ y0kaMctI/2AvIVFOWYFd4PeDX1q+C1U62lPwLt2j3361GLYOLeBmegHIxuAQFTf5e9rS JM/c0dx45tT7vFGA9IsuWDttdH7T1+V7fgKKe4Ybg2XOuvvUCw9vAy0YDHrswILh9HYx dQeQi8nkXQBkDrnMnwkBgqOw+Cp1sdvP8heU8pm4m+gn7z9jbAT5qsBWeuZHGfQuZFoK xxXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=oynywReNw33imcTB/r1iY3dIxBkigRrctaYwavQqT8g=; b=d7Yqi1abPHGXRNdAWjOYLGogFmCWuSLHLKWgixrfoFHn4xUv3CyAZ4hh/OnIM9uc0l Kdz/KR2D1ZNPzS5E4C6SezgbxX+UBHGWlfbXVTXf/sbrLp7nLqyP7snNq2/Cgx5efq/0 9BmTl+PYeNVw23UM/Au44PmsBk3IJTm11dp3T4qV4IA5VjW0QdBfDSmEHfF2HOF+8mPY fhdjkmfHCRQ7wZizr8LewTesTubrRXU0Pgpj4kbKJTfMta7g6mve1gOuEKAQorWRm0rD A0FRk6eE8KaqdQktkwb4h+rwXjQox22mEHoeiANuhy0tZ0jeip80F2SH5YkNjAQFhSw/ u44Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y193si2650813pgd.108.2019.09.05.12.58.42; Thu, 05 Sep 2019 12:58:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730480AbfIEQUP (ORCPT + 99 others); Thu, 5 Sep 2019 12:20:15 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6233 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733091AbfIEQSD (ORCPT ); Thu, 5 Sep 2019 12:18:03 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D70742E5B8FC85451BFF; Fri, 6 Sep 2019 00:18:00 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Fri, 6 Sep 2019 00:18:37 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH 1/4] media: dvb-frontends: Use DIV_ROUND_CLOSEST directly to make it readable Date: Fri, 6 Sep 2019 00:14:49 +0800 Message-ID: <1567700092-27769-2-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1567700092-27769-1-git-send-email-zhongjiang@huawei.com> References: <1567700092-27769-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/dvb-frontends/mt312.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mt312.c b/drivers/media/dvb-frontends/mt312.c index 7cae7d6..251ff41 100644 --- a/drivers/media/dvb-frontends/mt312.c +++ b/drivers/media/dvb-frontends/mt312.c @@ -137,7 +137,7 @@ static inline int mt312_writereg(struct mt312_state *state, static inline u32 mt312_div(u32 a, u32 b) { - return (a + (b / 2)) / b; + return DIV_ROUND_CLOSEST(a, b); } static int mt312_reset(struct mt312_state *state, const u8 full) -- 1.7.12.4