Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1546950pxb; Thu, 28 Oct 2021 05:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4l5FCbcXn5XPl9utNEK6jpimeGQXM3lpoKSgSEA9rHCu1fRmjIakSyIHdgFOaNAWs21yg X-Received: by 2002:a17:90b:1910:: with SMTP id mp16mr4322824pjb.30.1635425595147; Thu, 28 Oct 2021 05:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635425595; cv=none; d=google.com; s=arc-20160816; b=oUCDP9bsRQfo+uxg4NKlCZfM6p+ImVZvmfT38/tqQm25HV3dk2jMlAScLqjKLtO7D1 FPbT0/tJ+l74To6a+2z8s7hmjw5Z7mzEniWLnCk95z7e7CGR5lV8Bu5yzkKKvz4uKzr2 LA07srMMuW6/gOuGM5cZr+3mv5tMv+kQAnwoniXg1Zogh6RoGHDCOYmon6TJW2WMiRO2 o+qWS3h36fzOlVmV7dfX/r4hZ9NHpPTjrnV/OwjnpxsWHpJsHPAd5dKopJCyHxFU4u2m kMVkekSapagjtgKDxATT9lJ2RUiJOhoTpIEbLwboI5xBR5NnL3A5d0O8jYOV4GLMmiAS EBMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to; bh=Qp5Yb6X8Xr8M/wFBW7ElSWqmrACTI0lKutQlt+RTrWA=; b=CJQBc79hcgzclSQlLkR9voLQLtVCgxtElV6quhZZZUIXDdNCldb9VzGu/ph0sMh3x7 HYHZICkuOWE/TmbZC6HPYdDAOGTm2cPTs0kwhPUm13nf6P1Q2ondysd7Sv5lP6pO861z 86GHC3BAz7oZzHkdnCrKD58cqfhP/vmIIcvvDnbOMQKalgX/j7mbhWt7YfiXSYAzCUbD cWVUd4ImRKzJSErrl+fww+fkKk2oWEf0YfOz6sltXBvInkjiSd2ya6Ym7/f+shLayuxd GftiTIUNZOza0JWkWwPACZrRL1j6E58NCJNATjzkrnnlHoXLehkvWx9q0qGHEqrG1VNx h6pQ== 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=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x20si3928197pgx.149.2021.10.28.05.52.39; Thu, 28 Oct 2021 05:53:15 -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=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbhJ1MyK (ORCPT + 99 others); Thu, 28 Oct 2021 08:54:10 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:26201 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbhJ1MyJ (ORCPT ); Thu, 28 Oct 2021 08:54:09 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Hg54n3bHmz8tym for ; Thu, 28 Oct 2021 20:50:17 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 28 Oct 2021 20:51:38 +0800 Received: from [10.174.176.231] (10.174.176.231) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 28 Oct 2021 20:51:38 +0800 To: , CC: , Hewenliang From: Yunfeng Ye Subject: [PATCH] genirq: Use AFFINITY and AFFINITY_LIST in write_irq_affinity() Message-ID: <3edf17ad-e784-f541-1b49-3c95a982d6b5@huawei.com> Date: Thu, 28 Oct 2021 20:51:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.176.231] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 0d3f54257dc3 ("genirq: Introduce effective affinity mask") introduce AFFINITY and AFFINITY_LIST Enumerated Type, so use it in write_irq_affinity(). No functional change. Signed-off-by: Yunfeng Ye --- kernel/irq/proc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index ee595ec09778..423f65203a69 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -147,10 +147,16 @@ static ssize_t write_irq_affinity(int type, struct file *file, if (!zalloc_cpumask_var(&new_value, GFP_KERNEL)) return -ENOMEM; - if (type) + switch (type) { + case AFFINITY_LIST: err = cpumask_parselist_user(buffer, count, new_value); - else + break; + case AFFINITY: err = cpumask_parse_user(buffer, count, new_value); + break; + default: + err = -EINVAL; + } if (err) goto free_cpumask; @@ -179,13 +185,13 @@ static ssize_t write_irq_affinity(int type, struct file *file, static ssize_t irq_affinity_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { - return write_irq_affinity(0, file, buffer, count, pos); + return write_irq_affinity(AFFINITY, file, buffer, count, pos); } static ssize_t irq_affinity_list_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { - return write_irq_affinity(1, file, buffer, count, pos); + return write_irq_affinity(AFFINITY_LIST, file, buffer, count, pos); } static int irq_affinity_proc_open(struct inode *inode, struct file *file) -- 2.27.0