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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16B02C43334 for ; Mon, 4 Jul 2022 16:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234642AbiGDQNr (ORCPT ); Mon, 4 Jul 2022 12:13:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231276AbiGDQNp (ORCPT ); Mon, 4 Jul 2022 12:13:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9360C4A for ; Mon, 4 Jul 2022 09:13:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 45B2361166 for ; Mon, 4 Jul 2022 16:13:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24786C3411E; Mon, 4 Jul 2022 16:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656951223; bh=RA5+nJVfyyxORQFFFt6cc+rkcFqdB9b06K8VFwbLg4U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ny57otLLk69XK/SfQxDvP6w01zcE3ARJvIfVOjz65diQmAEvDlapBV+QpEHmBeIiQ dJ0Vp3b0yjMwrT/Q2kW32vjEDrYvvRi14g4hgM5EVw/37qOpw/exH+DDIftoV1lXpI G4BmSjVFYpMeoR6kdarV2Xx9JXg8TvsS2GGtnDKE= Date: Mon, 4 Jul 2022 18:13:40 +0200 From: Greg Kroah-Hartman To: Carlos Llamas Cc: Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Christian Brauner , Joel Fernandes , Hridya Valsaraju , Suren Baghdasaryan , kernel-team@android.com, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH] binder: fix redefinition of seq_file attributes Message-ID: References: <20220701182041.2134313-1-cmllamas@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220701182041.2134313-1-cmllamas@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 01, 2022 at 06:20:41PM +0000, Carlos Llamas wrote: > + binder_for_each_debugfs_entry(db_entry) { > + dentry = binderfs_create_file(binder_logs_root_dir, > + db_entry->name, > + db_entry->fops, > + db_entry->data); > + if (IS_ERR(dentry)) { > + ret = PTR_ERR(dentry); > + goto out; > + } I know this is a copy of what is there already, but there is never a need to check the result of a debugfs_create_* call. Just call it and move on, never "abort" based on the result of a debugfs call, that's not a good idea. So can you change this here, or want to send a follow-on patch that removes these checks? > } > > proc_log_dir = binderfs_create_dir(binder_logs_root_dir, "proc"); Also there's never a need to save a directory, you can always look it up when you want to remove it. thanks, greg k-h