Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8552568ybl; Thu, 16 Jan 2020 19:25:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyfvBqiT9mY5hGWqEd+LFtT0eQy1w0qkec+3IPsmifJnefbWSeUmcTd9Bb10nZy5GuUJ8At X-Received: by 2002:a9d:6398:: with SMTP id w24mr4567733otk.15.1579231524794; Thu, 16 Jan 2020 19:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579231524; cv=none; d=google.com; s=arc-20160816; b=Fp1z8d1b9jIkZ5H7mL72UX0t8Oebz9eshcPZd/JPSBZcT4+GnFczPXsSST+Ads+IO7 OVMVt1laoqewQTuHvAhBjVskXPxaP1pLfUNLFq8/zYVG5fIP9Cbxii9oq01k4zT6oX+D bIUwqfF6hrmf95dB3IZZ/whikWydpqV2/90eMfu6mZhFLA4nF6AGiFlyY8b+KzL9GnY8 5Nhw4ybKM2W7x4zRohdTQMNjwYYFPUuc1vm6rgsGxjHrIGc66Nu4FmTb70/WPC7FQLlO HEAhki1f9sFr+8J+5l07beaRGib7eUmgfi+GbLLWzOGjWlPJgEMdbFj2aHJgsiaL6FwS L7wA== 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=RXDGabkwQMimpyHkRYyShSJhmbUURh63EFAyBd9V09U=; b=JhWVQzD2iNKReAhogGZ2nOouwZYSARAUw047e6GJ+ZlTAneUVwg+pX0cl6Fe0xuDbE IKMDEMk94Sohyeb+rDAcRixmg/TjfPoYcgMixCXm7Zuyisb30qHO2LNLbabDREo7ncha QBVyQNB+VHvNNPp3d0GCDRt++Dtua4nGfIhcsvjukSL/yjeokX/Ltxvorj95HOSqY5bd aA5j2i+spPujIdu54oDnzTbYZ2LgwxIAlDLF3SqHG6zT42U+E4x9JNJKfKskT8pC5OfY cLNTsrmLLQgKfP/cE7Nn7rw8/uTUNExHbkJr7PSUt2Iwhfbnyt21PCYu7q7/WkBF81Zl RJBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oIU220cX; 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 f203si12626848oib.56.2020.01.16.19.25.13; Thu, 16 Jan 2020 19:25:24 -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=oIU220cX; 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 S2404449AbgAPXdx (ORCPT + 99 others); Thu, 16 Jan 2020 18:33:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:44554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404431AbgAPXdr (ORCPT ); Thu, 16 Jan 2020 18:33:47 -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 8ABA120661; Thu, 16 Jan 2020 23:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217627; bh=uxoYdEa1YMvd4QmddYEXwU+ZoyC4hc6YNpLE/Vn6OP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oIU220cXWV0Xgy49AMN5zKd/HfeQ7ftR95jmtXJq2ZIRM052Qj4Hr90jUtSqyG/Go Hxm+kT1dyDTTq8srywCJ5OZbm1MWydTCsIGAQqbDgmTqvGTdvGG4AsCnV3MlYNYS8y OuZDOfKb6cis5I3ESbfau2GKyjyQspJIarogjQhA= 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 4.14 59/71] rtlwifi: Remove unnecessary NULL check in rtl_regd_init Date: Fri, 17 Jan 2020 00:18:57 +0100 Message-Id: <20200116231717.672843476@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231709.377772748@linuxfoundation.org> References: <20200116231709.377772748@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 @@ -427,7 +427,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 */