Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1180809ybc; Tue, 19 Nov 2019 16:09:18 -0800 (PST) X-Google-Smtp-Source: APXvYqze2HU5wSDPq84o5ueXA3ilaUfPBg8zWax7b9Eba93ZJ6EuJpxlHUVGpYsEtuQPloI2YIUg X-Received: by 2002:a17:906:f108:: with SMTP id gv8mr793554ejb.180.1574208558558; Tue, 19 Nov 2019 16:09:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574208558; cv=none; d=google.com; s=arc-20160816; b=XpYDyQqI0CZxpNBMXUn/bZmVbExzkvDGN6xl1u+gpM+mCaAxmUHV8z0KgqVfaNgbIC TPsZzmdGEpX1g8kCz5pe2Lnkx9O/gBy9MFytEBBs4j9b3ftr0NqmOheiEWO1wAXf4vWN mmj7s5qsnRXRYbWd6UvjDNcaxuRoCbYefyV8GhxnmqqMvuO0yyQK04aODWpv+IXIZDi7 CkT0Ty/kZkHXEEz+l1IfUw22HgDz7YaSov042kaxEjFnEmWOxTsdVrJXSE5lgc7092gR DcM0QPbjLZw2doqMOqkpkguFAeuJ4C21gvh966s4zABK4q/pO3eQ58RSqgySiRvIJXNH WqdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ik8rk03crFyahf/9pU+JDhTvTOC4x5NhvlmDbsWHqLk=; b=CVeopKmy8YBd6v2yX4awyYgihzlIeGQDNK8oBtB4ATQ6cXP34Ke66cku7Xu/fHYCaB lMle0s3WcoGeN8t7Ere3Yr8pOmt3GTgGlyK60rshgkTPGwYGk4D2hzbWeNlJDNBh1ZUI SLjobNu63oyNlEvDFPMijaXg+Vm2INzvduUr3y74bHXKHqnAsvUZqkO3XohHMWrFw2Ye QUph3YquLOEFrAuVxC75JB7EVj8iM/LvhVf/Y6UFq9/H5ay4DA82vo/cdnzVt+DJ2mle NgW243Er7opsJC7JXTok+rG4oDn1PDhPmud9aWt5vjD0WFfeVDY38jZp8N2FB3lQlVlA 7kVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=caOSAp4W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k14si14184092eji.255.2019.11.19.16.08.53; Tue, 19 Nov 2019 16:09:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=caOSAp4W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727399AbfKTAHg (ORCPT + 99 others); Tue, 19 Nov 2019 19:07:36 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40231 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726911AbfKTAHg (ORCPT ); Tue, 19 Nov 2019 19:07:36 -0500 Received: by mail-wr1-f68.google.com with SMTP id q15so13207508wrw.7 for ; Tue, 19 Nov 2019 16:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ik8rk03crFyahf/9pU+JDhTvTOC4x5NhvlmDbsWHqLk=; b=caOSAp4WSvmjNweZRfAqZzLt8e9VFF7PFHBtlFFsDN6yakR5Tzs00KQWgXk8RM7NTp f6vlHkYF1bV0nY5mD0ui3Rz/IP6tdTHlkO9eSqBWvNXOqo1pOiLli/S8sP66l39qJAGw QG956jjfcs+s4WIODhjl8FM+VXsa/3O1WRErCRDqYQ/zxJ+O4ecuo6nfkO2WuALY4CsH y07VRxTRlT5HbP3LQHh9TpKFelQwVUp/H6y2q6nbbxtOF/kyC+oz+cfrGm9X4u+dlxJx GhWK+9IhVdIG1QeZj9Tdhizm4Q987DhOSZgR/GE/OY7oLkUGMPVvBxAhlXSh80k83P6O SpDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ik8rk03crFyahf/9pU+JDhTvTOC4x5NhvlmDbsWHqLk=; b=DkbW887NIx742gNlf3CG+MMU68G2WOIuYZ62UkosjT9CTUzEyaef4m50UGN5iNXq8W JJcCfx6NQmA/cey2prug9qNCH0iiPdvuXagLaB3xo8PeJzVGE8x7Gim1M2/41HWiC6nL BPdOjYSjHrKh7+CNFIkrYrluxBIBuJSXf+cx0lV70CUAl8bYR+cEx4qUr6eA5XtmwhLl P1CTGnCwd7wkfbg7D01xGUS8Ety68r3pJ3kc0VBMYB2CNZmHr1DL6QwZO5L62JN6XaWn bPrl0GPJ1KPLjlgkJpgCCjuqZ0bQAEydngGSTk58QHV2Y3O8ZWcX5Pn/0LVSdAw0mi7m tnWw== X-Gm-Message-State: APjAAAXAUNKhl4L4XSIxToP0OVKM7UqENoScBpico3WSfqEUNSBlt8O6 oO3UkrNq5eZyrFxL3IV2XGHYMRk9 X-Received: by 2002:a5d:6746:: with SMTP id l6mr83214wrw.349.1574208452402; Tue, 19 Nov 2019 16:07:32 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:40e1:9900:5dce:1599:e3b5:7d61]) by smtp.gmail.com with ESMTPSA id r2sm29424197wrp.64.2019.11.19.16.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 16:07:31 -0800 (PST) From: Luc Van Oostenryck To: linux-kernel@vger.kernel.org Cc: Luc Van Oostenryck , Joel Fernandes , Christian Brauner Subject: [PATCH] fork: fix pidfd_poll()'s return type Date: Wed, 20 Nov 2019 01:07:22 +0100 Message-Id: <20191120000722.30605-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pidfd_poll() is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type. Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for __poll_t. CC: Joel Fernandes (Google) CC: Christian Brauner Signed-off-by: Luc Van Oostenryck --- kernel/fork.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 55af6931c6ec..13b38794efb5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1708,11 +1708,11 @@ static void pidfd_show_fdinfo(struct seq_file *m, struct file *f) /* * Poll support for process exit notification. */ -static unsigned int pidfd_poll(struct file *file, struct poll_table_struct *pts) +static __poll_t pidfd_poll(struct file *file, struct poll_table_struct *pts) { struct task_struct *task; struct pid *pid = file->private_data; - int poll_flags = 0; + __poll_t poll_flags = 0; poll_wait(file, &pid->wait_pidfd, pts); @@ -1724,7 +1724,7 @@ static unsigned int pidfd_poll(struct file *file, struct poll_table_struct *pts) * group, then poll(2) should block, similar to the wait(2) family. */ if (!task || (task->exit_state && thread_group_empty(task))) - poll_flags = POLLIN | POLLRDNORM; + poll_flags = EPOLLIN | EPOLLRDNORM; rcu_read_unlock(); return poll_flags; -- 2.24.0