From patchwork Thu Dec 15 13:38:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seraphime Kirkovski X-Patchwork-Id: 9476139 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 92199607EE for ; Thu, 15 Dec 2016 13:38:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96E5728766 for ; Thu, 15 Dec 2016 13:38:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B33128772; Thu, 15 Dec 2016 13:38:45 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 44DAE28766 for ; Thu, 15 Dec 2016 13:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932594AbcLONim (ORCPT ); Thu, 15 Dec 2016 08:38:42 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36591 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755291AbcLONil (ORCPT ); Thu, 15 Dec 2016 08:38:41 -0500 Received: by mail-wm0-f65.google.com with SMTP id m203so6538662wma.3 for ; Thu, 15 Dec 2016 05:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=usM72qGA05QFGu4bc7bXsKqjlDqhrMB67SUPc+5W2Gc=; b=Mqeo3WfZzAeXhDIqizbgQxL67f09vU9OxV6tcYMVTdnnuvppsUhiGLsAhPxNatPu71 DBM7EbvPH93G6aL6ONQmn+l6P/cv0LAUJ1Ytk6TRndqTz11ZbJ0OWHMZlDMzePHRhABO Tyi9vvrTDgtA6ZyiIq3CWZ+gICAIwrJEAqQoUI4hydwMx3KkSakxACA7ISCztZiE12yH 9eAdULeP+uHYE8Xki9FibFpHU+p31we1/pdCirZPbRyCUt24tivG/uKCgJpzk/WaWQmF B4A/JjfsS4u+a/qVtImH+Msiba0UFMeqwtU/YqwxGguaIEx8Clf1h/vZrRijNRzYM6P3 dOng== 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=usM72qGA05QFGu4bc7bXsKqjlDqhrMB67SUPc+5W2Gc=; b=SqyVFFuJpU/a73bnbjHA4mqopvcc2+tCGPEge1i9qP8aoZY6qGp1sN3RUb1kpG4QzX 192/kAsVYEPRYK6OfaOQtxCRmNIsnRkolA32RHfBXwM1vu1pIbxa/+NlBIl5yhc+b/Gl CKp8zCkaLwAH2v2hXImone3oFd7AzAcLoiEUQWmKCget3YOTi/wm9cH1mBpcY0T/ELY/ 4oy8wCYVwzsnErTkcKJq155gw9TEfjdCI35mzPWjyXlp6kvkYX0Rfl5mn/BKB7JhV4IO EjO3FkmHkFlNw1WwhUCMwW8rlYPexE8BP4cfjAC5/FC3R3lZN48SyZTxyLD2VEisXq5v ZuGQ== X-Gm-Message-State: AIkVDXLZVe72p9lWyXoAUYDoJZW7QD9D5uMgzNnUjkUYUJ89rkjDsOn5LOO3I6E/bfl7Bg== X-Received: by 10.28.132.201 with SMTP id g192mr1540706wmd.134.1481809112397; Thu, 15 Dec 2016 05:38:32 -0800 (PST) Received: from localhost (cha92-19-78-239-153-115.fbx.proxad.net. [78.239.153.115]) by smtp.gmail.com with ESMTPSA id f3sm12590711wmf.10.2016.12.15.05.38.30 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 15 Dec 2016 05:38:31 -0800 (PST) Received: by localhost (sSMTP sendmail emulation); Thu, 15 Dec 2016 14:38:30 +0100 From: Seraphime Kirkovski To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.com, jbacik@fb.com, clm@fb.com, Seraphime Kirkovski Subject: [PATCH 4/4] Btrfs: code cleanup min/max -> min_t/max_t Date: Thu, 15 Dec 2016 14:38:28 +0100 Message-Id: <20161215133828.25791-1-kirkseraph@gmail.com> X-Mailer: git-send-email 2.10.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This cleans up the cases where the min/max macros were used with a cast rather than using directly min_t/max_t. Signed-off-by: Seraphime Kirkovski Reviewed-by: David Sterba --- fs/btrfs/file-item.c | 4 ++-- fs/btrfs/ioctl.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 5fd5f45..7ae52cf 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -867,8 +867,8 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, tmp = min(tmp, (next_offset - file_key.offset) >> root->fs_info->sb->s_blocksize_bits); - tmp = max((u64)1, tmp); - tmp = min(tmp, (u64)MAX_CSUM_ITEMS(root, csum_size)); + tmp = max_t(u64, 1, tmp); + tmp = min_t(u64, tmp, MAX_CSUM_ITEMS(root, csum_size)); ins_size = csum_size * tmp; } else { ins_size = csum_size; diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 8bf0d44..fc6dc14 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -394,7 +394,7 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg) q = bdev_get_queue(device->bdev); if (blk_queue_discard(q)) { num_devices++; - minlen = min((u64)q->limits.discard_granularity, + minlen = min_t(u64, q->limits.discard_granularity, minlen); } }