From patchwork Tue Jun 23 19:57:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 223301 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.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 AD31DC433DF for ; Tue, 23 Jun 2020 21:02:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D9A220663 for ; Tue, 23 Jun 2020 21:02:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592946167; bh=HEzglXm+5tcsLluMZXsqOjSt5kj4dDPLcECP1cMixxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EM8RqIEvb2/lUeMpiwi5DI3aHzqeWDRmyRIZqogwoNuC1hce9mNQfGZ4DHjG2qGJO DW/Vr4oML8IskF0T1dgze07iWqQkRXIOs6WBotLfJzNKQLva/pjibVMlua2ayUpypV gvdAHm1ty1H3pF/qXw+92Z2jn1vhKXwmsK6VnNV8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390012AbgFWUjC (ORCPT ); Tue, 23 Jun 2020 16:39:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:34584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391697AbgFWUjA (ORCPT ); Tue, 23 Jun 2020 16:39:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA9DD217BA; Tue, 23 Jun 2020 20:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944740; bh=HEzglXm+5tcsLluMZXsqOjSt5kj4dDPLcECP1cMixxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aA07cUcNmctpOtPj+tgpCBWWdu0CYrwIF8awhFb8y2mCKBrSNMVv8MrUBtfc+UfZ8 AvYFpcnbt+Q+V6kZf5qcx2p4lTBStqvFZXPNuMI2HwiqM3CuVcCOdzvwKLzB9RWs6a IQ7aJHoxEQUYM9YPMcX9AxDuh3Kkdzf0zgU9S/Rk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , kbuild test robot , Nathan Chancellor , Felipe Balbi , Sasha Levin Subject: [PATCH 4.19 107/206] USB: gadget: udc: s3c2410_udc: Remove pointless NULL check in s3c2410_udc_nuke Date: Tue, 23 Jun 2020 21:57:15 +0200 Message-Id: <20200623195322.203197323@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195316.864547658@linuxfoundation.org> References: <20200623195316.864547658@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nathan Chancellor [ Upstream commit 7a0fbcf7c308920bc6116b3a5fb21c8cc5fec128 ] Clang warns: drivers/usb/gadget/udc/s3c2410_udc.c:255:11: warning: comparison of address of 'ep->queue' equal to a null pointer is always false [-Wtautological-pointer-compare] if (&ep->queue == NULL) ~~~~^~~~~ ~~~~ 1 warning generated. It is not wrong, queue is not a pointer so if ep is not NULL, the address of queue cannot be NULL. No other driver does a check like this and this check has been around since the driver was first introduced, presumably with no issues so it does not seem like this check should be something else. Just remove it. Commit afe956c577b2d ("kbuild: Enable -Wtautological-compare") exposed this but it is not the root cause of the warning. Fixes: 3fc154b6b8134 ("USB Gadget driver for Samsung s3c2410 ARM SoC") Link: https://github.com/ClangBuiltLinux/linux/issues/1004 Reviewed-by: Nick Desaulniers Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/s3c2410_udc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index 8bf5ad7a59add..6cc63e317aba5 100644 --- a/drivers/usb/gadget/udc/s3c2410_udc.c +++ b/drivers/usb/gadget/udc/s3c2410_udc.c @@ -264,10 +264,6 @@ static void s3c2410_udc_done(struct s3c2410_ep *ep, static void s3c2410_udc_nuke(struct s3c2410_udc *udc, struct s3c2410_ep *ep, int status) { - /* Sanity check */ - if (&ep->queue == NULL) - return; - while (!list_empty(&ep->queue)) { struct s3c2410_request *req; req = list_entry(ep->queue.next, struct s3c2410_request,