From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1C17CA9EA0 for ; Wed, 23 Oct 2019 03:23:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 748AE20700 for ; Wed, 23 Oct 2019 03:23:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Dxx19dMR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LXsEOBqK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 748AE20700 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9gwKvdtaUh5Y4mI5R8XgiPseNuKb1GjUDz76IewJG08=; b=Dxx19dMRVocl+F ZP81KRfIT6Xd74uxJSIb7uiB+wXBXz5G8YqUz9+GXFPSwksVpHCTZi2539gmo2kP1erSeyIa9cCPM 4YYiOZY9J3yFQUI7wtJatQyNYdCp4Jh/JuC7VWUxMcnrMO8/7KWQoOyzDz3be0LDqwpCfyQjKnKqm 3n6TovIZmwiePlQAX6Jvel5hVuLNBBwBcYpJJYC1NjLjBOTwfo9EDT5eEhEW3TC0h8FI0bn2jYYt7 frj5DexmlwAzRFd6TT7kuTWNisc/ZnlefrroFRMuBpyq0W8lsR1JT5/O5dHM1FVCAokwrw3otbVSb DmS6ot+QvqrxASSQLcoQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iN7Eu-0002D1-MY; Wed, 23 Oct 2019 03:23:12 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iN7Eq-0002CO-HK for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2019 03:23:10 +0000 Received: by mail-pf1-x441.google.com with SMTP id a2so11971061pfo.10 for ; Tue, 22 Oct 2019 20:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vG1wlSoVjAH3TslkWdryreWfIFyS6PFtkukPqp6iu6k=; b=LXsEOBqKOd15Ki+pYR61bVtYMBRigi5yBLP9kWdnCjKN1Swh9GjKCUwx0e3QhP41oi f6UJc+sH3LzMZoN5qWZvLMzAjEU16NRk8kTsJPTu7URZghySrGM6OTxY9fqqjuAyt3uB HxfziLk4zNdgSGfMY3vn4D+fHbIQTuh2zDQX0+0jzinbdY/BmlbbGmqBiBOcegI/b0tJ ojhMWWAwm3fDesTkzWreV/gkOS+mhpjHcAcqoqKZc4aFnm+M4kBRGIj5lV0WwPW/N7Pj 2xkTKceWyv4TxlJ6s5uVbJ7Pb8+aahzzhlR9yxioAT2pJFcOEdxw0J2tRmXjARLs2pFt whlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vG1wlSoVjAH3TslkWdryreWfIFyS6PFtkukPqp6iu6k=; b=kMx4nH0IRvpmvvplDEpaCg1w9ZvikwtiucfdKs+rAYuw9oRIhuF+MQEfiUPxFkbaeB 41d6P7GflnrzO8Muja3x5Kj3GLBvFXaq/WdstWE5s/rdowpVUFfXdnEcHw/93xiaWuNG k627ANNiB8Ta87yGiq7S2Nu+GfdW4CoDMic6TTOGkw1zdTFVELyHXDaJxTlCYtqgFdBy mAe3XIjp76F89C9K47ufqK3Awy5puy6OwrOnFgQr50AzOrFv9cd0jF12seZLBn1m5d8D K/thIlpDocZWf6GV8zoYr478GSk3Z/WTLOJZM1xUF/9RO6BKoJh2VcuNAI+sEboeuGcT +X1Q== X-Gm-Message-State: APjAAAUOhPRyI/dj/RvlcBKG/xeukj+ypGI1VFfjJ2xC7pdqRMdxCexx hb0tkedIuJaVPTHcIIAk0Tf9Qg== X-Google-Smtp-Source: APXvYqzL207UMotVVbLIBySCNyQniimBEc7wiboiIj6T8IbhYFht01SBvULx1tt1kgQWqReZqGRDrQ== X-Received: by 2002:a17:90a:ac12:: with SMTP id o18mr8782943pjq.93.1571800985488; Tue, 22 Oct 2019 20:23:05 -0700 (PDT) Received: from localhost ([122.172.151.112]) by smtp.gmail.com with ESMTPSA id f15sm19700257pfd.141.2019.10.22.20.23.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Oct 2019 20:23:04 -0700 (PDT) Date: Wed, 23 Oct 2019 08:53:02 +0530 From: Viresh Kumar To: Nathan Chancellor , broonie@kernel.org Subject: Re: [PATCH] cpufreq: s3c64xx: Remove pointless NULL check in s3c64xx_cpufreq_driver_init Message-ID: <20191023032302.tu5nkvulo2yoctgr@vireshk-i7> References: <20191023000906.14374-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191023000906.14374-1-natechancellor@gmail.com> User-Agent: NeoMutt/20180716-391-311a52 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191022_202308_644236_666E2356 X-CRM114-Status: GOOD ( 21.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , clang-built-linux@googlegroups.com, Kukjin Kim , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 22-10-19, 17:09, Nathan Chancellor wrote: > When building with Clang + -Wtautological-pointer-compare: > > drivers/cpufreq/s3c64xx-cpufreq.c:152:6: warning: comparison of array > 's3c64xx_freq_table' equal to a null pointer is always false > [-Wtautological-pointer-compare] > if (s3c64xx_freq_table == NULL) { > ^~~~~~~~~~~~~~~~~~ ~~~~ > 1 warning generated. > > The definition of s3c64xx_freq_table is surrounded by an ifdef > directive for CONFIG_CPU_S3C6410, which is always true for this driver > because it depends on it in drivers/cpufreq/Kconfig.arm (and if it > weren't, there would be a build error because s3c64xx_freq_table would > not be a defined symbol). > > Resolve this warning by removing the unnecessary NULL check because it > is always false as Clang notes. While we are at it, remove the > unnecessary ifdef conditional because it is always true. > > Fixes: b3748ddd8056 ("[ARM] S3C64XX: Initial support for DVFS") +broonie, who wrote this patch to see his views on why he kept it like this. > Link: https://github.com/ClangBuiltLinux/linux/issues/748 > Signed-off-by: Nathan Chancellor > --- > drivers/cpufreq/s3c64xx-cpufreq.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c > index af0c00dabb22..c6bdfc308e99 100644 > --- a/drivers/cpufreq/s3c64xx-cpufreq.c > +++ b/drivers/cpufreq/s3c64xx-cpufreq.c > @@ -19,7 +19,6 @@ > static struct regulator *vddarm; > static unsigned long regulator_latency; > > -#ifdef CONFIG_CPU_S3C6410 > struct s3c64xx_dvfs { > unsigned int vddarm_min; > unsigned int vddarm_max; > @@ -48,7 +47,6 @@ static struct cpufreq_frequency_table s3c64xx_freq_table[] = { > { 0, 4, 800000 }, > { 0, 0, CPUFREQ_TABLE_END }, > }; > -#endif > > static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy, > unsigned int index) > @@ -149,11 +147,6 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) > if (policy->cpu != 0) > return -EINVAL; > > - if (s3c64xx_freq_table == NULL) { > - pr_err("No frequency information for this CPU\n"); > - return -ENODEV; > - } > - > policy->clk = clk_get(NULL, "armclk"); > if (IS_ERR(policy->clk)) { > pr_err("Unable to obtain ARMCLK: %ld\n", > -- > 2.23.0 -- viresh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel