Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7466435rwd; Tue, 20 Jun 2023 01:25:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7B3dftj33y2O9f+xXgbouRZQ7HQp5b555ReDgN9DUqfp8eSXB21r//kSt+wxEA6G1WLORF X-Received: by 2002:a05:6a00:2e1f:b0:647:7ee8:6251 with SMTP id fc31-20020a056a002e1f00b006477ee86251mr16976842pfb.21.1687249519454; Tue, 20 Jun 2023 01:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687249519; cv=none; d=google.com; s=arc-20160816; b=EuItkms3iaACH/SX8OCDdq7Slf/8+S8V//qmc4+4SuOfdlvMA21haRffU2TVcEEWsm VuEgyDAhyl9TNIX0iZ395It91VCTjFItDQDKjk4o2pMmB4ajCT9iuvFcafRcTwYGjwJr 3iq2NUHkUZ7sCk9pX41JsXynouxzoRcnymwQITciF3oxP6csiLFhOVECOqY7GBSbbCkV TOSxnUKHlwbbD8YPlzRTo2pK+dSw0DKvJ+vFH3sEwbCaZLupyL2wTdz77w5MU4toTvlP aqr0aCFpQKhNmrqPgt9Fsb3Q5nZjqAfgL+CB93FN3XHrYRu1qFXtqK7w24pdJEn2OKPr +LpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=dpAf75Epa+861D9oY47tt3qyQ5zTBW5nFqUpj0OqmkY=; b=yJXIewURUyzJ8/owX/BBx1Ke7ZnND0aCnOiozRavOvCsaAM63Rni/qz2I6ADIFwkji 94ENaCwh3ax0YBZod3iuDNsPfPW3Gy9ZNDgB5IVfGjC8akcBjN8i0NRl3ZIFq8xEV4HT BoYl0X6Kv4pzPAoZgvhchgrMFnNX+R3PmNi0TtjERKI3FqogbikKChfz09ic/14VSrc/ 3WaklrdepEq/owltKr8Nr37wdJZmHeeJ+s0F6i4ZM6mRYvMWMbGYlCVlk0z03Y1mG4KP GKXyTuacnQV5LOfE/ykYQyPlY77iGrilrgJIpP1M5hhsjnifril2kYCEQDLR62cngVRc sj0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NoKTco0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i24-20020a633c58000000b0054fec1e94d7si1216477pgn.705.2023.06.20.01.25.06; Tue, 20 Jun 2023 01:25:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NoKTco0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231234AbjFTIGy (ORCPT + 99 others); Tue, 20 Jun 2023 04:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231731AbjFTIGn (ORCPT ); Tue, 20 Jun 2023 04:06:43 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E448CE72 for ; Tue, 20 Jun 2023 01:06:41 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f9b4a71623so11262275e9.1 for ; Tue, 20 Jun 2023 01:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687248400; x=1689840400; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=dpAf75Epa+861D9oY47tt3qyQ5zTBW5nFqUpj0OqmkY=; b=NoKTco0j3qXXxRS4tA6dTQdBwGyaAIqG8priYh8yO7q/N5QHL7J4gihRXmYSgneAv9 OB8Rzi9P2DzQDHw4wmh3vIqHiteD8ebBbrIb99MAYl0uEKDG4PyYYjm4tMJgPAjEJdX1 HJgG4gqMXxUFkE1caDD3JpznsxPWCBvPYXXH0LzbM4IdvCmIBNi+2rH7cEKCz1Go8b1I V5nt2C0tOeCRH1TknlOGg8pu4SDFB34+d4Shnce48xVYdZsp4OgUBj2rwno43qSZ+h8P 9K3KkOyQWFXYd1StonSOUuhZZhTE1ofk/TajhZIKP4peVK5H1d7NW5Ah+/sbBNda4a7k s1cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687248400; x=1689840400; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dpAf75Epa+861D9oY47tt3qyQ5zTBW5nFqUpj0OqmkY=; b=iMG84scKqmb/VxPUmnScCtsHsHjfp5fYfQOjFs/2C7NVbYr09n0NQ+Qt3dE/UyYlXk zuFYwA+FgVBWQPF7K+8R4qc0qaA4wecUyPNPpAje6AM8iLeJbmpb3K6S6P35ahyvEK7E NJXM1qL8Swt8f/8JsR0Ccq3GzLvmO/wEXF/0OceMzmnWizI6Sgk+M8+C8uAdU3uWI+TJ 3xleMio+DDlLD+f1CArPs48BIuuUtOOhNcp7oGtrPSGA4rDwB8Gk/gmu0wFF0Ek00JgM of2T5RJQAQNXlo4ngTLSef2ACKhIXzXwiej+zsSq9ZDrUAeFZbyRx+EUQGqYDUbKGRsB r21w== X-Gm-Message-State: AC+VfDxeUU4iOwBRM7QdW+xUBi+5JRCMLfiBRR3MoAP1Sb+A0b3JPlXI Son5+2uYBXMaFHDA2GSxv2pj8A== X-Received: by 2002:a1c:4c14:0:b0:3f9:b0c2:9ff7 with SMTP id z20-20020a1c4c14000000b003f9b0c29ff7mr3182486wmf.30.1687248400328; Tue, 20 Jun 2023 01:06:40 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id k9-20020a7bc409000000b003f9b24cf881sm4093945wmi.16.2023.06.20.01.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 01:06:38 -0700 (PDT) Date: Tue, 20 Jun 2023 11:06:34 +0300 From: Dan Carpenter To: Ivan Orlov , Immad Mir Cc: WANG Xuerui , Huacai Chen , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] LoongArch: Delete debugfs checking Message-ID: <7627f2b9-2287-46d2-b461-d33aa69931a8@moroto.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Debugfs functions are not supposed to be checked for errors. This is sort of unusual but it is described in the comments for the debugfs_create_dir() function. Also debugfs_create_dir() can never return NULL. Signed-off-by: Dan Carpenter --- I spotted this code because I was looking at patches which were sent to stable but without a Fixes tag. The correct way of checking for error pointers is not IS_ERR_OR_NULL(), it's IS_ERR(). When a function returns both error pointers and NULL, the NULL should be treated as a special kind of success. Please see my blog for more details. https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/ I have not included a Fixes tag here, because it's not really a bug fix, it's just a clean up. arch/loongarch/kernel/unaligned.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/loongarch/kernel/unaligned.c b/arch/loongarch/kernel/unaligned.c index 85fae3d2d71a..3abf163dda05 100644 --- a/arch/loongarch/kernel/unaligned.c +++ b/arch/loongarch/kernel/unaligned.c @@ -485,8 +485,6 @@ static int __init debugfs_unaligned(void) struct dentry *d; d = debugfs_create_dir("loongarch", NULL); - if (IS_ERR_OR_NULL(d)) - return -ENOMEM; debugfs_create_u32("unaligned_instructions_user", S_IRUGO, d, &unaligned_instructions_user); -- 2.39.2