From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45DD6C433E0 for ; Fri, 15 Jan 2021 08:20:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F33F922473 for ; Fri, 15 Jan 2021 08:20:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729997AbhAOIUk (ORCPT ); Fri, 15 Jan 2021 03:20:40 -0500 Received: from mail-ed1-f42.google.com ([209.85.208.42]:42032 "EHLO mail-ed1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726375AbhAOIUj (ORCPT ); Fri, 15 Jan 2021 03:20:39 -0500 Received: by mail-ed1-f42.google.com with SMTP id g24so8558862edw.9; Fri, 15 Jan 2021 00:20:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=q3u1c2cmK2DITir507fdDBtH+U4eOB5jtHbxWlFMVtQ=; b=Gt/X1UBjEnHrwfM3FEGFdLiI73n0tEwFQ5JjbI6GUWsSaUeGJ1S6EwmDWVTKjNyWLN J1/vK8UwpD1CLrPHJ1WZ25Nk6dHwxajYBq8Na2shP6uFdNrv9DSKHWt2uCiDZLws1FTj 5P+z9ZDBcWZsYFOeSU/zJZS9W3HTmLNHTNgRsL9Ow76tPs3iQII8bvt0yFpPDFPwAAQs PGX9+vvK93EoQuTwXtxsyPXr6ECXGT4SniRlabctI7hCpqB6ZnLQ4nf+vo1HBH35qRgz kQEFg0boJ3h7IZIrN7V/a4EH1WaAb2dQFUej6fMfFfAkRCbcJ8GBOKMBonPJx9Jdp5Ro Ehjg== X-Gm-Message-State: AOAM530/nSnu8PyrMNtKnDyGoWgk+rsHV6Sxyqy/V6nUUNRxMqLYg1sQ gkLPt3HzRD6/gk1wVR3DXLdtmMpluOI= X-Google-Smtp-Source: ABdhPJwWBbtrNN8Dt/03jdN8TWPQGNvz2cTqSx6WvSbbavMAhwqQ7OozTqX2J4z2mqMcfAOpbO1pBg== X-Received: by 2002:aa7:d2d4:: with SMTP id k20mr6782073edr.361.1610698796929; Fri, 15 Jan 2021 00:19:56 -0800 (PST) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id o20sm2929393ejb.123.2021.01.15.00.19.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Jan 2021 00:19:56 -0800 (PST) Subject: Re: [PATCH 1/3] tty: hvcs: Drop unnecessary if block To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Greg Kroah-Hartman Cc: "David S . Miller" , linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210114175718.137483-1-u.kleine-koenig@pengutronix.de> <20210114175718.137483-2-u.kleine-koenig@pengutronix.de> From: Jiri Slaby Message-ID: <1afca17b-f148-4412-c80f-6168e79fd2ac@kernel.org> Date: Fri, 15 Jan 2021 09:19:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210114175718.137483-2-u.kleine-koenig@pengutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14. 01. 21, 18:57, Uwe Kleine-König wrote: > If hvcs_probe() succeeded dev_set_drvdata() is called with a non-NULL > value, and if hvcs_probe() failed hvcs_remove() isn't called. > > So there is no way dev_get_drvdata() can return NULL in hvcs_remove() and > the check can just go away. > > Signed-off-by: Uwe Kleine-König Reviewed-by: Jiri Slaby > --- > drivers/tty/hvc/hvcs.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c > index 509d1042825a..3e0461285c34 100644 > --- a/drivers/tty/hvc/hvcs.c > +++ b/drivers/tty/hvc/hvcs.c > @@ -825,9 +825,6 @@ static int hvcs_remove(struct vio_dev *dev) > unsigned long flags; > struct tty_struct *tty; > > - if (!hvcsd) > - return -ENODEV; > - > /* By this time the vty-server won't be getting any more interrupts */ > > spin_lock_irqsave(&hvcsd->lock, flags); > -- js