From patchwork Fri Jun 26 10:51:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 11627147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AAC392A for ; Fri, 26 Jun 2020 10:52:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F22F020C09 for ; Fri, 26 Jun 2020 10:52:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="baIy0omK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728150AbgFZKv5 (ORCPT ); Fri, 26 Jun 2020 06:51:57 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:38306 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728083AbgFZKv4 (ORCPT ); Fri, 26 Jun 2020 06:51:56 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05QAgC4i046576; Fri, 26 Jun 2020 10:51:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=IyAs4nskBqgPQ4L1AWyl1A5z6DX1rt9lSUquCzoUgko=; b=baIy0omKhA2O7y3Dq45ECwGvSdQHWzO2iLfCZyZD4VC74CIoGyU6xyFbPDFrBEYdt6WX fzSyFJ0L7iiXy9zsBcMdtdZLRw9g6v2cg9aEEPxlg9fN0OB+4U4SyZGXrpBEOB/xnEdx pHJPfEh42HaoVB8blH5prlrsejlJmPtNzLx4o6+Cbl6BgCqWhO1EkoDgKu/d/Xaujkaw LGb44Mk51QYR/BUY0UH8kx+5ijR/aC+2FpC5BCGWOVVQpEPDVaCuK2Xou952PtujIzXK Z2wc2r9OFpiskkQ39OoEGO/qJ9lvBMNjhnY04wLbFZ/Dhe+ACt3blTvdaWoHL1eOTyaf Eg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 31uustwe1p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jun 2020 10:51:44 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05QAmK2J106634; Fri, 26 Jun 2020 10:51:43 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 31uurby0ww-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jun 2020 10:51:43 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 05QApfQc003733; Fri, 26 Jun 2020 10:51:41 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 26 Jun 2020 10:51:40 +0000 Date: Fri, 26 Jun 2020 13:51:33 +0300 From: Dan Carpenter To: Alim Akhtar Cc: Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Kukjin Kim , Krzysztof Kozlowski , Kiwoong Kim , Wei Yongjun , linux-scsi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check Message-ID: <20200626105133.GF314359@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9663 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006260079 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9663 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 cotscore=-2147483648 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1011 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006260078 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The "head" pointer can't be NULL because it points to an address in the middle of a ufs_hba struct. Looking at this code, probably someone would wonder if the intent was to check whether "hba" is NULL, but "hba" isn't NULL and the check can just be removed. Signed-off-by: Dan Carpenter Acked-by: Alim Akhtar Acked-by: Alim Akhtar --- drivers/scsi/ufs/ufs-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 16544b3dad47..802f7de626e8 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -264,7 +264,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs) u8 div = 0; int ret = 0; - if (!head || list_empty(head)) + if (list_empty(head)) goto out; list_for_each_entry(clki, head, list) {