Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp250346pxy; Sat, 31 Jul 2021 06:17:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyP/zB9ecyA/3wQyDfP8oaYHjDScBReUWIIr4amsI462fqSnMa0ThfS97ryfG3dS1Zpg0Q X-Received: by 2002:a92:cdae:: with SMTP id g14mr1558589ild.123.1627737450777; Sat, 31 Jul 2021 06:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627737450; cv=none; d=google.com; s=arc-20160816; b=sawKLWDIckHZqQqBDlzqri90gpxpW2swuYne+F22lCJ5+PFnvTRrplSnfOpygQiVWu FlJvlvIdQbTxJ/cYF0QTCnoLqOIeHNzhnzqAZ29e6cI0ZkTwAW9MFZ/14GKChvDc+CyN MooTot2ZsUa9XJdPu/qoVuup6B+EsGanZxr7NaGpRS2v/iqkAvG9veJsqSA3cbqf28pk g2lgDWmeUV6LVnkTsf4qK0vAa+Tb10kQkVJIUMjjIGx9mAFQeg5SiejbRWGBjxQh5Dsb 0VDVBZ5a7UXOJHjf0ldmZe+4LT6PUBNLuIeoVCmAQyglk2HmQT7yfuA39nLiwtIyDdeR nJ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=QSfShO/PVTiT1O/MwjWNE+TWRMt8JqlUkWvMb7L+n5A=; b=HcRZAudIntk6eSiJ2frZeU832TA3V1au9KZwNAWP19zaWA1AXt73l0cxBzFyBcfmiM emAvfObVmFj4mUN79jVToBWB0nYzI44PdNMdy4Fq0iweZkuVyzh1YEfyYfdgsYJ8MOOV 7mDOiTRsgX9KmSo2WY7pEgcui23BJMJlpf5V/hmTpRt3cpLZ0ZanVxOAC0S8kBf5ojUB sS5JEYpnSwetyNDZ9AzFqET1YOy5KrEm27Rp87GEqF3YT5w1hheypcdRqOX4ZCccfT42 83tYQoHeDGx7JplXZJ7yr2BeDVPtmmpfyJ3MVwgeleTFGNk0UMkeuCMUEu8fCZUPM10O jv3w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d16si5673129ilf.64.2021.07.31.06.16.51; Sat, 31 Jul 2021 06:17:30 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232380AbhGaNK1 (ORCPT + 99 others); Sat, 31 Jul 2021 09:10:27 -0400 Received: from smtpbg128.qq.com ([106.55.201.39]:46606 "EHLO smtpbg587.qq.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232211AbhGaNK1 (ORCPT ); Sat, 31 Jul 2021 09:10:27 -0400 X-QQ-mid: bizesmtp32t1627737014tpv99w6x Received: from ficus.lan (unknown [171.223.99.141]) by esmtp6.qq.com (ESMTP) with id ; Sat, 31 Jul 2021 21:10:13 +0800 (CST) X-QQ-SSF: 01000000002000B0C000B00A0000000 X-QQ-FEAT: bj+H3nJpNbUXQNLi6YvOfJns/925NzbUJywgbkzKAuYqShvwscyZ5afsB4H52 4FVqC2lNigyVV3pCHVCLGoqIiYMw0VUeJki6rm/UPEtlfjWLTyW06heXk25WgG1OoccXws8 jo2l1Qy6xmF+zrsPfJ3OUe0zMwSWwIKcM36Az5L/aiXBEcSQMW67VsAfwjD3CrZPpznCJMc CRYuVrsGBmWHTuTVYDPoaNqa6IfAXIOf/aUtpBCu7GlKSM5FdrbRDD9LAiCszTXI6TILfGs I831LHgvmvIRgmFdUVummw3EsZMIjm/22mySc/ENOCkqPTNW8VY8eVbYybpvgXgqhH0ZGCD bajq3Ch+VAVHy5xYuc= X-QQ-GoodBg: 0 From: Jason Wang To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Wang Subject: [PATCH] file: use 'unsigned int' instead of 'unsigned' Date: Sat, 31 Jul 2021 21:09:57 +0800 Message-Id: <20210731130957.416337-1-wangborong@cdjrlc.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:cdjrlc.com:qybgspam:qybgspam5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prefer 'unsigned int' to bare use of 'unsigned'. Signed-off-by: Jason Wang --- fs/file.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/file.c b/fs/file.c index d8afa8266859..9b8513ccf006 100644 --- a/fs/file.c +++ b/fs/file.c @@ -467,7 +467,7 @@ static unsigned int find_next_fd(struct fdtable *fdt, unsigned int start) /* * allocate a file descriptor, mark it busy. */ -static int alloc_fd(unsigned start, unsigned end, unsigned flags) +static int alloc_fd(unsigned int start, unsigned int end, unsigned int flags) { struct files_struct *files = current->files; unsigned int fd; @@ -525,12 +525,12 @@ static int alloc_fd(unsigned start, unsigned end, unsigned flags) return error; } -int __get_unused_fd_flags(unsigned flags, unsigned long nofile) +int __get_unused_fd_flags(unsigned int flags, unsigned long nofile) { return alloc_fd(0, nofile, flags); } -int get_unused_fd_flags(unsigned flags) +int get_unused_fd_flags(unsigned int flags) { return __get_unused_fd_flags(flags, rlimit(RLIMIT_NOFILE)); } @@ -606,7 +606,7 @@ EXPORT_SYMBOL(fd_install); * * Returns: The file associated with @fd, on error returns an error pointer. */ -static struct file *pick_file(struct files_struct *files, unsigned fd) +static struct file *pick_file(struct files_struct *files, unsigned int fd) { struct file *file; struct fdtable *fdt; @@ -630,7 +630,7 @@ static struct file *pick_file(struct files_struct *files, unsigned fd) return file; } -int close_fd(unsigned fd) +int close_fd(unsigned int fd) { struct files_struct *files = current->files; struct file *file; @@ -651,7 +651,7 @@ EXPORT_SYMBOL(close_fd); /* for ksys_close() */ * * Returns: Last valid index into fdtable. */ -static inline unsigned last_fd(struct fdtable *fdt) +static inline unsigned int last_fd(struct fdtable *fdt) { return fdt->max_fds - 1; } @@ -699,7 +699,7 @@ static inline void __range_close(struct files_struct *cur_fds, unsigned int fd, * This closes a range of file descriptors. All file descriptors * from @fd up to and including @max_fd are closed. */ -int __close_range(unsigned fd, unsigned max_fd, unsigned int flags) +int __close_range(unsigned int fd, unsigned int max_fd, unsigned int flags) { struct task_struct *me = current; struct files_struct *cur_fds = me->files, *fds = NULL; @@ -807,14 +807,14 @@ int close_fd_get_file(unsigned int fd, struct file **res) void do_close_on_exec(struct files_struct *files) { - unsigned i; + unsigned int i; struct fdtable *fdt; /* exec unshares first */ spin_lock(&files->file_lock); for (i = 0; ; i++) { unsigned long set; - unsigned fd = i * BITS_PER_LONG; + unsigned int fd = i * BITS_PER_LONG; fdt = files_fdtable(files); if (fd >= fdt->max_fds) break; @@ -1030,7 +1030,7 @@ bool get_close_on_exec(unsigned int fd) } static int do_dup2(struct files_struct *files, - struct file *file, unsigned fd, unsigned flags) + struct file *file, unsigned int fd, unsigned int flags) __releases(&files->file_lock) { struct file *tofree; @@ -1073,7 +1073,7 @@ __releases(&files->file_lock) return -EBUSY; } -int replace_fd(unsigned fd, struct file *file, unsigned flags) +int replace_fd(unsigned int fd, struct file *file, unsigned int flags) { int err; struct files_struct *files = current->files; @@ -1219,7 +1219,7 @@ SYSCALL_DEFINE1(dup, unsigned int, fildes) return ret; } -int f_dupfd(unsigned int from, struct file *file, unsigned flags) +int f_dupfd(unsigned int from, struct file *file, unsigned int flags) { unsigned long nofile = rlimit(RLIMIT_NOFILE); int err; @@ -1233,8 +1233,8 @@ int f_dupfd(unsigned int from, struct file *file, unsigned flags) return err; } -int iterate_fd(struct files_struct *files, unsigned n, - int (*f)(const void *, struct file *, unsigned), +int iterate_fd(struct files_struct *files, unsigned int n, + int (*f)(const void *, struct file *, unsigned int), const void *p) { struct fdtable *fdt; -- 2.32.0