From patchwork Tue Nov 12 08:16:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangjiao2 X-Patchwork-Id: 843447 Received: from cmccmta1.chinamobile.com (cmccmta6.chinamobile.com [111.22.67.139]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D9E8E209F4F; Tue, 12 Nov 2024 08:16:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.22.67.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731399405; cv=none; b=jZWUpTxiXIzn4nq8paMprBL75AZ9xrRsfhXI3KJ0/WTOcpD1b20IlMizfw14exw6L0eMK1p3EN5VLj+AcCoMBN55EwbW7VlQMTCtS41WpiOj3zowcWkCGQjb206V4RLxEESzG2ZQfLx62UCcyN960c0YpTziDFyTAdvN5azI+So= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731399405; c=relaxed/simple; bh=MmAltxcpHsJkOjqgCDIFBXvQoKMtkqt3UbTqi/E/aLo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=fZuLBTSzpWGLwfiYnJKIMnlrfa0AOuB4JGT8xXDIh9RJpn/ThkIa0xFmEKX3Q3IY8L+jGK5KUAPBjfraQNtY8frOFEbxBYIkAEjd05zu1+PwfzWYBkAbZmFm3fJ1qhR0e/2KjBKVXxTW63FbxlWMH3XcVzjtIj28FwC0safqknQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; arc=none smtp.client-ip=111.22.67.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app01-12001 (RichMail) with SMTP id 2ee167330ee7b13-de428; Tue, 12 Nov 2024 16:16:39 +0800 (CST) X-RM-TRANSID: 2ee167330ee7b13-de428 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.108.79.101]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee967330ee6cc3-4d1ef; Tue, 12 Nov 2024 16:16:39 +0800 (CST) X-RM-TRANSID: 2ee967330ee6cc3-4d1ef From: zhangjiao2 To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, zhang jiao Subject: [PATCH] spi: Delete useless checks Date: Tue, 12 Nov 2024 16:16:37 +0800 Message-Id: <20241112081637.40962-1-zhangjiao2@cmss.chinamobile.com> X-Mailer: git-send-email 2.33.0 Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: zhang jiao Since "res" will never be null, just delete this check. Signed-off-by: zhang jiao --- drivers/spi/spi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 74e04a4b0f19..460a49d9a0de 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -984,9 +984,6 @@ static void spi_res_free(void *res) { struct spi_res *sres = container_of(res, struct spi_res, data); - if (!res) - return; - WARN_ON(!list_empty(&sres->entry)); kfree(sres); }