Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8558829ybl; Thu, 16 Jan 2020 19:34:35 -0800 (PST) X-Google-Smtp-Source: APXvYqxn6hw/yX0PlUv+ng2gKUuXpFk9Dx+aGCPEqq+thdhGSi/pw2yonBUkYIscejnDLDZ6JvzA X-Received: by 2002:a05:6830:15a:: with SMTP id j26mr4467500otp.137.1579232075706; Thu, 16 Jan 2020 19:34:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579232075; cv=none; d=google.com; s=arc-20160816; b=eRlZj2UGJdXIg+W1Ivfv3NLTClWGg7ltZs9gaIR2OKCwvF+5LqaLwpWNP8KbSzp4sV iwjLH7Nn0AOw2rrIWbL3Otu63S2mf2ZxsJncg2YadNtddTBcyRlQlQfYCu9zrJ4y8U6V OkKPXuLssgxrVZAzRuZM0tTfJ8JeoIRfRoTuWKpIy3pev8RM1ZcOu2bEk9cgJ8quHpXp kUvs1+E+2VxkllorQiBpndrRN28F5nzP2enMIbr5yuymVglUDv6UaHOtVBnmiSHQBovd aBqs9lroTlzl16teNPa/jSacTgSyLjysYT1nWdqVbW5JRnSe3SQQM70+vYSkMGd7Zn66 ouiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LmoxqDcO38/rxUrR8Ui7NOv+FfRqShbq4cxS4syBHxk=; b=nSitc+M/9HIzgBoMt+MULgK9HHOPBafsxsAxjRhHYA4DInVO9VciimoUgulKQrOR9N 6IqpwGUurEG7Bwlu/W1RzXNVgHnqOZtrlh/Ad9FBb0HLkeJnyM3NVmlj5RkWCOa0i8Ar pRwPy1YD5es09dUxYexvUj7vsgHUCF68FgJ/n4cJyMCchG8iKTH1zm0mp1R5jhz/lH3f B8NpTjZOHOQjNw7sWNl3tbS7YLglIsC0iOhzGBS/tDI5zU/8a5kphwZSs7TH4FAIgB+E dXj/x3FaszOhFprn6J+oJDl3obi9oPUdparxDqBLOZIYB/w8Y0cvRE6oxyz1tqYKxdzj +lww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VFEK5igx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si12687073oiy.9.2020.01.16.19.34.22; Thu, 16 Jan 2020 19:34:35 -0800 (PST) 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=@kernel.org header.s=default header.b=VFEK5igx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391746AbgAPXmy (ORCPT + 99 others); Thu, 16 Jan 2020 18:42:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:56172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730225AbgAPX0B (ORCPT ); Thu, 16 Jan 2020 18:26:01 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D6E042072B; Thu, 16 Jan 2020 23:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217161; bh=VlQKu8ffHZFqvPusbZ7M08UcsU6jDfW/QHF1Vj/QBxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VFEK5igxvrRAA2ppCfEb+bDJ0xIwKVejefnV/6rHY/uBGlM78WWKBf4SVRXDEs5RI 2e7/89NvqVyYtTMLo/oaKLWrW8wxg8CRZ/VI3GPQsHtjsI+SiCTNaVwnfdd8e01S6i S1qwbtgVZFc/CKVeJffvkJYE7NffiBlntIgkTTt8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Ping-Ke Shih , Kalle Valo Subject: [PATCH 5.4 173/203] rtlwifi: Remove unnecessary NULL check in rtl_regd_init Date: Fri, 17 Jan 2020 00:18:10 +0100 Message-Id: <20200116231759.638842211@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor commit 091c6e9c083f7ebaff00b37ad13562d51464d175 upstream. When building with Clang + -Wtautological-pointer-compare: drivers/net/wireless/realtek/rtlwifi/regd.c:389:33: warning: comparison of address of 'rtlpriv->regd' equal to a null pointer is always false [-Wtautological-pointer-compare] if (wiphy == NULL || &rtlpriv->regd == NULL) ~~~~~~~~~^~~~ ~~~~ 1 warning generated. The address of an array member is never NULL unless it is the first struct member so remove the unnecessary check. This was addressed in the staging version of the driver in commit f986978b32b3 ("Staging: rtlwifi: remove unnecessary NULL check"). While we are here, fix the following checkpatch warning: CHECK: Comparison to NULL could be written "!wiphy" 35: FILE: drivers/net/wireless/realtek/rtlwifi/regd.c:389: + if (wiphy == NULL) Fixes: 0c8173385e54 ("rtl8192ce: Add new driver") Link:https://github.com/ClangBuiltLinux/linux/issues/750 Signed-off-by: Nathan Chancellor Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/realtek/rtlwifi/regd.c +++ b/drivers/net/wireless/realtek/rtlwifi/regd.c @@ -386,7 +386,7 @@ int rtl_regd_init(struct ieee80211_hw *h struct wiphy *wiphy = hw->wiphy; struct country_code_to_enum_rd *country = NULL; - if (wiphy == NULL || &rtlpriv->regd == NULL) + if (!wiphy) return -EINVAL; /* init country_code from efuse channel plan */