From patchwork Thu Sep 7 23:51:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Borowski X-Patchwork-Id: 9942999 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0B0BF602CC for ; Thu, 7 Sep 2017 23:51:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFA7A22230 for ; Thu, 7 Sep 2017 23:51:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E49F4274A3; Thu, 7 Sep 2017 23:51:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8F0222230 for ; Thu, 7 Sep 2017 23:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752485AbdIGXvR (ORCPT ); Thu, 7 Sep 2017 19:51:17 -0400 Received: from tartarus.angband.pl ([89.206.35.136]:50888 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbdIGXvQ (ORCPT ); Thu, 7 Sep 2017 19:51:16 -0400 Received: from 89-71-161-30.dynamic.chello.pl ([89.71.161.30] helo=umbar.angband.pl) by tartarus.angband.pl with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dq6Zi-0005N5-Ey; Fri, 08 Sep 2017 01:51:12 +0200 Received: from kilobyte by umbar.angband.pl with local (Exim 4.89) (envelope-from ) id 1dq6Zh-0001PE-JW; Fri, 08 Sep 2017 01:51:09 +0200 From: Adam Borowski To: Jes Sorensen , Kalle Valo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: Adam Borowski Date: Fri, 8 Sep 2017 01:51:03 +0200 Message-Id: <20170907235103.5359-1-kilobyte@angband.pl> X-Mailer: git-send-email 2.14.1 X-SA-Exim-Connect-IP: 89.71.161.30 X-SA-Exim-Mail-From: kilobyte@angband.pl Subject: [PATCH] rtl8xxxu: Don't printk raw binary if serial number is not burned in. X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on tartarus.angband.pl) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I assume that a blank efuse comes with all ones, thus I did not bother recognizing other possible junk values. This matches 100% of dongles I've seen (a single Gembird 8192eu). Signed-off-by: Adam Borowski --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c index 80fee699f58a..bdc37e7272ca 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c @@ -614,7 +614,11 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv) dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name); dev_info(&priv->udev->dev, "Product: %.11s\n", efuse->device_name); - dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial); + if (strncmp(efuse->serial, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 11)) + dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial); + else + dev_info(&priv->udev->dev, "Serial not available.\n"); if (rtl8xxxu_debug & RTL8XXXU_DEBUG_EFUSE) { unsigned char *raw = priv->efuse_wifi.raw;