Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3631273ybk; Tue, 19 May 2020 09:13:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxww16pqyTYZhXr2mt3LX8yz2HvvXStNaGQ51AMLikdhVeEXMHE+iHtwGsVT3mhF5y6PwbU X-Received: by 2002:a17:906:7e56:: with SMTP id z22mr8637ejr.60.1589904805546; Tue, 19 May 2020 09:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589904805; cv=none; d=google.com; s=arc-20160816; b=wXi3KabhdL2hj5hcDXEqlVzj7gfA/NflNItcutp+ViBklyqtEc6uNovn5UD+pV4V61 ePB9UX77kqZSpFq/5ZM6cT5IW0MmYoytkimQStLv7IdavLAPQIntJnUoN3a+Z2bSvp18 jbqaWGsbxo3fc5E1gRAfqBUwQd2jBdAd1BpiPYEpB9kiqNd1mRZ72lduEJkwBWDBxb2M Ws0tgo2FMx4yojJUgfGM7s8/5MbboQJo2NqYFNX9wjVw5Ec3aeo0kJMXUN+jVzHmmU4g V9G9s5GneXuyg8O4RLEmDpwTYjuKEnQiIOs62+mUjr8YWtUoS0pHtxfp+mNOSGEiim/M aObw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=MA9qBIymTUyP6BJh7xRrm8H38u6aVRcRSiPrYxwYR4E=; b=S27YWJOs8HUrtqQKfPMPEpz1NZL7/7b6Av2WNDceb9eapSBpx9XWeys+xUMEZRgQTE 5qwugyVQtrcQINK21Nq9zlaCBvIxqTsoPgMYke/NE6G/Bq8t7S1icTuXlTazPI5CKYsD TYzwN9UOkipV0m+ShDEYq07aiymhhTjbue2Kdw7/fMpMZeDjcIYg43NU1Tme/+j4awLP 30s4+oW2EGUicjDYw0yBZyKfC+CiNcJRe6qU/JOFPB0EsScRppXTvr14d2TtYQlxqtOI z0+TFJue/oZsi+mhF7vRmn/DxLwgkJ/jZiBIgoU9bTRLAGxAjCcO/AUIvS8FCuJLf7ES DxEQ== 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si129069ejs.38.2020.05.19.09.13.00; Tue, 19 May 2020 09:13:25 -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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729327AbgESQI6 (ORCPT + 99 others); Tue, 19 May 2020 12:08:58 -0400 Received: from mga14.intel.com ([192.55.52.115]:10688 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729055AbgESQI5 (ORCPT ); Tue, 19 May 2020 12:08:57 -0400 IronPort-SDR: ffiIhO6rtS8dacovgxJpm7/KnpMucyg8tkxEpRyFMIRkmOjLFSPK3QQ+C5va1j+k/Ci8Yg9L19 Rrj5jeZc8A/w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 09:08:47 -0700 IronPort-SDR: y7eDh5PvvqyaF5gMVZbrF648sMaseofKEtk+zX50MtQQp11DtIx3fOzRwL2e2gp2tFQueVvF7J 6xkk73sQttEA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,410,1583222400"; d="scan'208";a="289007917" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004.fm.intel.com with ESMTP; 19 May 2020 09:08:44 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jb4nO-007g84-Ux; Tue, 19 May 2020 19:08:46 +0300 Date: Tue, 19 May 2020 19:08:46 +0300 From: Andy Shevchenko To: Reinette Chatre Cc: Thomas Gleixner , Fenghua Yu , Borislav Petkov , Tony Luck , kuo-lang.tseng@intel.com, ravi.v.shankar@intel.com, Ingo Molnar , Babu Moger , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Linux Kernel Mailing List Subject: Re: [PATCH V5 4/4] x86/resctrl: Use appropriate API for strings terminated by newline Message-ID: <20200519160846.GL1634618@smile.fi.intel.com> References: <4a9603b8-32fb-024a-e2f5-14e95b4e3763@intel.com> <20200519160710.GK1634618@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200519160710.GK1634618@smile.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 19, 2020 at 07:07:10PM +0300, Andy Shevchenko wrote: > On Tue, May 19, 2020 at 08:50:22AM -0700, Reinette Chatre wrote: > > On 5/19/2020 1:28 AM, Andy Shevchenko wrote: > > > On Tue, May 19, 2020 at 2:50 AM Reinette Chatre > > > wrote: ... > > > Can't we unify latter with a former like ... > > > This would have been ideal if done from the start but currently "0" is > > returned if the current mode is pseudo-locked and user attempts to > > change the mode to pseudo-locked. Thus, to maintain the current user > > interface the check if user wants to set pseudo-locked mode is moved > > after the check if new mode is same as existing mode and thus not > > unified because that will result in an error returned always when user > > requests pseudo-locked mode. > > Ah, I see now. > > But we can then drop the check from sysfs_match_string() returned value, like > > user_m = sysfs_match_string(); Yes, here some additional checks like if (user_m == mode) goto out; > if (...) { > ... > } else { // w/o even checking for the PSEUDO_LOCKED > ... > goto out; > } > > Can we? -- With Best Regards, Andy Shevchenko