Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp551543imm; Fri, 27 Jul 2018 01:43:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf2NcmuRTjwsKwo2VFjYFuVwv/COkrqcOkV293DZXvZgA0XL6ENrMDwrmhYWh88xQBT8eUA X-Received: by 2002:a63:4c56:: with SMTP id m22-v6mr5067940pgl.299.1532680999336; Fri, 27 Jul 2018 01:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532680999; cv=none; d=google.com; s=arc-20160816; b=vD1XdayOkWyZ6pjF9/U91DYj0M6cEe/BY8DLGRY6Va8i3Up9XIBZ1XX5Xh5A24T87C 2NlvufAuCU/M8B44j+NOrbqNHYDnp52NSDQyYLT/ozdTBODyuxY5wfNu/qg0S0VbOhrh KZuFsK+bqSQHJiDMGWhgrne32/A5NTwz5vYPDaZDgG5HFWrKp2qhtVw8nTry/YJsy2C9 6Mah0/Z68fCpr3r4vUbzjRVS1zAkrPHcMlPaMTtJNC/y146dMn58QAhEoJAvYovbJh2N IwsRJ9JyZOMOnmQ9X5gQsFu8d5S1SB4ZCfj8mkGD2CJbmXrpJ4aw2emnfi8kv4AXq1gs JRiw== 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=XGmq/x6P7K2Cm+nsR2uCIe5Myu9pfo9b8TAre9jUuvM=; b=DNP2Jzj/ymqMn+dMvuzKhhcTEZgvYnbdGM9ZpqEKp7iPCRrYZek2FL5oVg1SNVeHV5 N+0xyYlFAsThiowM4NvZ2xk7sFOM+VlWxamZZz33czY+4WD9ErsnD1fd4igvZD4ZS2Y/ CEMKH7kOw4HA0SGjYaoSxLo2dtSEMBfqB9ZRTdN/0Jusi4TEQnsmwoNVeHy4v0CL9EOB XCuM3vuHJGYMsJXRhsMsMqqlc6UtLFpTCmrk1SIky5JYz5XO65BtGV3iRBxgqDuHHMGF SDZcjjTozU9gMyfNmYwqiQtAoTC29RYl2Mp5H6oByBe4Y3KTFvKbOZSIVDRHxBpNq8xJ jvFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DycbC6mN; 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 q35-v6si3281857pgb.219.2018.07.27.01.43.02; Fri, 27 Jul 2018 01:43:19 -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=DycbC6mN; 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 S1730367AbeG0KCC (ORCPT + 99 others); Fri, 27 Jul 2018 06:02:02 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:41718 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729481AbeG0KCB (ORCPT ); Fri, 27 Jul 2018 06:02:01 -0400 Received: by mail-pl0-f65.google.com with SMTP id w8-v6so2026111ply.8; Fri, 27 Jul 2018 01:41:10 -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=XGmq/x6P7K2Cm+nsR2uCIe5Myu9pfo9b8TAre9jUuvM=; b=DycbC6mNe5Dn2fKKN9kdGAO0a/45yfB5EhWdSCyiMX6HQBH8+rE9qR/5/TGevrhz7p bNzXzlzwlHo/jPI3SZFUV2BOvBu/Kor0TdFIYG1W+DI0AW0kp2HixitcDYgUAYpz9mCo IgKX3NjpcM9rjy6I1JGomZDuBvn8Qk+Bmu30/sFsePTMeSc8dm4VH8syDcTcr4it+7IO oQ6S2L/Msqk6w56QiQZ44CZev28HiAIBND3VLwCzNll7ULOlZWi8nmF7jIHVf5j6UHRK 2P0Cq87/lMJSL9mxJXnSMn43Ns8/HnfddNfuhD5cs04yPHMu3Z2n3jNnWIYoudIafKGs E9vw== 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=XGmq/x6P7K2Cm+nsR2uCIe5Myu9pfo9b8TAre9jUuvM=; b=XWreVlimN2p9MRMA2z25PhMrhsIA4nN1kz3ispLzJA6F1JLpAtQ5Cvn00Gi9gbpZ3w h3ZcbGg+jC+JJ7AqcWyHqb3FRtAOhjPcc22m4brROOESnxL6kOoTkuy5wsjg1KJaouRr fMTtCjjus+6j8XUjODpjy9XsfpaTJo6+9cie67FkJzHAaLSol4uxPEb+CppolV/Q7k2m FHAXdc+iKe2OBQCvPjtz1Ha94S3+3USEaDSXRwhYGz5YB3du07VpHFavAHERnCYlxdmw XZPK5O33yXTGsUFrP3T47w4jKxVyuFJ3M8fIpX2DHAcCLWBQfG33bnEzvXVZGYgbB/zx JhNQ== X-Gm-Message-State: AOUpUlESA6Ku0US3rQ5peW3+4g/WW52qtSk7IiX6nRygV0YZjefw8z31 Qn2IZYW/1nmgaWtXlWZaFjOBcdm4 X-Received: by 2002:a17:902:bcc5:: with SMTP id o5-v6mr5156349pls.336.1532680870302; Fri, 27 Jul 2018 01:41:10 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id x2-v6sm7781921pfi.166.2018.07.27.01.41.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:41:09 -0700 (PDT) From: Jia-Ju Bai To: liujunliang_ljl@163.com Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: usb: sr9700: Replace mdelay() with msleep() in sr9700_bind() Date: Fri, 27 Jul 2018 16:41:04 +0800 Message-Id: <20180727084104.29726-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 sr9700_bind() is never called in atomic context. It calls 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/net/usb/sr9700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c index 2d316c1b851b..6ac232e52bf7 100644 --- a/drivers/net/usb/sr9700.c +++ b/drivers/net/usb/sr9700.c @@ -358,7 +358,7 @@ static int sr9700_bind(struct usbnet *dev, struct usb_interface *intf) /* power up and reset phy */ sr_write_reg(dev, SR_PRR, PRR_PHY_RST); /* at least 10ms, here 20ms for safe */ - mdelay(20); + msleep(20); sr_write_reg(dev, SR_PRR, 0); /* at least 1ms, here 2ms for reading right register */ udelay(2 * 1000); -- 2.17.0