Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3976659imm; Mon, 30 Jul 2018 06:44:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpePsYciN71f84ybE03uurqkc6rznO4OAkj5xfJrQa1jlziG+x+/Pbh6KLafj+GTVzpxj+fD X-Received: by 2002:a62:5a01:: with SMTP id o1-v6mr18140289pfb.0.1532958263270; Mon, 30 Jul 2018 06:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532958263; cv=none; d=google.com; s=arc-20160816; b=P/oYOGaw2VdjrjQhBJ4M0xE1JmqVrpGTBs6JBxhuYgn/cEp9ePTfERbMTvvKAfD2s/ jWV28Pcs19zSq3TMWwGpINzzifguIb54adb/Gtm+Z71yqzsF57ZqJOyIUZQvC33mU2Jv Hc7OFxiofQi65pB8jNWJwmHtkr5yY6umK4lcMQTkcSqxQ5JYCFZrWIeS1S1WgxSw9t/T XBJB2Szyc1UHqgo106eQ33c9EwZ6iO6b3f61FKXWwB+Qcr0oHMLqcxFFKeeTyGz5tYis CDV9+lGzmMYidxmw2epeFoNLsvaMIbmBq4VrRVCfFCqBetJLdDCv/SN9UAxVo+hWC7Mr lREA== 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=DNdnE/kZ/XuUmtH5Z/dUaoBqpi0bBVl9FJ0FK1kRdbA=; b=H1ubIeK5M6qSjzfmEhDdaTLK6R0zbBvWKoAAwS+KKpEa3PyH5b5Mj1kXdOU9kFRAEy 2MhDKnRPVEm/9n/sh7WRIazsBVLMAI3SMY2/y5SHmIktsZQ3RxsPXocjCnKfXlhZE8Dn vdLdwG8C9monSlOaIl3Ok9YczeDgNZ5sy3uloyBAnkoaOutYIvZvR5ME3peW81qwaJnz ALPy4cfFxQnYZH/zMLD5GR6G+qpXuMz0u2AzoDzY1SZLF4RyHdQGr8hxQCq7zXB1UD2V lpc2Z96uiPHwzWAkMd4S78W112n5DwPiMvHvusueiE6+K3UbFCrlulOZmlyzEzejXfnG PFQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iOjlUOCg; 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 z7-v6si9691836plo.388.2018.07.30.06.44.09; Mon, 30 Jul 2018 06:44:23 -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=iOjlUOCg; 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 S1726961AbeG3PSH (ORCPT + 99 others); Mon, 30 Jul 2018 11:18:07 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:35631 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbeG3PSH (ORCPT ); Mon, 30 Jul 2018 11:18:07 -0400 Received: by mail-pl0-f65.google.com with SMTP id w3-v6so5579316plq.2 for ; Mon, 30 Jul 2018 06:43:03 -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=DNdnE/kZ/XuUmtH5Z/dUaoBqpi0bBVl9FJ0FK1kRdbA=; b=iOjlUOCgmLzk0fekyO/1D4wIKuJYdycSmAuHY2lpYgcrpFkkDl84aeAO/kwHHj2UC2 JU574Bc1LylQSS1/HlyTXgBYQbUXMPqgP9fmMTDkHyjaabVeKokDYh2K9Q11ho1pW+43 eBlyAUkZtYPseF91U8T20i75Trejz0HUSf3CeIRtvcQeMXbyavja9HFKDABSNGM8bj/j bRrnAGix6mVejCg1jiu8HZSiSg2Qxk8+QI47RXgIPlNMrl5tC6lnY9+nPrqY2apFqLYm CpmYTgcWBBPWMjRpcTOdJeCp+AWELk97ksb/mmxklxkdvAgWrqTivl45E1rmYsk+X1mj 6rHg== 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=DNdnE/kZ/XuUmtH5Z/dUaoBqpi0bBVl9FJ0FK1kRdbA=; b=X4rITC/ySC+f54RCb+F8hdqQD7PtOaoB7qL0H7HsH0HDMMUZrCrGkkWGauXzw/lYyX 8SnQhSKOua4Fvmy2FRiRLGTg1wv6eSM/zSDHW213m5LBQobI3dkIX1DEu4zeKiGIeVeN P+m1iNL9ni/KHGbEbmRVbQzDn6A6rK6ELYoJ1uXOMmDJYkPFThEK6LMjLHhD8Kb5PvsQ JalMCt5M7V3lGj4C4APF2du3wrSK4tGABwgsTHRB3T+gkGTjklCYY2DAXh8+POYAWilr eAG0slhjoNyKSVhU50gD7sCh0uIIbfkLNG7ge1L5CxjUBGdAx64GPaQRkriifSnX3A1C 96xA== X-Gm-Message-State: AOUpUlFVRxN6B8nCh0dj7HboKy1l6TlZYqgqcXvVdcSQyzf0S9dznUtP PpXaTCxcRxpEUrxWOPcz6w8+9D8f X-Received: by 2002:a17:902:a989:: with SMTP id bh9-v6mr16733920plb.245.1532958183353; Mon, 30 Jul 2018 06:43:03 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:4550:ab75:cee3:d6c1]) by smtp.gmail.com with ESMTPSA id f23-v6sm12397577pgl.5.2018.07.30.06.43.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jul 2018 06:43:02 -0700 (PDT) From: Jia-Ju Bai To: linux@dominikbrodowski.net Cc: linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] pcmcia: pcmcia_resource: Replace mdelay() with msleep() Date: Mon, 30 Jul 2018 21:42:56 +0800 Message-Id: <20180730134256.8901-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 pcmcia_fixup_iowidth() and pcmcia_enable_device() 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/pcmcia/pcmcia_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 34aad895a239..8129dd8094cd 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -284,7 +284,7 @@ int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev) io_on.stop = s->io[i].res->end; s->ops->set_io_map(s, &io_off); - mdelay(40); + msleep(40); s->ops->set_io_map(s, &io_on); } unlock: @@ -567,7 +567,7 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev) !(flags & CONF_ENABLE_PULSE_IRQ)) option |= COR_LEVEL_REQ; pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &option); - mdelay(40); + msleep(40); } if (p_dev->config_regs & PRESENT_STATUS) pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &status); -- 2.17.0