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=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 33C6FC3A5A0 for ; Sat, 18 Apr 2020 19:17:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A901221E9 for ; Sat, 18 Apr 2020 19:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728153AbgDRTRS (ORCPT ); Sat, 18 Apr 2020 15:17:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727947AbgDRTRR (ORCPT ); Sat, 18 Apr 2020 15:17:17 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B611C061A0C for ; Sat, 18 Apr 2020 12:17:17 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jPswv-00APdE-Hr; Sat, 18 Apr 2020 21:16:21 +0200 Message-ID: Subject: Re: [PATCH 7/9] drivers/base: fix empty-body warnings in devcoredump.c From: Johannes Berg To: Matthew Wilcox , Joe Perches Cc: Randy Dunlap , linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Alexander Viro , linux-fsdevel@vger.kernel.org, Dmitry Torokhov , linux-input@vger.kernel.org, Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, "J. Bruce Fields" , Chuck Lever , linux-nfs@vger.kernel.org, Dan Williams , Vishal Verma , Dave Jiang , linux-nvdimm@lists.01.org, "Martin K. Petersen" , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, Zzy Wysm Date: Sat, 18 Apr 2020 21:16:19 +0200 In-Reply-To: <20200418191338.GR5820@bombadil.infradead.org> References: <20200418184111.13401-1-rdunlap@infradead.org> <20200418184111.13401-8-rdunlap@infradead.org> <20200418185033.GQ5820@bombadil.infradead.org> <20200418191338.GR5820@bombadil.infradead.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-04-18 at 12:13 -0700, Matthew Wilcox wrote: > > > > > > 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"); Perhaps it should be. I didn't think it really mattered _that_ much if the symlink suddenly went missing, but OTOH I don't even know how it could possibly fail. johannes