Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751479AbeABRuW (ORCPT + 1 other); Tue, 2 Jan 2018 12:50:22 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:38949 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211AbeABRuT (ORCPT ); Tue, 2 Jan 2018 12:50:19 -0500 X-Google-Smtp-Source: ACJfBos1P7Asl8s0hPSxMG5dCRMJCDXcbkYzYg+TtDL/RuTqkepbOFawll3r/0iORoFx0AEZKXEPIg== Date: Tue, 2 Jan 2018 09:50:18 -0800 From: Eduardo Valentin To: Arnd Bergmann Cc: Geert Uytterhoeven , Zhang Rui , Kevin Wangtao , linux-pm@vger.kernel.org, Linux Kernel Mailing List Subject: Re: [PATCH] thermal/drivers/hisi: Remove bogus const from function return type Message-ID: <20180102175016.GA15928@localhost.localdomain> References: <1511089467-20525-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 02, 2018 at 12:44:29PM +0100, Arnd Bergmann wrote: > 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 Yeah, this is correct. I do not see the same warn while using gcc-4.8. > 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. I agree. > > Arnd