Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752344AbdFMKoT (ORCPT ); Tue, 13 Jun 2017 06:44:19 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:35502 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895AbdFMKoR (ORCPT ); Tue, 13 Jun 2017 06:44:17 -0400 Date: Tue, 13 Jun 2017 12:44:12 +0200 From: Luc Van Oostenryck To: Charlemagne Lasse Cc: linux-sparse@vger.kernel.org, kernelnewbies@kernelnewbies.org, linux-kernel@vger.kernel.org, Jeff Layton , Dan Carpenter Subject: Re: ./include/linux/err.h:35:16: warning: dereference of noderef expression Message-ID: <20170613104410.piy7o3oxiahtuqjx@ltop.local> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170428 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1292 Lines: 40 On Tue, Jun 13, 2017 at 11:55:26AM +0200, Charlemagne Lasse wrote: > Hi, > > I have following code which generates a warning when compiling with "make C=1". > > ~~~~~~~ > struct task_struct *kthread; > kthread = kthread_create(xxxxx, yyyyy, "zzzzz"); > if (IS_ERR(kthread)) { > ~~~~~~~ > > The warning is > > ./include/linux/err.h:35:16: warning: dereference of noderef expression > > And disappears when I remove the IS_ERR. How do I correctly work > around this incorrect warning? > > Btw. I am using Debian stretch amd64. It seems like this is related to > the __force used in the parameter list of IS_ERR. Removing it also > removes the warning. The warning is indeed related to '__force' but it should be the other way around. Anyway, by just reading your three lines of code, you shouldn't receive this warning, with or without the __force. > If it is fixed in sparse's git then when will there be a new release of it? I can't reproduce your problem even on a three years old version of sparse (more exactly git version d917662d5 of sparse, anything older has build problems with half-recent kernels). The pre-processed version of your file could be interesting as well as the output of the make command but with the 'V=1' option added. Regards, -- Luc Van Oostenryck