Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp132485pxk; Wed, 9 Sep 2020 00:41:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUin4giS5hMpgECkTZw1WAYukz65JEIwFk8x2AgW5dm8MSKSg+bA7NLMgZOFFpeQnsYO/i X-Received: by 2002:a50:bf47:: with SMTP id g7mr2817367edk.26.1599637282154; Wed, 09 Sep 2020 00:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599637282; cv=none; d=google.com; s=arc-20160816; b=r8vsd6KpC9QknLEdckKK06H1aBL0CZmZRvrDQcWkTo23JUZLYgdVDy2EgQansT8lJL Ob8SU6Au7AdSDhu/bX7gBF49//3W3iOaaGTPP3wVItTSwQ96uHALVeGUAz4DsYVkATD6 a4DejQWbUgvOByU6tghmCZovng9sbiwvbHjK3KnNh0kUINjF/QP3RWnQsp+vH4FuhkqS tMMwamPK9RRSODrOc8VNALptZG8GPTEIv1/unaESs8eyPs6YRmkjraPP/FwcNaWAS/Mj dbSKgg51CVdlGSGR9FYkHGrK7y9oi23EJvoS0rTvUzMJsI+cUVecZAIUDWGUwIV8q6ds t3eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=q5c/uOpelHtZa3OO33SgxWqxw+DMgGKY1mu7yrBui/c=; b=ZNuhvDrnJ0uYDIKeaTeOA9kCf1VLrLMJlZBa2ZrLcFlZwi5DHcQnNQECadMXvqc3oJ bhsJIRVtYmq6bYI40ZiQAiJSIaCiZ56DXwcQY7HRzXP92u6XqDl/ojcigtIj9Er2aSM+ Gt+JoXpKHwlkMSQ2Ll6zrcoW369d+AT33phr7m4x7PigP5vSKe2Dq36as48gvtRbT795 97VIbGUpNBRp+7OtiWjMpV4DnJcJafm44GEGeE/LgW6P5CN6+qz5yKfsIihvFjk/PUVg DqJLtAP5XKGieVmNqj5pgDSn+kpRCnF3p4hhC4mmuJxtCkRXyKKefVyYnSUBy+0pYHzD O+fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aRKeYoPd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si1024815edv.170.2020.09.09.00.40.59; Wed, 09 Sep 2020 00:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aRKeYoPd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730277AbgIIHhh (ORCPT + 99 others); Wed, 9 Sep 2020 03:37:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:44618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730260AbgIIHhG (ORCPT ); Wed, 9 Sep 2020 03:37:06 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7949620732; Wed, 9 Sep 2020 07:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599637026; bh=IO6r3KJjp/JFwGSMPo4xWi2ollridTbwoQYxHByZFVQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aRKeYoPdqKaLssElezrS6ihoIHfR2NnGSHiWt2UlFzmKIA0QrRUh4XFEkkWrWe6qv Vag/j/T4Br7kHkdOjNhRYkFZz8rFY6pHYOlT8Pe/ifeW3NGjYsW71soYB7iFP3q0EN Yiu/tFe+TcCaY2uSrRCFLTrX4lEP3YB5PgD4u6ps= Date: Wed, 9 Sep 2020 09:37:16 +0200 From: Greg Kroah-Hartman To: Krzysztof Kozlowski Cc: Andy Shevchenko , Andrzej Hajda , "linux-kernel@vger.kernel.org" , Joe Perches , "Rafael J . Wysocki" , Stephen Rothwell Subject: Re: [PATCH v1] driver core: Annotate dev_err_probe() with __must_check Message-ID: <20200909073716.GA560912@kroah.com> References: <20200826104459.81979-1-andriy.shevchenko@linux.intel.com> <9635eaa4ccc1141fb0dd8c3687f46da7149206ad.camel@perches.com> <20200826155507.GV1891694@smile.fi.intel.com> <973f4d54da796db4fcc9b643b10889cbc8839989.camel@perches.com> <20200909070244.GC311356@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 09:08:14AM +0200, Krzysztof Kozlowski wrote: > On Wed, 9 Sep 2020 at 09:02, Greg Kroah-Hartman > wrote: > > > > On Wed, Sep 09, 2020 at 08:29:25AM +0200, Krzysztof Kozlowski wrote: > > > On Wed, 26 Aug 2020 at 18:18, Joe Perches wrote: > > > > > > > > On Wed, 2020-08-26 at 18:55 +0300, Andy Shevchenko wrote: > > > > > On Wed, Aug 26, 2020 at 08:44:30AM -0700, Joe Perches wrote: > > > > > > On Wed, 2020-08-26 at 13:44 +0300, Andy Shevchenko wrote: > > > > > > > > > > ... > > > > > > > > > > > > -int dev_err_probe(const struct device *dev, int err, const char *fmt, ...); > > > > > > > +int __must_check dev_err_probe(const struct device *dev, int err, const char *fmt, ...); > > > > > > +Cc Stephen and Greg, > > > > > > Hi Andy, > > > > > > Did this patch ended up in next somehow? I am surprised because now I > > > got warnings for perfectly fine code: > > > https://lore.kernel.org/linux-next/20200909155654.76fe3bd6@canb.auug.org.au/T/#u > > > > > > This creates simply false warnings instead of hints for "optimization". > > > > Yes, it got merged into m y driver core tree. > > > > I'll fix up the tty build warning, should be easy enough, the patch is > > below. > > Yes, this fix suppresses the warning but the question is whether we > really want the warning? > Such fixes mean additional code which the compiler might not optimize > (unless it inlines the dev_err_probe()). This additional code is > purely for suppressing the warning, without any meaning on its own. > Actually it might be even confusing for someone to see: > if (ret) > ret = dev_err_probe(ret); Yeah, that is dumb, as the patch I made shows :( > warn_unused_result should point errors, not "optimization > opportunities". If you want to have opportunity, add a coccinelle > rule. Or a checkpatch rule. Not a compiler warning. Ok, I now agree, I'll go revert this patch and trust that driver authors will "do the right thing" here... thanks, greg k-h