[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vc_VA-2UNJh7epe+oQEiU3WBedomLbAVTD_L4_ocvt8Dw@mail.gmail.com>
Date: Tue, 19 May 2020 11:28:21 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Reinette Chatre <reinette.chatre@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Fenghua Yu <fenghua.yu@...el.com>,
Borislav Petkov <bp@...en8.de>,
Tony Luck <tony.luck@...el.com>, kuo-lang.tseng@...el.com,
ravi.v.shankar@...el.com, Ingo Molnar <mingo@...hat.com>,
Babu Moger <babu.moger@....com>,
"H. Peter Anvin" <hpa@...or.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH V5 4/4] x86/resctrl: Use appropriate API for strings
terminated by newline
On Tue, May 19, 2020 at 2:50 AM Reinette Chatre
<reinette.chatre@...el.com> wrote:
...
> + ret = sysfs_match_string(rdt_mode_str, buf);
> + if (ret < 0) {
> + rdt_last_cmd_puts("Unknown or unsupported mode\n");
> + ret = -EINVAL;
> + goto out;
> + }
> +
> + user_m = ret;
> + } else if (user_m == RDT_MODE_PSEUDO_LOCKED) {
> rdt_last_cmd_puts("Unknown or unsupported mode\n");
> ret = -EINVAL;
> + goto out;
> }
Can't we unify latter with a former like
if (ret == RDT_MODE_PSEUDO_LOCKED)
ret = -EINVAL;
if (ret < 0) {
rdt_last_cmd_puts("Unknown or unsupported mode\n");
goto out;
}
?
Or closer to initial like
if (ret < 0 || ret == RDT_MODE_PSEUDO_LOCKED) {
rdt_last_cmd_puts("Unknown or unsupported mode\n");
ret = -EINVAL;
goto out;
}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists