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: 13169574 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 DAAE0C64EC4 for ; Fri, 10 Mar 2023 16:20:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231250AbjCJQUu (ORCPT ); Fri, 10 Mar 2023 11:20:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231337AbjCJQU3 (ORCPT ); Fri, 10 Mar 2023 11:20:29 -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 63BDE11F631 for ; Fri, 10 Mar 2023 08:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464852; 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=HiLz8RGL+eflRy0oMjSqolJYaL4BfShGQRe3yuHs5xF8yd6kkl2ekYfL3V1LA1lUNu2ADr gh1BLci5cRSDTO2cZTLFO4ZPsjM8WN4TEZzyo8SiSNJZL/yZgKZxvS94iHveIU7iA+2WHX Cowej6MNvfbOlts67/LB2dMrpkZus+A= 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-block@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: 13169557 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 1ECCEC6FA99 for ; Fri, 10 Mar 2023 16:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232678AbjCJQRw (ORCPT ); Fri, 10 Mar 2023 11:17:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231569AbjCJQRY (ORCPT ); Fri, 10 Mar 2023 11:17: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 35E12101121 for ; Fri, 10 Mar 2023 08:11:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464684; 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=Xl/Lns0e2ar/kZyDEQcdf7OD+JMulgjsabp02NUAho1spqyq7dqO4Ai+dsfhWcQ0/wDxiA sVZH2KAqWkJBpxCEfjQol++WjMOQIkZbSwhhTRLKyMDPbXIQGRIaKAJqFh4VJC/pzg5h4i CAx+yjXpHMGCElEXRpl+kN4bkwmVZfk= 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-block@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: 13169575 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 A5F7EC6FA99 for ; Fri, 10 Mar 2023 16:21:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbjCJQVC (ORCPT ); Fri, 10 Mar 2023 11:21:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbjCJQUe (ORCPT ); Fri, 10 Mar 2023 11:20:34 -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 D9D33109768 for ; Fri, 10 Mar 2023 08:15:26 -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-block@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: 13169576 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 EE75BC6FA99 for ; Fri, 10 Mar 2023 16:21:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbjCJQVv (ORCPT ); Fri, 10 Mar 2023 11:21:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230373AbjCJQVV (ORCPT ); Fri, 10 Mar 2023 11:21:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A03C80E1E for ; Fri, 10 Mar 2023 08:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464921; 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=ZyEPq0AuIXEVNUrcuv5AmRAs64qvoP1NYelB6yo5pfYQWMrFXBRpvp0V1r+TkLS8BPKW/L z80/QnV4m1jAQ3sDg9UDkIIaoAvpJb8YbocaGeVUC3G2q8Pn1uN52h2c7llyUL7haMefOY uk9c96F1B+nhMmDZKQ28RtF0ZkB3X/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-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-block@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: 13169556 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 D53EAC64EC4 for ; Fri, 10 Mar 2023 16:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231401AbjCJQRp (ORCPT ); Fri, 10 Mar 2023 11:17:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232678AbjCJQRY (ORCPT ); Fri, 10 Mar 2023 11:17:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FC3CFAEF6 for ; Fri, 10 Mar 2023 08:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464684; 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=exa6xlXj2aMYjJ3WCYa8U7yy0k9ks9PUjPu2Dobm7tN/gnsXbDeYHMNVUliazChnAjbbVx LeTvBnj89wEv8B06BFOp67yOC9wBUmqOfVh7aaumzi99tyrcqomYtvsfbrX8gSJC4x2cQg XcgHuQ2XHB5qJxV2b3+QBEExfq5lwPk= 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-block@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