From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A662CC2BA2B for ; Sun, 19 Apr 2020 07:40:59 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29E4E2145D for ; Sun, 19 Apr 2020 07:40:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="U9g/Jj2L"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Pbh2gwHB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29E4E2145D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8C3C3167D; Sun, 19 Apr 2020 09:40:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8C3C3167D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1587282057; bh=MuglAtA0oQ797Z2soSrZe+rihqMksDe9WI21lAY9O9o=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=U9g/Jj2L5ZrWgHhfTd8cCtRjmuYL/68jzQqSzoUn1/XTCj6SVWWfod0/wWXilDsRW wziHLqbM1sdRk2bg3DGo3nxmpDGXGngU4q8Og0kK1Qqxw5+81dW3l85yJ+Dz/KNJOC J1X/KXVftthBxoG00cHmp6uBaAXpHdRF0TyYHyXo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 63972F8028B; Sun, 19 Apr 2020 09:38:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 62109F8014E; Sat, 18 Apr 2020 21:13:52 +0200 (CEST) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DEBD5F80122 for ; Sat, 18 Apr 2020 21:13:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DEBD5F80122 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Pbh2gwHB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1Xuy0hbaik5jnBw+JX74GiEbxwfdlzrwJ6CXAcCNKJ0=; b=Pbh2gwHBC+0n9j0XheYbIXwFQj DLH/6PgobmCWmxlogha43zhUGSOtU89tXwjVH0o1Rho/S2T2EjJTPG70nmSsvSMvvLuonOlXdkiEF yGJpGvfRz2PkLCG7L7Uy3m9lgzRa8kBf6U42WpkqqxMc3bt3hK4TRhmhD0zC1q2wsbCa9130nX/Tr BTyG4Wi0/MtCFbctxHGNP3IoIr9AwF92URUTCaCCqCq81Wkivc6Os9SxUDznfhAgxmUgbP9sTqTjg OQaGKDbNC89jhx9AoLbm18DH/xji73LaoYjLqiNC454x2nCt2c/0XKhdkme0M37SQxFbl37OzjXm7 wpboRveg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jPsuI-0002hx-99; Sat, 18 Apr 2020 19:13:38 +0000 Date: Sat, 18 Apr 2020 12:13:38 -0700 From: Matthew Wilcox To: Joe Perches Subject: Re: [PATCH 7/9] drivers/base: fix empty-body warnings in devcoredump.c Message-ID: <20200418191338.GR5820@bombadil.infradead.org> References: <20200418184111.13401-1-rdunlap@infradead.org> <20200418184111.13401-8-rdunlap@infradead.org> <20200418185033.GQ5820@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Sun, 19 Apr 2020 09:38:23 +0200 Cc: alsa-devel@alsa-project.org, Randy Dunlap , Zzy Wysm , linux-kernel@vger.kernel.org, "J. Bruce Fields" , target-devel@vger.kernel.org, Dave Jiang , linux-scsi@vger.kernel.org, linux-nvdimm@lists.01.org, Vishal Verma , Chuck Lever , linux-input@vger.kernel.org, Alexander Viro , Dan Williams , Andrew Morton , linux-nfs@vger.kernel.org, "Martin K. Petersen" , Greg Kroah-Hartman , Dmitry Torokhov , Takashi Iwai , linux-usb@vger.kernel.org, linux-fsdevel@vger.kernel.org, Johannes Berg , Linus Torvalds X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Sat, Apr 18, 2020 at 11:55:05AM -0700, Joe Perches wrote: > On Sat, 2020-04-18 at 11:53 -0700, Randy Dunlap wrote: > > On 4/18/20 11:50 AM, Matthew Wilcox wrote: > > > On Sat, Apr 18, 2020 at 11:41:09AM -0700, Randy Dunlap wrote: > > > > @@ -294,11 +295,11 @@ void dev_coredumpm(struct device *dev, s > > > > > > > > if (sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj, > > > > "failing_device")) > > > > - /* nothing - symlink will be missing */; > > > > + do_empty(); /* nothing - symlink will be missing */ > > > > > > > > if (sysfs_create_link(&dev->kobj, &devcd->devcd_dev.kobj, > > > > "devcoredump")) > > > > - /* nothing - symlink will be missing */; > > > > + do_empty(); /* nothing - symlink will be missing */ > > > > > > > > INIT_DELAYED_WORK(&devcd->del_wk, devcd_del); > > > > schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT); > > > > > > Could just remove the 'if's? > > > > > > + sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj, > > > + "failing_device"); > > > > > > > OK. > > sysfs_create_link is __must_check Oh, I missed the declaration -- I just saw the definition. This is a situation where __must_check hurts us and it should be removed. Or this code is wrong and it should be WARN(sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj, "failing_device"); like drivers/pci/controller/vmd.c and drivers/i2c/i2c-mux.c Either way, the do_empty() construct feels like the wrong way of covering up the warning.