From patchwork Wed Mar 4 06:39:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Zhe X-Patchwork-Id: 11419359 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12B0F92A for ; Wed, 4 Mar 2020 06:39:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F16EA2146E for ; Wed, 4 Mar 2020 06:39:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726233AbgCDGj5 (ORCPT ); Wed, 4 Mar 2020 01:39:57 -0500 Received: from mail.windriver.com ([147.11.1.11]:62016 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbgCDGj5 (ORCPT ); Wed, 4 Mar 2020 01:39:57 -0500 Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 0246dNZx025717 (version=TLSv1 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 3 Mar 2020 22:39:23 -0800 (PST) Received: from pek-lpg-core2.corp.ad.wrs.com (128.224.153.41) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Tue, 3 Mar 2020 22:39:10 -0800 From: To: , , , , , , , , Subject: [PATCH] x86/mce: Add compat_ioctl assignment to make it compatible with 32-bit system Date: Wed, 4 Mar 2020 14:39:07 +0800 Message-ID: <1583303947-49858-1-git-send-email-zhe.he@windriver.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-edac-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: He Zhe 32-bit user-space program would get errors like the following from ioctl syscall due to missing compat_ioctl. MCE_GET_RECORD_LEN: Inappropriate ioctl for device compat_ptr_ioctl is provided as a generic implementation of .compat_ioctl file operation to ioctl functions that either ignore the argument or pass a pointer to a compatible data type. Signed-off-by: He Zhe Acked-by: Tony Luck --- arch/x86/kernel/cpu/mce/dev-mcelog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/mce/dev-mcelog.c b/arch/x86/kernel/cpu/mce/dev-mcelog.c index 7c8958d..6c9b91b7 100644 --- a/arch/x86/kernel/cpu/mce/dev-mcelog.c +++ b/arch/x86/kernel/cpu/mce/dev-mcelog.c @@ -328,6 +328,7 @@ static const struct file_operations mce_chrdev_ops = { .write = mce_chrdev_write, .poll = mce_chrdev_poll, .unlocked_ioctl = mce_chrdev_ioctl, + .compat_ioctl = compat_ptr_ioctl, .llseek = no_llseek, };