From patchwork Sat Apr 29 20:34:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 88893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1803138vqo; Sat, 29 Apr 2023 14:28:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QIyZhTk9oqvrn6ERZSbAwwbgaHrM7ybqtB9B9Lysci1xCr3tmdFbbT7mq/LxV0tAWA5aV X-Received: by 2002:a17:90a:8d0e:b0:23f:6958:e931 with SMTP id c14-20020a17090a8d0e00b0023f6958e931mr9214151pjo.46.1682803718079; Sat, 29 Apr 2023 14:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682803718; cv=none; d=google.com; s=arc-20160816; b=hbrdVeU9h3pEKcvOnXi+U1uONf+Vwr3Y3F3WgThcEkX6KXwPbM/dzIywYfZC0N6hx6 c+IJKu/CKDIRZhhFIZLIXLAH0OqMO5Lo/YNp3EKJLLkFi6axxfwuwrml7lppVlhZGE5D iwgdkI88SMkihYTl4E1q2Y2gOczj/jRw7hx7h/CXXIwLbSthRffsLdiV7TwXNRH8YWLo yxA6yJe4jku1jM2S+m/3XWPg0GfNVlpn4kgrNJGxOhtFdI/TXE8V2OV7Lb8b0CKGKthG b/pvptoDbkID6wXhwjtSu8LpMgS3Q8GY//RSCqKrATUa75/GxMwCHbNjMIz2CnzHwlwA NocQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=bBFAolVq6YItWumxDQhIQBI3pA0wSNhIkZX1g8wVsLA=; b=EeMuOCsZHKpd2l0rujzK3NoFJfmZQ5LkebkCkEWb6kDAJDMXB5vATidaqQHQP2DY0s 8chxSJLpXCdNaOWn9nXR3D94U4ZeIrD6pbwTyzR/gm+EVFu/CtxrHeOb/z2jre0WMAl4 vByMGVs10RL6Onz8YdSUzsKhK06/0JcvqnYBcK5v7qQCpF+H9csk0zxOxPVrJHPz1iUv /+T3ifyP0g2UKxf1jU/sIInefId7BaVdCmMk49KrVZZSh4km2z7Ui9PKpYiOz69pAz1u vk20D/APKUUyaiYEiKZ7siFBIlnoz64YRPKttKZ/iy+UHwlVPpndBDs8HmKBxqfecgoI 1O/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HgJprMYl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s138-20020a632c90000000b00528c6c71e0dsi3375788pgs.351.2023.04.29.14.28.26; Sat, 29 Apr 2023 14:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HgJprMYl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbjD2Ufe (ORCPT + 99 others); Sat, 29 Apr 2023 16:35:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjD2Ufd (ORCPT ); Sat, 29 Apr 2023 16:35:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27DFC10E5 for ; Sat, 29 Apr 2023 13:35:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A8FD560EDE for ; Sat, 29 Apr 2023 20:35:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E8ACC433EF; Sat, 29 Apr 2023 20:35:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682800531; bh=pqdkn51QhwGmoLD6P4ZiJu49T/u+1bdaUjXi3014pjo=; h=From:To:Cc:Subject:Date:From; b=HgJprMYlBdRmLffAD8hB6CIIYmBIbkl6cSCr5/nlUQJZSbhww3nFibTlECwFp1s2+ iTiUFWTps7qGnvO0t4KTh28nbWNiclYGOUCOErcYbhw3RFUbRCB662N1YB7p1dk3bV k43imjaYj48C7GFnXRTcVUZX9IgufZTjW8sUxzAiJVoWmoJJ0xbxZhuU84LU3991u6 X2dzp9JQuT0oeFJnpd2qebK8v082T2ZlngKfgEVcIbHAKiF/GTIOa5HnbPxUdM+lYm rK0q4RbYn6Bsucd1z8m+trWwM1OI2GrgjnubKzj3s6zYecpN2w3fCfLQBpnHpeztBd BO73+00GgZ7zA== From: Arnd Bergmann To: Greg Kroah-Hartman , Jiri Slaby , Andrew Morton , Tetsuo Handa Cc: Arnd Bergmann , Petr Mladek , linux-kernel@vger.kernel.org Subject: [PATCH] tty: remove duplicate hung_up_tty_compat_ioctl() Date: Sat, 29 Apr 2023 22:34:31 +0200 Message-Id: <20230429203523.538756-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764547591098620539?= X-GMAIL-MSGID: =?utf-8?q?1764547591098620539?= From: Arnd Bergmann The hung_up_tty_compat_ioctl() has been identical to hung_up_tty_ioctl() for a very long time, but now the only caller is inside of an #ifdef, causing a harmless warning: drivers/tty/tty_io.c:446:13: error: 'hung_up_tty_compat_ioctl' defined but not used [-Werror=unused-function] 446 | static long hung_up_tty_compat_ioctl(struct file *file, Avoid this by removing the function entirely and just using the native one in its place. Fixes: 04f378b198da ("tty: BKL pushdown") Fixes: 4c87e9e5479b ("tty: tty_io: remove hung_up_tty_fops") Link: https://lore.kernel.org/all/2a07bded-25e5-fd27-a2de-8b606e4d1d2c@I-love.SAKURA.ne.jp/ Signed-off-by: Arnd Bergmann Reviewed-by: Jiri Slaby --- I did this patch to fix the build failure locally before I saw it was already under discussion. Sending it anyway in case nobody else has done a formal fix yet. --- drivers/tty/tty_io.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 553182753098..31d465279b6c 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -443,12 +443,6 @@ static long hung_up_tty_ioctl(struct file *file, unsigned int cmd, return cmd == TIOCSPGRP ? -ENOTTY : -EIO; } -static long hung_up_tty_compat_ioctl(struct file *file, - unsigned int cmd, unsigned long arg) -{ - return cmd == TIOCSPGRP ? -ENOTTY : -EIO; -} - static int hung_up_tty_fasync(int fd, struct file *file, int on) { return -ENOTTY; @@ -2941,7 +2935,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd, } if (tty_hung_up_p(file)) - return hung_up_tty_compat_ioctl(file, cmd, arg); + return hung_up_tty_ioctl(file, cmd, arg); if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl")) return -EINVAL; @@ -2959,7 +2953,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd, ld = tty_ldisc_ref_wait(tty); if (!ld) - return hung_up_tty_compat_ioctl(file, cmd, arg); + return hung_up_tty_ioctl(file, cmd, arg); if (ld->ops->compat_ioctl) retval = ld->ops->compat_ioctl(tty, cmd, arg); if (retval == -ENOIOCTLCMD && ld->ops->ioctl)