Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp572977imm; Fri, 27 Jul 2018 02:10:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpczqJkAWwbXz8AE7bHtADZpfphlRuHDAZvFfkbHhlJuLER40CkEAEyxf6bUUpHKCraDTDIL X-Received: by 2002:a17:902:e28b:: with SMTP id cf11-v6mr5330322plb.86.1532682626078; Fri, 27 Jul 2018 02:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532682626; cv=none; d=google.com; s=arc-20160816; b=kOgh5+W0tDl/FpdBLDjZO2tXTpozQ87VKwvj95EbZnDPvHUynHpmvLj/dnIjq0Ey8W aKRXLmx4m8DYU5XGi/f07WghHDCuIrzA9kkJoBCyXJf2BxjEu6gnedsC+WEtBmPgYPZv RIrgcuncDEMPFDv7na+cMx51wVJ0ZVjYM0RgEVPHIJfaMu4XvuKtu0XCaKDuUsLYKnNV 3D/iLLVeAUbHE/LMdO3G55JVtx5wRDHbEhMh+2DTxLkVi1J1mNA+ALfRbYw+IlgybIcm AipR/i4hoe0thX8gAvlstHxSm/sOQtG4Sq1cR3a94QuZJ/cRm2fcdr4oruKmVnJpU2Mm OUiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=S8F4PyGtjzxna3EN2fSm5kRt7F5RmE4FXrj42Uz2lBc=; b=oBMpVyNvY2+n1Jk3Y/qk7hh4gW9Lgfaurv1XqqMtpDl2N69f0i2F+0VqchGbzhYU6S IzmXh2LgiF02MafV8NrNL2MvR6obBzJnjwSdfPaIjtABzObMhLUt8XB3fZfBBedBHGNT k9t6CbrIOY9bWv+HHjMLYOltNfejTHCOzZ+S5HBpuP4IiyWjCAFU2/b+buXxiC/nuY1u UBKt8uLdPTqqSJeT5sUTgNg8EnUmDh1uQmx9kSodVvh147Ti8IcR2wbp9D4N4mVtBhFD RIm1tFAvZmdqbRo4SyZAH47RiJ6zOugMeSvRDY/nxP0scMhP2Phy1VnvZ+gHeEPmhaON kO4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="G+4/N2NP"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o66-v6si3751438pfb.125.2018.07.27.02.10.11; Fri, 27 Jul 2018 02:10:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="G+4/N2NP"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730428AbeG0KaT (ORCPT + 99 others); Fri, 27 Jul 2018 06:30:19 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34789 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729539AbeG0KaS (ORCPT ); Fri, 27 Jul 2018 06:30:18 -0400 Received: by mail-pg1-f193.google.com with SMTP id y5-v6so2884073pgv.1; Fri, 27 Jul 2018 02:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=S8F4PyGtjzxna3EN2fSm5kRt7F5RmE4FXrj42Uz2lBc=; b=G+4/N2NPbFW45ODFNueFs4jyCwuj7yfSaUcLbQdrgbTwFv1flaqoto/BgYu423JwZh 324NPNAdp75nMy6RXOPv/PQDfMxtdtWYKE/L3/O2zTkkjSbg2fSO9zrVg/8QLHVw8pYz XZCXrrwdfO+60lOMhFIMd897lgiuBQOrrQzyxC2NO6Z+thcbskYeCxvVZNY6se20ME74 6FJB4ykQRwhNPjGm1cC07EvnHwxdNYYHxe7B+66hr20viilUiHTJK4hcxFSqYD191mbk Yw0szi1Z+aVF09wnGRDZjVpfovVKI0l4Nq+EzRWA9uDn0QNgZ57TSPEzAqkKD88BFK2I DjwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=S8F4PyGtjzxna3EN2fSm5kRt7F5RmE4FXrj42Uz2lBc=; b=cOPTKIcv7r1cUwLobIY7QC5Kp6L2Ws8WdITzbx+y8ra26zxta+W8Dz3jN6OIUt5qZQ rZO+vna342cEoC8tJQNKROd7iYc6eTFNY49ekMu3J2kKU7m25v1/YZNGHLnx3cxL9ncJ dnAtgepI9e7ALpknTEygC7o+Vqzmr2LxN6/j3R/fkE7l7wokkVlpNWyBWzA2HHeINpSe E0qD626KUEH+c6d5KhmxCQ2vQS0IDWbfD6P0RDL45z3LTHCBZzjULmEcjeEJMBg30Mv3 rOMh4y9rEiYBnuC/lEWfp/mmw3d9LntyQxMzYAMLCO8fBL/NI3B1P3OLOYQ4NR4uVhjn z+Hg== X-Gm-Message-State: AOUpUlHfGvvFHkAHtinOBrKWlhqBBUgEue1OWdYyzqUxc70jog2uBZGw gt2kP9qKeBd8CF3pUSGmoJ5YgbLZD1E= X-Received: by 2002:a62:9cd7:: with SMTP id u84-v6mr5831274pfk.90.1532682561824; Fri, 27 Jul 2018 02:09:21 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id 14-v6sm6202614pft.93.2018.07.27.02.09.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 02:09:21 -0700 (PDT) From: Jia-Ju Bai To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] scsi: a100u2w: Replace mdelay() with msleep() Date: Fri, 27 Jul 2018 17:09:13 +0800 Message-Id: <20180727090913.6870-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wait_chip_ready() and wait_firmware_ready() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/scsi/a100u2w.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index 8086bd0ac9fd..358dfeb1a9c2 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c @@ -143,7 +143,7 @@ static u8 wait_chip_ready(struct orc_host * host) for (i = 0; i < 10; i++) { /* Wait 1 second for report timeout */ if (inb(host->base + ORC_HCTRL) & HOSTSTOP) /* Wait HOSTSTOP set */ return 1; - mdelay(100); + msleep(100); } return 0; } @@ -155,7 +155,7 @@ static u8 wait_firmware_ready(struct orc_host * host) for (i = 0; i < 10; i++) { /* Wait 1 second for report timeout */ if (inb(host->base + ORC_HSTUS) & RREADY) /* Wait READY set */ return 1; - mdelay(100); /* wait 100ms before try again */ + msleep(100); /* wait 100ms before try again */ } return 0; } -- 2.17.0