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=unavailable 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 75CFCC433E0 for ; Fri, 15 Jan 2021 08:22:26 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B0CA22583 for ; Fri, 15 Jan 2021 08:22:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B0CA22583 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DHDgf4T0dzDscG for ; Fri, 15 Jan 2021 19:22:22 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.208.54; helo=mail-ed1-f54.google.com; envelope-from=jirislaby@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DHDd05xVDzDsbM for ; Fri, 15 Jan 2021 19:20:00 +1100 (AEDT) Received: by mail-ed1-f54.google.com with SMTP id s11so1277356edd.5 for ; Fri, 15 Jan 2021 00:20:00 -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=WY0S/hzXONrzB2ZcI3RDdejcRLXjFAd7fUzYEH2EefWpNuKyDaZOporbC+Jnj7A09p NQqJiL0bIEZ29RTO7QTxu0AqTzqUcUSzs7oEssrcxjSKwwcc3BLd1gail7da7YlRNTb5 WmiQXmLhuX3GGFgK3xa9fdEUPptqySfZCIzm7nb3w6bEt+W5aOeWcKIRbGbTRuSApCek B7tU+e1WqcdEhuQS+0+0SiSgpj+Mw16r4PXUZ6w00MZmvfC3ENqzmn7lWxHj1aunuATS a4UEBQJ9M1NcOGiBltK2sSIQkmio969scsd+0Z316/tn8nwzF7hB3nCwlGOcvOm3kv3W kouQ== X-Gm-Message-State: AOAM531qSFrfjlF3JXkHipt9N/v90DsxpTYcLnc0xvmZQBhnlVU6q9OQ D1yYb9CLoXKNDN6iGgfWVTg= 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 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S . Miller" , linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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