From patchwork Fri Mar 10 16:07:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 13169552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 125DFC6FD1F for ; Fri, 10 Mar 2023 16:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231514AbjCJQNw (ORCPT ); Fri, 10 Mar 2023 11:13:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbjCJQM0 (ORCPT ); Fri, 10 Mar 2023 11:12:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D41494EDA for ; Fri, 10 Mar 2023 08:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=muvL1GJq5JhedIkX9pwejhGqATSkcNKw4maG4yGCMnc=; b=QcUhp13Opl6D8/0auRQFkkffn/3BFLwsDfsTsmkTD+uDJkM2MPqOwbY2HyfDZCvIqSCxsx uDc3agJLhecWWLr0I8rkk+FuUeRRQq0bk07O+qZ94KoiiXWt/IsPL+VK5FMylya+3Giw7u qD6cCbI0iuB6LBY+wmwdWui3ecPpG+8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-195-hRpnpB05NIajyxA6Omlh5Q-1; Fri, 10 Mar 2023 11:08:05 -0500 X-MC-Unique: hRpnpB05NIajyxA6Omlh5Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 65E091C0758F; Fri, 10 Mar 2023 16:08:04 +0000 (UTC) Received: from thuth.com (unknown [10.45.224.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69892492B00; Fri, 10 Mar 2023 16:08:02 +0000 (UTC) From: Thomas Huth To: linux-kernel@vger.kernel.org, Arnd Bergmann Cc: linux-arch@vger.kernel.org, Chas Williams <3chas3@gmail.com>, Palmer Dabbelt , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, Christoph Hellwig Subject: [PATCH v2 1/5] Move COMPAT_ATM_ADDPARTY to net/atm/svc.c Date: Fri, 10 Mar 2023 17:07:53 +0100 Message-Id: <20230310160757.199253-2-thuth@redhat.com> In-Reply-To: <20230310160757.199253-1-thuth@redhat.com> References: <20230310160757.199253-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Palmer Dabbelt This used to be behind an #ifdef COMPAT_COMPAT, so most of userspace wouldn't have seen the definition before. Unfortunately this header file became visible to userspace, so the definition has instead been moved to net/atm/svc.c (the only user). Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou Message-Id: <1447119071-19392-4-git-send-email-palmer@dabbelt.com> Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: Thomas Huth --- include/uapi/linux/atmdev.h | 4 ---- net/atm/svc.c | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/atmdev.h b/include/uapi/linux/atmdev.h index a5c15cf23bd7..20b0215084fc 100644 --- a/include/uapi/linux/atmdev.h +++ b/include/uapi/linux/atmdev.h @@ -101,10 +101,6 @@ struct atm_dev_stats { /* use backend to make new if */ #define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf) /* add party to p2mp call */ -#ifdef CONFIG_COMPAT -/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */ -#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf) -#endif #define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int) /* drop party from p2mp call */ diff --git a/net/atm/svc.c b/net/atm/svc.c index 4a02bcaad279..d83556d8beb9 100644 --- a/net/atm/svc.c +++ b/net/atm/svc.c @@ -28,6 +28,11 @@ #include "signaling.h" #include "addr.h" +#ifdef CONFIG_COMPAT +/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */ +#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL + 4, struct compat_atm_iobuf) +#endif + static int svc_create(struct net *net, struct socket *sock, int protocol, int kern); From patchwork Fri Mar 10 16:07:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 13169554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25150C64EC4 for ; Fri, 10 Mar 2023 16:18:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232228AbjCJQSN (ORCPT ); Fri, 10 Mar 2023 11:18:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232666AbjCJQRw (ORCPT ); Fri, 10 Mar 2023 11:17:52 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688DB10A4DA for ; Fri, 10 Mar 2023 08:12:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=//zLnPtP7ffouA+rSDdqgf7g3qQX7GQTNEvg0EWo8xg=; b=PJ27e1S6gKwnz6ZHyQ8PE6ZQIwvzVhNlzsjdZF6m+UFxfzk5RM0gfFFl9v6dTfjMVFr5/x E02ixqGYYZrA+x0gmgeybEqhQWOU4KrqkdcILwnyM3HeYUQRfQxmfqnY2OqO3g4LHFUpjf K54uxCOZGzOjX4l1YnMzh7ogO/ajPGg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-323-afljF5ZuNkeaMFMQAyeZBQ-1; Fri, 10 Mar 2023 11:08:08 -0500 X-MC-Unique: afljF5ZuNkeaMFMQAyeZBQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 97EDA80418A; Fri, 10 Mar 2023 16:08:06 +0000 (UTC) Received: from thuth.com (unknown [10.45.224.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB616492C3E; Fri, 10 Mar 2023 16:08:04 +0000 (UTC) From: Thomas Huth To: linux-kernel@vger.kernel.org, Arnd Bergmann Cc: linux-arch@vger.kernel.org, Chas Williams <3chas3@gmail.com>, Palmer Dabbelt , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, Christoph Hellwig Subject: [PATCH v2 2/5] Move ep_take_care_of_epollwakeup() to fs/eventpoll.c Date: Fri, 10 Mar 2023 17:07:54 +0100 Message-Id: <20230310160757.199253-3-thuth@redhat.com> In-Reply-To: <20230310160757.199253-1-thuth@redhat.com> References: <20230310160757.199253-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Palmer Dabbelt This doesn't make any sense to expose to userspace, so it's been moved to the one user. This was introduced by commit 95f19f658ce1 ("epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled"). Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou Message-Id: <1447119071-19392-7-git-send-email-palmer@dabbelt.com> [thuth: Rebased to fix contextual conflicts] Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: Thomas Huth --- fs/eventpoll.c | 13 +++++++++++++ include/uapi/linux/eventpoll.h | 12 ------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 64659b110973..e2a5d2cc9051 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -2042,6 +2042,19 @@ SYSCALL_DEFINE1(epoll_create, int, size) return do_epoll_create(0); } +#ifdef CONFIG_PM_SLEEP +static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) +{ + if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) + epev->events &= ~EPOLLWAKEUP; +} +#else +static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) +{ + epev->events &= ~EPOLLWAKEUP; +} +#endif + static inline int epoll_mutex_lock(struct mutex *mutex, int depth, bool nonblock) { diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h index e687658843b1..cfbcc4cc49ac 100644 --- a/include/uapi/linux/eventpoll.h +++ b/include/uapi/linux/eventpoll.h @@ -85,16 +85,4 @@ struct epoll_event { __u64 data; } EPOLL_PACKED; -#ifdef CONFIG_PM_SLEEP -static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) -{ - if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) - epev->events &= ~EPOLLWAKEUP; -} -#else -static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) -{ - epev->events &= ~EPOLLWAKEUP; -} -#endif #endif /* _UAPI_LINUX_EVENTPOLL_H */ From patchwork Fri Mar 10 16:07:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 13169573 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E1E8C6FA99 for ; Fri, 10 Mar 2023 16:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231559AbjCJQVG (ORCPT ); Fri, 10 Mar 2023 11:21:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231597AbjCJQUj (ORCPT ); Fri, 10 Mar 2023 11:20:39 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5542062DBC for ; Fri, 10 Mar 2023 08:15:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6woSO0hLQ5AOX8ml8J8Kv2DAmsiAIUA/7xq1WhwbYPM=; b=HXdk6ZYDBSbeQnXa3yITnN8j/riy/cTiVn+WL+aQW+SIGzzoRdu3x437Oy3hZu6up0nBoX gZv4cH6wLb4RD79htKtjBiGU1xeAazI9dB6Nk4kU5SaTPqkIwi8BacywqVrzSvTiQpXgTv XvgK4ouWlH8Xghz5xj8SeVvIMTBSUgU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-47-HSShDvcENL6mqIOrmek3JA-1; Fri, 10 Mar 2023 11:08:14 -0500 X-MC-Unique: HSShDvcENL6mqIOrmek3JA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A2559882824; Fri, 10 Mar 2023 16:08:08 +0000 (UTC) Received: from thuth.com (unknown [10.45.224.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6A5F492B00; Fri, 10 Mar 2023 16:08:06 +0000 (UTC) From: Thomas Huth To: linux-kernel@vger.kernel.org, Arnd Bergmann Cc: linux-arch@vger.kernel.org, Chas Williams <3chas3@gmail.com>, Palmer Dabbelt , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, Christoph Hellwig Subject: [PATCH v2 3/5] Move bp_type_idx to include/linux/hw_breakpoint.h Date: Fri, 10 Mar 2023 17:07:55 +0100 Message-Id: <20230310160757.199253-4-thuth@redhat.com> In-Reply-To: <20230310160757.199253-1-thuth@redhat.com> References: <20230310160757.199253-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Palmer Dabbelt This has a "#ifdef CONFIG_*" that used to be exposed to userspace. The names in here are so generic that I don't think it's a good idea to expose them to userspace (or even the rest of the kernel). There are multiple in-kernel users, so it's been moved to a kernel header file. Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou Message-Id: <1447119071-19392-10-git-send-email-palmer@dabbelt.com> [thuth: Remove it also from tools/include/uapi/linux/hw_breakpoint.h] Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: Thomas Huth --- include/linux/hw_breakpoint.h | 10 ++++++++++ include/uapi/linux/hw_breakpoint.h | 10 ---------- tools/include/uapi/linux/hw_breakpoint.h | 10 ---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index f319bd26b030..7fbb45911273 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h @@ -7,6 +7,16 @@ #ifdef CONFIG_HAVE_HW_BREAKPOINT +enum bp_type_idx { + TYPE_INST = 0, +#if defined(CONFIG_HAVE_MIXED_BREAKPOINTS_REGS) + TYPE_DATA = 0, +#else + TYPE_DATA = 1, +#endif + TYPE_MAX +}; + extern int __init init_hw_breakpoint(void); static inline void hw_breakpoint_init(struct perf_event_attr *attr) diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h index 965e4d8606d8..1575d3ca6f0d 100644 --- a/include/uapi/linux/hw_breakpoint.h +++ b/include/uapi/linux/hw_breakpoint.h @@ -22,14 +22,4 @@ enum { HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, }; -enum bp_type_idx { - TYPE_INST = 0, -#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS - TYPE_DATA = 0, -#else - TYPE_DATA = 1, -#endif - TYPE_MAX -}; - #endif /* _UAPI_LINUX_HW_BREAKPOINT_H */ diff --git a/tools/include/uapi/linux/hw_breakpoint.h b/tools/include/uapi/linux/hw_breakpoint.h index 965e4d8606d8..1575d3ca6f0d 100644 --- a/tools/include/uapi/linux/hw_breakpoint.h +++ b/tools/include/uapi/linux/hw_breakpoint.h @@ -22,14 +22,4 @@ enum { HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, }; -enum bp_type_idx { - TYPE_INST = 0, -#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS - TYPE_DATA = 0, -#else - TYPE_DATA = 1, -#endif - TYPE_MAX -}; - #endif /* _UAPI_LINUX_HW_BREAKPOINT_H */ From patchwork Fri Mar 10 16:07:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 13169553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A29CDC64EC4 for ; Fri, 10 Mar 2023 16:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230453AbjCJQOk (ORCPT ); Fri, 10 Mar 2023 11:14:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232132AbjCJQMj (ORCPT ); Fri, 10 Mar 2023 11:12:39 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9402711AC99 for ; Fri, 10 Mar 2023 08:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uORM3Xhzjyx5pSXtVFHzrrBAkab8IB4YL2yYQbG2PCU=; b=FTBxhIguSgn+TKySI5zaQO/3JHPnwOdWJqeKwKdumpp9qQPeX9P05EOIsha/s7hcHDbXJV ABCXtg4McBr9Y0lJYGcxP7q2i82aOe7ErgosXi9vu+481icG1mhAofZ+WM1dNUBiLaX3kR vJ+xBXyDGC6jHZcSYlMyR3vbjh5dLNg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-vhIr2a09NJ-Bi14QG2KogA-1; Fri, 10 Mar 2023 11:08:11 -0500 X-MC-Unique: vhIr2a09NJ-Bi14QG2KogA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 00B1938041DD; Fri, 10 Mar 2023 16:08:11 +0000 (UTC) Received: from thuth.com (unknown [10.45.224.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE54C492C3E; Fri, 10 Mar 2023 16:08:08 +0000 (UTC) From: Thomas Huth To: linux-kernel@vger.kernel.org, Arnd Bergmann Cc: linux-arch@vger.kernel.org, Chas Williams <3chas3@gmail.com>, Palmer Dabbelt , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, Christoph Hellwig Subject: [PATCH v2 4/5] pktcdvd: Remove CONFIG_CDROM_PKTCDVD_WCACHE from uapi header Date: Fri, 10 Mar 2023 17:07:56 +0100 Message-Id: <20230310160757.199253-5-thuth@redhat.com> In-Reply-To: <20230310160757.199253-1-thuth@redhat.com> References: <20230310160757.199253-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org CONFIG_* switches should not be exposed in uapi headers, thus let's get rid of the USE_WCACHING macro here (which was also named way to generic) and integrate the logic directly in the only function that needs it. Suggested-by: Christoph Hellwig Signed-off-by: Thomas Huth Reviewed-by: Christoph Hellwig --- drivers/block/pktcdvd.c | 13 +++++++++---- include/uapi/linux/pktcdvd.h | 11 ----------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 2f1a92509271..5ae2a80db2c3 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -1869,12 +1869,12 @@ static noinline_for_stack int pkt_probe_settings(struct pktcdvd_device *pd) /* * enable/disable write caching on drive */ -static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd, - int set) +static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd) { struct packet_command cgc; struct scsi_sense_hdr sshdr; unsigned char buf[64]; + bool set = IS_ENABLED(CONFIG_CDROM_PKTCDVD_WCACHE); int ret; init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ); @@ -1890,7 +1890,12 @@ static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd, if (ret) return ret; - buf[pd->mode_offset + 10] |= (!!set << 2); + /* + * use drive write caching -- we need deferred error handling to be + * able to successfully recover with this option (drive will return good + * status as soon as the cdb is validated). + */ + buf[pd->mode_offset + 10] |= (set << 2); cgc.buflen = cgc.cmd[8] = 2 + ((buf[0] << 8) | (buf[1] & 0xff)); ret = pkt_mode_select(pd, &cgc); @@ -2085,7 +2090,7 @@ static int pkt_open_write(struct pktcdvd_device *pd) return -EIO; } - pkt_write_caching(pd, USE_WCACHING); + pkt_write_caching(pd); ret = pkt_get_max_speed(pd, &write_speed); if (ret) diff --git a/include/uapi/linux/pktcdvd.h b/include/uapi/linux/pktcdvd.h index 9cbb55d21c94..6a5552dfd6af 100644 --- a/include/uapi/linux/pktcdvd.h +++ b/include/uapi/linux/pktcdvd.h @@ -29,17 +29,6 @@ */ #define PACKET_WAIT_TIME (HZ * 5 / 1000) -/* - * use drive write caching -- we need deferred error handling to be - * able to successfully recover with this option (drive will return good - * status as soon as the cdb is validated). - */ -#if defined(CONFIG_CDROM_PKTCDVD_WCACHE) -#define USE_WCACHING 1 -#else -#define USE_WCACHING 0 -#endif - /* * No user-servicable parts beyond this point -> */ From patchwork Fri Mar 10 16:07:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 13169551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C13DEC6FA99 for ; Fri, 10 Mar 2023 16:13:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231446AbjCJQNt (ORCPT ); Fri, 10 Mar 2023 11:13:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231589AbjCJQMY (ORCPT ); Fri, 10 Mar 2023 11:12:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95C0118805 for ; Fri, 10 Mar 2023 08:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VF7DOSFSoxperMCR1c0beoAVNr9jhMKzR2GYQ6m9DTA=; b=U9UsDKvfKK8N2ZGaAnBBx6XfqO21mihzI/QhWrERLr3ekDVQioNxdX6rHc6XEYT0B6xMZv ZsFlbTYKLufGWX0A8RasQf7H0/V5HlGBzPgBaLt9q57t6RkHupQZSKQULZ+iagM3OhQQQC 1BIWXz2nJoqR63M20xj9UTkP8/DUvN4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-0nmZr2faN_Ob6cqxJso-SQ-1; Fri, 10 Mar 2023 11:08:14 -0500 X-MC-Unique: 0nmZr2faN_Ob6cqxJso-SQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 612A3185A794; Fri, 10 Mar 2023 16:08:13 +0000 (UTC) Received: from thuth.com (unknown [10.45.224.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C0A2492C3E; Fri, 10 Mar 2023 16:08:11 +0000 (UTC) From: Thomas Huth To: linux-kernel@vger.kernel.org, Arnd Bergmann Cc: linux-arch@vger.kernel.org, Chas Williams <3chas3@gmail.com>, Palmer Dabbelt , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, Christoph Hellwig Subject: [PATCH v2 5/5] scripts: Update the CONFIG_* ignore list in headers_install.sh Date: Fri, 10 Mar 2023 17:07:57 +0100 Message-Id: <20230310160757.199253-6-thuth@redhat.com> In-Reply-To: <20230310160757.199253-1-thuth@redhat.com> References: <20230310160757.199253-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The file in include/uapi/linux/ have been cleaned in the previous patches, so we can now remove these entries from the CONFIG_* ignore-list. Signed-off-by: Thomas Huth --- scripts/headers_install.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 4041881746ad..36b56b746fce 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -83,10 +83,6 @@ arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64 arch/x86/include/uapi/asm/mman.h:CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS -include/uapi/linux/atmdev.h:CONFIG_COMPAT -include/uapi/linux/eventpoll.h:CONFIG_PM_SLEEP -include/uapi/linux/hw_breakpoint.h:CONFIG_HAVE_MIXED_BREAKPOINTS_REGS -include/uapi/linux/pktcdvd.h:CONFIG_CDROM_PKTCDVD_WCACHE " for c in $configs