Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753520AbeABLod (ORCPT + 1 other); Tue, 2 Jan 2018 06:44:33 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:42083 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753493AbeABLoa (ORCPT ); Tue, 2 Jan 2018 06:44:30 -0500 X-Google-Smtp-Source: ACJfBoulpEkrd8SjPpHiUdEZ17ExMWLYxSwwuLmq9rGo/8Gy7WpBeYc1/sGHBz1iRrlYt7V8npc3xFRnZbfQJmWdIGM= MIME-Version: 1.0 In-Reply-To: <1511089467-20525-1-git-send-email-geert@linux-m68k.org> References: <1511089467-20525-1-git-send-email-geert@linux-m68k.org> From: Arnd Bergmann Date: Tue, 2 Jan 2018 12:44:29 +0100 X-Google-Sender-Auth: U1FvNPsH44aFso9GL3IW9AGO_eg Message-ID: Subject: Re: [PATCH] thermal/drivers/hisi: Remove bogus const from function return type To: Geert Uytterhoeven Cc: Zhang Rui , Eduardo Valentin , Kevin Wangtao , linux-pm@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sun, Nov 19, 2017 at 12:04 PM, Geert Uytterhoeven wrote: > With gcc-4.1.2: > > drivers/thermal/hisi_thermal.c: In function ‘hisi_thermal_probe’: > drivers/thermal/hisi_thermal.c:530: warning: type qualifiers ignored on function return type > > Remove the "const" keyword to fix this. > > Fixes: a160a465297362c5 ("thermal/drivers/hisi: Prepare to add support for other hisi platforms") > Signed-off-by: Geert Uytterhoeven For future reference, this kind of warning shows up with gcc-4.2 as well, but not with gcc-4.3 or higher. I think in this case, both gcc and sparse fail to provide helpful feedback, but the code is probably better done using either a typedef for the function type, or with a structure containing the function pointer. Arnd