From patchwork Wed Apr 24 11:43:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13641763 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00508C4345F for ; Wed, 24 Apr 2024 11:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6Nce+u/5kVjP2Fj5UEMeTBUKawQf9UCgNJl6Y4IasjM=; b=2EKftSQucJKL2B BB0k+fmr9Zu68qqV3V4bvCgfXZshRKbfBhN+2AU4JEWxdicBXr0DnSWRl1MwUblM69ymUHH0fXKA1 FMvHZfUAkY2j1HhamwAvhslh9WT0yptopVKSkvwZRrxQVFc5W2EOEPTlOzH5Qxu/e9GQFaT4j/CxH zfSyLEgpNErNYofUKW+dO+4AXJZ1WvqdDqpeng8aQY6LwutrV09/2JGEnjA0UbupBbwuC2AupEVe2 CF/smg5Qwjz+faNex7MPiRnMuE/3n6lq2+mmZzX6NvSE7yeCzOJBvsxAWSdaxZW5ejV5llIcYeY4E qRTF/5lMJ6Jp925cDI5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzb2K-00000003waf-2YW5; Wed, 24 Apr 2024 11:43:40 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzb2F-00000003wXw-37vD for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2024 11:43:38 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-349545c3eb8so4925335f8f.2 for ; Wed, 24 Apr 2024 04:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713959013; x=1714563813; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=enk6u0NWo+HjAlsfAsaG/0BOtgb+vI9MCBxWfkbUG6A=; b=C2dcElR0ghwx/VoRnxK0I5a4Z+4iZZSCSTv2L+YECrchGBeyI5WhLVo3Q6+BJYR3R6 ql/icl6Oqe11oRgsJ3j51sykU2awI/iTFjiAEC5yipOsdAYxyX1CCRWkhQrskaFRz/w8 oJZsxb79hc8K6KCBzvijlDQWO1rTsxPvwOkx7fY912QOeGtVz9hVXmnApiZutXe3VoPK pqSnaAJrx40MqRx/vFOJenRTk23EYtXAsl1ygF0xqiJFvPuAZ4nq9tDXmUbCfG36k4Mc PN6X6CjsLF6Gs4rDiQCSxHCSNIu3ur9Mi8MwUpBXN/i8ihq9QytTg81+6hu/fgWTQ4mB WMsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713959013; x=1714563813; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=enk6u0NWo+HjAlsfAsaG/0BOtgb+vI9MCBxWfkbUG6A=; b=JFzlM4GFLQRWlxJYkN9bimidFMEFA9C0RH5SVcxr1dY25W2Yb9q8DFEFi2vn+cxpkV 7X2qi5YD6BzPvgpyub5HlvqeVousJXuoWJU53AtmPrFF8oRCMBDuemEimMnRdOedRn/P pDC0iXGTyNBCD+SMIrGTfxuLmwt7x0GEDiYbtj0qchHkLqpKktLbpO05zQNhEuN/hfJx gQ/+ZWUMYQw2nPBoE7PTjsTaODQyCEmNcMJF1N6b7jAvDf5bbYeO50KI+ScD7QvBOT8H XWccuwms1BH3zOY5HS+VVhbMW7dYX9BVznxkNNghfSvDkVMORfiamwZfMZFR6Du4xlBx 7Q9w== X-Forwarded-Encrypted: i=1; AJvYcCXYcA84pxmI5/wkf1NI5rHCawrjaycu/LvUvVDnMCWyNn7daDDrpAjYbWZeiJbWijlhN5uj6SjptYZeU+HMKsllJlVI/Mo9XLhDCxh6ktomwkTRzrA= X-Gm-Message-State: AOJu0YyPCj5wP/ktN9oYZxTnCQovFiN4qonVh1LxvspoJosQ31FvNAPf bpn/hhrXUJ+c6ijtb3hQGcY26c1wOdKmiV9q5/Dl/hvFF16MGYvn0kOUOURVSAoFHoV96sbvcTX / X-Google-Smtp-Source: AGHT+IF5vUsuDt3b5kATjhz13YwMUbFsgUZ7ijQ1OWYZHfaNiPIFT/g4J+dEvQgjMaMZVRjTozCIKQ== X-Received: by 2002:adf:ef43:0:b0:343:4b39:9dbc with SMTP id c3-20020adfef43000000b003434b399dbcmr1447812wrp.42.1713959012474; Wed, 24 Apr 2024 04:43:32 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id p16-20020a05600c1d9000b0041b0d4e1c27sm1442161wms.42.2024.04.24.04.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 04:43:32 -0700 (PDT) Date: Wed, 24 Apr 2024 14:43:28 +0300 From: Dan Carpenter To: Florian Fainelli Cc: Broadcom internal kernel review list , Greg Kroah-Hartman , Umang Jain , Stefan Wahren , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] staging: vc04_services: Delete unnecessary NULL check Message-ID: <526ec2ff-6277-4d5d-b2d9-63b087a97c7c@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240424_044335_813649_F7F05827 X-CRM114-Status: GOOD ( 10.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The "state" pointer points to an offset in the middle of the "mgmt" struct so it can't possibly be NULL. And also we dereferenced it on the line before. So this NULL check is pointless. Delete it. Signed-off-by: Dan Carpenter Reviewed-by: Stefan Wahren Reviewed-by: Umang Jain --- .../staging/vc04_services/interface/vchiq_arm/vchiq_dev.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c index 9fe35864936c..3c63347d2d08 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c @@ -1170,11 +1170,6 @@ static int vchiq_open(struct inode *inode, struct file *file) dev_dbg(state->dev, "arm: vchiq open\n"); - if (!state) { - dev_err(state->dev, "arm: vchiq has no connection to VideoCore\n"); - return -ENOTCONN; - } - instance = kzalloc(sizeof(*instance), GFP_KERNEL); if (!instance) return -ENOMEM;