Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4503531ybe; Mon, 9 Sep 2019 10:10:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMpreHyBHkcz474XB6WuPg5lWCdXGmn14O8szMU+26vagV4j1uPmEa+xE1E91C+t1Ydqvk X-Received: by 2002:aa7:ccda:: with SMTP id y26mr25522069edt.303.1568049055536; Mon, 09 Sep 2019 10:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568049055; cv=none; d=google.com; s=arc-20160816; b=Kabj7xlH0cH/N7uGFYIgMcJvkQAbBfeFfM2QGMgBMq3oW1L+WdVvnpRLz3u1I/ubzN lMA61jk9FTdXLd0mUuY8DCeE+dYX/8oFZ5085zfbf3i19rQAsJbxy0HcggUJwQ7yrd52 cUrgZ7VdeMgL//dKVkvBIrHEOydGvTDBb/+iyt0U5zFhbyNGSDJYrSmSaL6TViZX7xx3 iU2qZEv4ms7jSXiFwiQiorNCTdMecRSdYPdDbZUx5yVcVXZGzUIZalHeT+KmX7LiZzK7 jeRPHduNwVKH82Z/cxaLDfWWqHlXuW6NAKN5EmFFgz+baZ4FEc6CBf7Mjy19v2Zw8rkg znUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mNgoadWe/xbiWC5hai3+f3S/+uxcBxSYPdc2nuU5mws=; b=rgqH/woTweKPRK8IiqNCJuQAWi2RMBa1MJydyRGie7DSMM9FlLJlcH47gkUJNmwigU uQIOzjupcU2VuSs5W8wZsVxsH2Ei+O48cnySdETkxVBDT8L3HVJ4vxY7GCfdc5DWfE8X RN0iq/NrwIG9/tNYweg64ftJDe7DmqLwuiy3ZWXzC0UytyFNUCsaOwX1Xq4gENMH5Pks bqU9xmSv7AOs4WAr4T6cQhWTePnZKssxhA/qQubf/pFtxffOQIFMEM4k+udufhbV44Up yPR4wwyyoOgFpYnQZZqBE54Ema2Q80U4kcegYdIOdVUuNB5VdeUNmiI0Oj6CWoLbAvrO 19eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@valentin-vidic.from.hr header.s=2017 header.b=QEwHuc12; 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 q46si8925892eda.44.2019.09.09.10.10.31; Mon, 09 Sep 2019 10:10:55 -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; dkim=fail header.i=@valentin-vidic.from.hr header.s=2017 header.b=QEwHuc12; 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 S1727448AbfIHP0Z (ORCPT + 99 others); Sun, 8 Sep 2019 11:26:25 -0400 Received: from valentin-vidic.from.hr ([94.229.67.141]:56353 "EHLO valentin-vidic.from.hr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727213AbfIHP0Y (ORCPT ); Sun, 8 Sep 2019 11:26:24 -0400 X-Virus-Scanned: Debian amavisd-new at valentin-vidic.from.hr Received: by valentin-vidic.from.hr (Postfix, from userid 1000) id A090A216; Sun, 8 Sep 2019 15:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=valentin-vidic.from.hr; s=2017; t=1567956382; bh=otD4YtoGAnYiwKsiyXlPmaPgOS8/hYDsF7LNBx+rN88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QEwHuc12TN4TaxOWvpJKV97Z6OldPbuuAd5AKsStLBfQrknH5rJ2eev9wQj29lox6 LbJ27cq1r5imOorWdAS7ZC6Se7uUilZ6GoWBa4HWu67JwiWPtkKEa7eDFkgQstVy6n KVH+qRNuowFT2FBb0UlCOqG7/VglCBkanjTkN7uCeUONg2A/yfXeYW0PlaZKulxDOj pAoTHf2E0QcVr4d7H8rTW+JK13kGFj8vGZvMGD1abwqYUfc6NwmTujEmWpA0LN4w5d 3MMbwM4h8M7TTIY28mTD8OEWs6OlBufG9PQUfHWkCVyL+j7rNQzTm7fN/qZ886rsl/ /5iRXZbCYfuQA== From: Valentin Vidic To: Greg Kroah-Hartman Cc: Valdis Kletnieks , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Valentin Vidic Subject: [PATCH v3 3/3] staging: exfat: use integer constants Date: Sun, 8 Sep 2019 15:26:16 +0000 Message-Id: <20190908152616.25459-3-vvidic@valentin-vidic.from.hr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190908152616.25459-1-vvidic@valentin-vidic.from.hr> References: <20190908152616.25459-1-vvidic@valentin-vidic.from.hr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace manually generated values with predefined constants. Signed-off-by: Valentin Vidic --- v2: Use constants where possible v3: Split up changes of constants drivers/staging/exfat/exfat_core.c | 18 +++++++++--------- drivers/staging/exfat/exfat_super.c | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index 8965e8453fcb..6eee2aa06bd7 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -204,7 +204,7 @@ s32 fat_alloc_cluster(struct super_block *sb, s32 num_alloc, if ((--num_alloc) == 0) { p_fs->clu_srch_ptr = new_clu; - if (p_fs->used_clusters != (u32)~0) + if (p_fs->used_clusters != UINT_MAX) p_fs->used_clusters += num_clusters; return num_clusters; @@ -215,7 +215,7 @@ s32 fat_alloc_cluster(struct super_block *sb, s32 num_alloc, } p_fs->clu_srch_ptr = new_clu; - if (p_fs->used_clusters != (u32)~0) + if (p_fs->used_clusters != UINT_MAX) p_fs->used_clusters += num_clusters; return num_clusters; @@ -273,7 +273,7 @@ s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc, if ((--num_alloc) == 0) { p_fs->clu_srch_ptr = hint_clu; - if (p_fs->used_clusters != (u32)~0) + if (p_fs->used_clusters != UINT_MAX) p_fs->used_clusters += num_clusters; p_chain->size += num_clusters; @@ -293,7 +293,7 @@ s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc, } p_fs->clu_srch_ptr = hint_clu; - if (p_fs->used_clusters != (u32)~0) + if (p_fs->used_clusters != UINT_MAX) p_fs->used_clusters += num_clusters; p_chain->size += num_clusters; @@ -337,7 +337,7 @@ void fat_free_cluster(struct super_block *sb, struct chain_t *p_chain, } while (clu != CLUSTER_32(~0)); - if (p_fs->used_clusters != (u32)~0) + if (p_fs->used_clusters != UINT_MAX) p_fs->used_clusters -= num_clusters; } @@ -396,7 +396,7 @@ void exfat_free_cluster(struct super_block *sb, struct chain_t *p_chain, } while ((clu != CLUSTER_32(0)) && (clu != CLUSTER_32(~0))); } - if (p_fs->used_clusters != (u32)~0) + if (p_fs->used_clusters != UINT_MAX) p_fs->used_clusters -= num_clusters; } @@ -3064,7 +3064,7 @@ s32 fat16_mount(struct super_block *sb, struct pbr_sector_t *p_pbr) p_fs->vol_flag = VOL_CLEAN; p_fs->clu_srch_ptr = 2; - p_fs->used_clusters = (u32)~0; + p_fs->used_clusters = UINT_MAX; p_fs->fs_func = &fat_fs_func; @@ -3117,7 +3117,7 @@ s32 fat32_mount(struct super_block *sb, struct pbr_sector_t *p_pbr) p_fs->vol_flag = VOL_CLEAN; p_fs->clu_srch_ptr = 2; - p_fs->used_clusters = (u32)~0; + p_fs->used_clusters = UINT_MAX; p_fs->fs_func = &fat_fs_func; @@ -3192,7 +3192,7 @@ s32 exfat_mount(struct super_block *sb, struct pbr_sector_t *p_pbr) p_fs->vol_flag = (u32)GET16(p_bpb->vol_flags); p_fs->clu_srch_ptr = 2; - p_fs->used_clusters = (u32)~0; + p_fs->used_clusters = UINT_MAX; p_fs->fs_func = &exfat_fs_func; diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index 1cb0ec06c54e..610f20683611 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -502,7 +502,7 @@ static int ffsGetVolInfo(struct super_block *sb, struct vol_info_t *info) /* acquire the lock for file system critical section */ down(&p_fs->v_sem); - if (p_fs->used_clusters == (u32)~0) + if (p_fs->used_clusters == UINT_MAX) p_fs->used_clusters = p_fs->fs_func->count_used_clusters(sb); info->FatType = p_fs->vol_type; @@ -3503,7 +3503,7 @@ static int exfat_statfs(struct dentry *dentry, struct kstatfs *buf) struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); struct vol_info_t info; - if (p_fs->used_clusters == (u32)~0) { + if (p_fs->used_clusters == UINT_MAX) { if (ffsGetVolInfo(sb, &info) == FFS_MEDIAERR) return -EIO; @@ -3678,7 +3678,7 @@ static int parse_options(char *options, int silent, int *debug, opts->fs_uid = current_uid(); opts->fs_gid = current_gid(); opts->fs_fmask = opts->fs_dmask = current->fs->umask; - opts->allow_utime = (unsigned short)-1; + opts->allow_utime = U16_MAX; opts->codepage = exfat_default_codepage; opts->iocharset = exfat_default_iocharset; opts->casesensitive = 0; @@ -3770,7 +3770,7 @@ static int parse_options(char *options, int silent, int *debug, } out: - if (opts->allow_utime == (unsigned short)-1) + if (opts->allow_utime == U16_MAX) opts->allow_utime = ~opts->fs_dmask & 0022; return 0; -- 2.20.1