Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp754404pxb; Fri, 22 Apr 2022 10:26:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0orI6/EtRnFMeSek/0YgQ0kHfAWZ89nXSLMKltRUCU2TYbiNMdhrzhkt+xALSmcct+U5z X-Received: by 2002:a63:e915:0:b0:3aa:6b7e:91e4 with SMTP id i21-20020a63e915000000b003aa6b7e91e4mr4812802pgh.235.1650648375659; Fri, 22 Apr 2022 10:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650648375; cv=none; d=google.com; s=arc-20160816; b=oOY3BlpVxHezf5HzlrW2MNX9JYv8ZFz83pn0oJJfa/xfdGPdWx5wUqCet8vDsOY0bD dPEczTqXKYQIivU5UxpmAFcGixEXqfMFbYWBvbU2A137oazhLc5bLIIJJpPB4PTrj0c9 6meDDgO5ESLGiv7B776HgpUkhEtvTfTcKPTJxvO+mdquLSlLl9Txt+2+5Uvl54XspKkw OwEcDrD8VOxwNHniv/CVIdtQ+v//87ZtrAm4mWhqgg0nFm6wxe3fbrn9OaCpbpakqQ+v gesOq55h3ZYalXvugQwZrsrWH3Q2M4PrE1s5V+yOXJwAOU7qhgShjTpQ2+rRj1o9Njhn MYJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=hw695bHp/DUph/+bIfB7bKeFe7rI0ZPeTLkwp/31B+w=; b=kFy/gVKioyQpNZY94LNDSsUAvU9rEpMGCtJ+NcGSFNeaLzHSwK+kmPRpxu3cMCzc/W BF65HaorZ0eH9PIObJxy77cqvybgyrAAm0LK6Y7JUcB0a2I8drn7EZYYlIjsUf4Z63zr FliZwAlUUG2DYNjgZiF9wdohU4JQyzDJLg82czH728VPArS6kZ81lgi879BRaB7mMuO+ j/6eVVAVGsO1RI6pcA/eUxZl+t8CLQXqxcmiSgFD2ShgvZ0U6rLjzUzRBZUw1YbOxF5r WJyBqLGQUMR+vm9R5cdyI7Y6eiZkLluq282bQhsbWNRXxolnBeR2VLJkN27Q1FHxtiaq HAYw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x126-20020a633184000000b003816043f056si9857626pgx.587.2022.04.22.10.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 10:26:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E106BBC840; Fri, 22 Apr 2022 10:19:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382406AbiDUL7Q (ORCPT + 99 others); Thu, 21 Apr 2022 07:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241197AbiDUL7O (ORCPT ); Thu, 21 Apr 2022 07:59:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C589B2E690; Thu, 21 Apr 2022 04:56:23 -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 5F7D061BBD; Thu, 21 Apr 2022 11:56:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41798C385A5; Thu, 21 Apr 2022 11:56:21 +0000 (UTC) Message-ID: <291b141f-9f58-54c6-0005-fec0a9335dba@xs4all.nl> Date: Thu, 21 Apr 2022 13:56:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] media: amphion: fix error check return value of debugfs_create_file() Content-Language: en-US To: cgel.zte@gmail.com, mchehab@kernel.org Cc: ming.qian@nxp.com, shijie.qin@nxp.com, eagle.zhou@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Lv Ruyi , Zeal Robot References: <20220419013809.2561635-1-lv.ruyi@zte.com.cn> From: Hans Verkuil In-Reply-To: <20220419013809.2561635-1-lv.ruyi@zte.com.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/04/2022 03:38, cgel.zte@gmail.com wrote: > From: Lv Ruyi > > If an error occurs, debugfs_create_file() will return ERR_PTR(-ERROR), > so use IS_ERR() to check it. Actually, errors should never be checked for debugfs. See e.g. commit 1d8f95c497053839be326bd97eb3128e3b3312cb which removed unnecessary checks in drivers/media/radio/radio-si476x.c. Can you make a v2 that removes all the debugfs checks from this driver? Regards, Hans > > Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") > Reported-by: Zeal Robot > Signed-off-by: Lv Ruyi > --- > drivers/media/platform/amphion/vpu_dbg.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platform/amphion/vpu_dbg.c > index 376196bea178..5cef1fd41a74 100644 > --- a/drivers/media/platform/amphion/vpu_dbg.c > +++ b/drivers/media/platform/amphion/vpu_dbg.c > @@ -413,7 +413,7 @@ int vpu_inst_create_dbgfs_file(struct vpu_inst *inst) > vpu->debugfs, > inst, > &vpu_dbg_inst_fops); > - if (!inst->debugfs) { > + if (IS_ERR(inst->debugfs)) { > dev_err(inst->dev, "vpu create debugfs %s fail\n", name); > return -EINVAL; > } > @@ -451,7 +451,7 @@ int vpu_core_create_dbgfs_file(struct vpu_core *core) > vpu->debugfs, > core, > &vpu_dbg_core_fops); > - if (!core->debugfs) { > + if (IS_ERR(core->debugfs)) { > dev_err(core->dev, "vpu create debugfs %s fail\n", name); > return -EINVAL; > } > @@ -463,7 +463,7 @@ int vpu_core_create_dbgfs_file(struct vpu_core *core) > vpu->debugfs, > core, > &vpu_dbg_fwlog_fops); > - if (!core->debugfs_fwlog) { > + if (IS_ERR(core->debugfs_fwlog)) { > dev_err(core->dev, "vpu create debugfs %s fail\n", name); > return -EINVAL; > }