From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755196AbdDLQnl (ORCPT ); Wed, 12 Apr 2017 12:43:41 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:33919 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754866AbdDLQnj (ORCPT ); Wed, 12 Apr 2017 12:43:39 -0400 Date: Wed, 12 Apr 2017 09:43:37 -0700 From: Matthias Kaehlcke To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Grant Grundler , Greg Hackmann , Michael Davidson Subject: Re: [PATCH] kernel/irq: Limit validation of cpumask_var_t to CONFIG_CPUMASK_OFFSTACK=y Message-ID: <20170412164337.GF28657@google.com> References: <20170411235217.71604-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, El Wed, Apr 12, 2017 at 09:23:58AM +0200 Thomas Gleixner ha dit: > On Tue, 11 Apr 2017, Matthias Kaehlcke wrote: > > With CONFIG_CPUMASK_OFFSTACK=y cpumask_var_t is a struct cpumask > > pointer, otherwise a struct cpumask array with a single element. > > > > irq_thread_check_affinity() validates the cpumask_var_t field in the > > interrupt descriptor by checking if it is not NULL. This works for > > both CONFIG_CPUMASK_OFFSTACK=y/n, however clang raises the following > > warning with CONFIG_CPUMASK_OFFSTACK=n: > > > > kernel/irq/manage.c:839:28: error: address of array > > 'desc->irq_common_data.affinity' will always evaluate to 'true' > > [-Werror,-Wpointer-bool-conversion] > > > > To get rid of the warning only validate the cpumask_var_t field when > > CONFIG_CPUMASK_OFFSTACK=y. > > This ifdeffery is horrible. Can you please create a helper inline > cpumask_available() or something like that which hides this in a header > file. The irq code is probably not the only place which does this. Thanks for your comments, I'll rework the patch to use a helper instead. Cheers Matthias