From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ard Biesheuvel Subject: Re: [PATCH v3] sparse: treat function pointers as pointers to const data Date: Wed, 8 Oct 2014 20:06:22 +0200 Message-ID: References: <1410157803-3658-1-git-send-email-ard.biesheuvel@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-lb0-f169.google.com ([209.85.217.169]:53472 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754277AbaJHSGZ (ORCPT ); Wed, 8 Oct 2014 14:06:25 -0400 Received: by mail-lb0-f169.google.com with SMTP id 10so8760921lbg.28 for ; Wed, 08 Oct 2014 11:06:23 -0700 (PDT) In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Christopher Li Cc: Linux-Sparse , Will Deacon On 8 October 2014 20:00, Christopher Li wrote: > On Mon, Oct 6, 2014 at 10:44 PM, Ard Biesheuvel > wrote: >>> we only address the case where the function pointer is the target of >>> an assignment. > > I apply the patch in my private branch but haven't push out yet. > > I just want to confirm, you didn't find this kind of assignment in the > kernel, right? > I noticed this patch https://git.kernel.org/cgit/linux/kernel/git/kvmarm/kvmarm.git/commit/?h=queue&id=de56fb1923ca11f428bf557870e0faa99f38762e and saw that it was bogus: changing the return type of the pointed-to function to 'const int' makes no sense at all, and yet it shuts up sparse. With my sparse patch, that patch could have been dropped (although I think it was merged after all) -- Ard.