From: Ammar Faizi <[email protected]>
To: kernel test robot <[email protected]>
Cc: [email protected], [email protected],
GNU/Weeb Mailing List <[email protected]>
Subject: Re: [ammarfaizi2-block:af/dev.btrfs 10/11] fs/btrfs/super.c:352:19: error: array type 'cpumask_var_t' (aka 'struct cpumask[1]') is not assignable
Date: Sat, 25 Feb 2023 15:27:40 +0700 [thread overview]
Message-ID: <Y/[email protected]> (raw)
In-Reply-To: <[email protected]>
On Sat, Feb 25, 2023 at 03:23:48PM +0800, kernel test robot wrote:
> >> fs/btrfs/super.c:352:19: error: array type 'cpumask_var_t' (aka 'struct cpumask[1]') is not assignable
> info->wq_cpu_set = mask;
> ~~~~~~~~~~~~~~~~ ^
> 1 error generated.
Oh, it is because cpumask_var_t is defined as a different type,
depending on CONFIG_CPUMASK_OFFSTACK.
When CONFIG_CPUMASK_OFFSTACK=y
typedef struct cpumask *cpumask_var_t;
When CONFIG_CPUMASK_OFFSTACK is not set:
typedef struct cpumask cpumask_var_t[1];
Let's avoid that temporary variable. The fix below...
---
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 47b9e38d6a6313a1..f2e064ba0534a39c 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -323,7 +323,6 @@ static void wq_cpu_set_fix_cpulist(char *set)
static int parse_wq_cpu_set(struct btrfs_fs_info *info, const char *set)
{
- cpumask_var_t mask;
char *set_copy;
int ret;
@@ -331,31 +330,30 @@ static int parse_wq_cpu_set(struct btrfs_fs_info *info, const char *set)
if (!set_copy)
return -ENOMEM;
- if (!alloc_cpumask_var(&mask, GFP_KERNEL)) {
+ if (!alloc_cpumask_var(&info->wq_cpu_set, GFP_KERNEL)) {
ret = -ENOMEM;
goto out_fail;
}
wq_cpu_set_fix_cpulist(set_copy);
- ret = cpulist_parse(set_copy, mask);
+ ret = cpulist_parse(set_copy, info->wq_cpu_set);
if (ret) {
btrfs_err(info, "failed to parse wq_cpu_set: %d", ret);
goto out_fail_cpu;
}
- if (cpumask_empty(mask)) {
+ if (cpumask_empty(info->wq_cpu_set)) {
ret = -EINVAL;
btrfs_err(info, "wq_cpu_set cannot be empty");
goto out_fail_cpu;
}
- info->wq_cpu_set = mask;
info->wq_cpu_set_str = set_copy;
btrfs_set_and_info(info, WQ_CPU_SET, "using wq_cpu_set=%s", set_copy);
return 0;
out_fail_cpu:
- free_cpumask_var(mask);
+ free_cpumask_var(info->wq_cpu_set);
out_fail:
kfree(set_copy);
return ret;
--
Ammar Faizi
prev parent reply other threads:[~2023-02-25 8:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-25 7:23 [ammarfaizi2-block:af/dev.btrfs 10/11] fs/btrfs/super.c:352:19: error: array type 'cpumask_var_t' (aka 'struct cpumask[1]') is not assignable kernel test robot
2023-02-25 8:27 ` Ammar Faizi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y/[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox