diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-07-06 03:39:12 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-07-10 01:36:07 +0200 |
commit | abb6c01519a0318d7165dc9dc5b7d185353f93d6 (patch) | |
tree | 3b6fa1fc13fba77efc13ee3283c3e6c145bd4252 /opencl | |
parent | 493ae7a6bb0c3ad50615db0090e7ae8d391bc327 (diff) |
replace usage of whitelist with allowlist
Background and motivation:
https://tools.ietf.org/html/draft-knodel-terminology-02
[API CHANGE] officecfg::Office::Common::Misc::OpenCLWhiteList -> OpenCLAllowList
Change-Id: I65636b19b13e4af1e4851f70e78053f3443d6bb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98181
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'opencl')
-rw-r--r-- | opencl/source/opencl_device.cxx | 6 | ||||
-rw-r--r-- | opencl/source/openclconfig.cxx | 20 |
2 files changed, 13 insertions, 13 deletions
diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx index 971c63ee3fe0..f0f4a07fe6b1 100644 --- a/opencl/source/opencl_device.cxx +++ b/opencl/source/opencl_device.cxx @@ -345,7 +345,7 @@ int pickBestDevice(std::unique_ptr<ds_profile> const & profile) { ds_device& device = profile->devices[d]; - // Check denylist and whitelist for actual devices + // Check denylist and allowlist for actual devices if (device.eType == DeviceType::OpenCLDevice) { // There is a silly impedance mismatch here. Why do we @@ -360,10 +360,10 @@ int pickBestDevice(std::unique_ptr<ds_profile> const & profile) aDevice.maName = OStringToOUString(device.sDeviceName, RTL_TEXTENCODING_UTF8); aDevice.maDriver = OStringToOUString(device.sDriverVersion, RTL_TEXTENCODING_UTF8); - // If denylisted or not whitelisted, ignore it + // If denylisted or not allowlisted, ignore it if (OpenCLConfig::get().checkImplementation(aPlatform, aDevice)) { - SAL_INFO("opencl.device", "Device[" << d << "] " << device.sDeviceName << " is denylisted or not whitelisted"); + SAL_INFO("opencl.device", "Device[" << d << "] " << device.sDeviceName << " is denylisted or not allowlisted"); device.fTime = DBL_MAX; device.bErrors = false; } diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx index 9a4b1d6bc4c0..46f1ef90a576 100644 --- a/opencl/source/openclconfig.cxx +++ b/opencl/source/openclconfig.cxx @@ -31,19 +31,19 @@ OpenCLConfig::OpenCLConfig() : maDenyList.insert(ImplMatcher("Windows", "", "Intel\\(R\\) Corporation", "", "9\\.17\\.10\\.2884")); // This is what I have tested on Linux and it works for our unit tests. - maWhiteList.insert(ImplMatcher("Linux", "", "Advanced Micro Devices, Inc\\.", "", "1445\\.5 \\(sse2,avx\\)")); + maAllowList.insert(ImplMatcher("Linux", "", "Advanced Micro Devices, Inc\\.", "", "1445\\.5 \\(sse2,avx\\)")); // For now, assume that AMD, Intel and NVIDIA drivers are good - maWhiteList.insert(ImplMatcher("", "", "Advanced Micro Devices, Inc\\.", "", "")); - maWhiteList.insert(ImplMatcher("", "", "Intel\\(R\\) Corporation", "", "")); - maWhiteList.insert(ImplMatcher("", "", "NVIDIA Corporation", "", "")); + maAllowList.insert(ImplMatcher("", "", "Advanced Micro Devices, Inc\\.", "", "")); + maAllowList.insert(ImplMatcher("", "", "Intel\\(R\\) Corporation", "", "")); + maAllowList.insert(ImplMatcher("", "", "NVIDIA Corporation", "", "")); } bool OpenCLConfig::operator== (const OpenCLConfig& r) const { return (mbUseOpenCL == r.mbUseOpenCL && maDenyList == r.maDenyList && - maWhiteList == r.maWhiteList); + maAllowList == r.maAllowList); } bool OpenCLConfig::operator!= (const OpenCLConfig& r) const @@ -181,7 +181,7 @@ OpenCLConfig OpenCLConfig::get() result.mbUseOpenCL = officecfg::Office::Common::Misc::UseOpenCL::get(); result.maDenyList = StringSequenceToSetOfImplMatcher(officecfg::Office::Common::Misc::OpenCLDenyList::get()); - result.maWhiteList = StringSequenceToSetOfImplMatcher(officecfg::Office::Common::Misc::OpenCLWhiteList::get()); + result.maAllowList = StringSequenceToSetOfImplMatcher(officecfg::Office::Common::Misc::OpenCLAllowList::get()); return result; } @@ -192,7 +192,7 @@ void OpenCLConfig::set() officecfg::Office::Common::Misc::UseOpenCL::set(mbUseOpenCL, batch); officecfg::Office::Common::Misc::OpenCLDenyList::set(SetOfImplMatcherToStringSequence(maDenyList), batch); - officecfg::Office::Common::Misc::OpenCLWhiteList::set(SetOfImplMatcherToStringSequence(maWhiteList), batch); + officecfg::Office::Common::Misc::OpenCLAllowList::set(SetOfImplMatcherToStringSequence(maAllowList), batch); batch->commit(); } @@ -206,8 +206,8 @@ bool OpenCLConfig::checkImplementation(const OpenCLPlatformInfo& rPlatform, cons return true; } - // Check for whitelist of known good OpenCL implementations - if (match(maWhiteList, rPlatform, rDevice, "whitelist")) + // Check for allowlist of known good OpenCL implementations + if (match(maAllowList, rPlatform, rDevice, "allowlist")) { SAL_INFO("opencl", "Approving"); return false; @@ -223,7 +223,7 @@ std::ostream& operator<<(std::ostream& rStream, const OpenCLConfig& rConfig) rStream << "{" "UseOpenCL=" << (rConfig.mbUseOpenCL ? "YES" : "NO") << "," "DenyList=" << rConfig.maDenyList << "," - "WhiteList=" << rConfig.maWhiteList << + "AllowList=" << rConfig.maAllowList << "}"; return rStream; } |