From patchwork Tue Nov 1 17:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13822 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3117533wru; Tue, 1 Nov 2022 10:57:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Rli5J1Tg+owXSMYcEQdHm7DJ7g0PI/C3E4e+3FgB0Gtf/OJETf/7Eja38rZ4vfP9b2PNQ X-Received: by 2002:a63:f346:0:b0:46f:6aff:b5ea with SMTP id t6-20020a63f346000000b0046f6affb5eamr17531640pgj.461.1667325437366; Tue, 01 Nov 2022 10:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667325437; cv=none; d=google.com; s=arc-20160816; b=MyU4vegxaQXOdkyMSzjycwM81LxRoBlofpdRcsUfEf8ko6N0zuRdIMs3knMgdLMCnP YqR4jQ6hucH9XQwqJemxRGAcsR2wCskiDhk2NlanQ0WV46Mstg07WFUWNFX+Dba1aeJS F8ozCuDE3cBExN30aQgbENBA6AX3L5VEPAaLfAZu4+Yh8Edy1DXqEhde+X1q2Z+OZmcy SHb8uFl7cfZiPoeaPS624XL4V9xkusdGei1TffF0fC6Pws5U8OIB25pPEzDbHY/Q62ZL +DkIViV4xSAWRKLo1INm/aYgpwyoII/OJlscSetmCGwh2c2M43CZhdyVdAMgGANxa6ue WwcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gcUszgcXB++WQ3rZU9ZUH65xdwxI+QkjQfVNfYzU3rM=; b=xqP4aKNJsKIfMJD2UnIi05CD4KUAbGGw+WKRYHOZRhKwGmCt3z+FxrDuTZ+5/fUdTU Emx+1aj+4aPu/G4N4TyuIquzWBLtycUWBessrdjm8aX77NW8DFKsz+JrhG0PgUvguf0z FIvXjcGPSxTMAkhPkt2u7ofkAd9IOtuHtK5fgp5ho4RjsnBMWMw+mM9lzBCUjT4RMLCv Eoy6p+Px9knQrcY0Ka9XtvlDUZz4lGFAecqdsVjHc3fJrZ18FVdiC/tWcH8c9WyaPTNx LQK5qj0fgczH8ggubq4FLytofdJgGa28ITJsJE/S7VUkuKO2akM5ryTPCbgM1zzZq74k LNcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fklKvWAO; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r200-20020a632bd1000000b0045fc63bf52csi13356427pgr.764.2022.11.01.10.57.04; Tue, 01 Nov 2022 10:57:17 -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=@intel.com header.s=Intel header.b=fklKvWAO; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231226AbiKARmo (ORCPT + 99 others); Tue, 1 Nov 2022 13:42:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbiKARmi (ORCPT ); Tue, 1 Nov 2022 13:42:38 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AE801D32F; Tue, 1 Nov 2022 10:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667324557; x=1698860557; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oHHuxOzKVmiUxNopbnR8MZfBR9TH3eINRdcTm5mkIiE=; b=fklKvWAOUgxhzBXbMRj5KmpjzVkklz7DrGUEHl/9Azl4UlH4QPnrx4KI 2U2l9f0srdspN3xAKUoRTJRXT8Hx6830ysDtufjZjXpKWRklHGys4QvjK FhGRZWlG5l7vWuLRFbarirYzgMOrA9mFK8Owudpx0gjZAxIY3IwW52/Mh qrfcoxhtebX942LxJkOsXp/8Liw8cgqNlV2Cyo0oJf8faF1p6X0mPQBj4 GlSs26tDp7HfdDHSa1yAKfDSr0QCkaMOD1psJhH+JdO8Y97VVEN2JfGW5 dVFXQJyJeQH0Ng/O12F4SjrjEpfCfTLXExCBP/pS/Gg8k4lFfKImrxx3o A==; X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="292506333" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="292506333" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2022 10:42:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="636478620" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="636478620" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 01 Nov 2022 10:42:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DBDAAF7; Tue, 1 Nov 2022 19:42:57 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Thierry Reding , Andy Shevchenko Subject: [PATCH v1 1/3] pwm: core: Refactor pwmchip_add() to avoid extra checks Date: Tue, 1 Nov 2022 19:42:53 +0200 Message-Id: <20221101174255.54452-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748317437689907922?= X-GMAIL-MSGID: =?utf-8?q?1748317437689907922?= When we already know that everything is fine there is no need to use ret variable. Refactor code accordingly. Signed-off-by: Andy Shevchenko --- drivers/pwm/core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index d333e7422f4a..855abd0a776f 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -296,16 +296,16 @@ int pwmchip_add(struct pwm_chip *chip) INIT_LIST_HEAD(&chip->list); list_add(&chip->list, &pwm_chips); - ret = 0; - if (IS_ENABLED(CONFIG_OF)) of_pwmchip_add(chip); -out: mutex_unlock(&pwm_lock); - if (!ret) - pwmchip_sysfs_export(chip); + pwmchip_sysfs_export(chip); + + return 0; +out: + mutex_unlock(&pwm_lock); return ret; } From patchwork Tue Nov 1 17:42:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13824 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3118044wru; Tue, 1 Nov 2022 10:58:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5qQ+WmRmjF/bh5GmxPdGDkFgYZe10LYlO7sdK9f12wlnqH1IWgqotIWaHZmveCO2RjvSek X-Received: by 2002:a05:6402:3457:b0:463:2017:ae64 with SMTP id l23-20020a056402345700b004632017ae64mr16254426edc.218.1667325506313; Tue, 01 Nov 2022 10:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667325506; cv=none; d=google.com; s=arc-20160816; b=DyCwWXggwouLK17pbtlXqSb4kqAUWTXZP7MWlYmikb3qhCSkernyRXqceimRoLc+Ag MH9YX04ccYe8zUDUZuuAIQ5ARNZp5C0vi1eoFG2PHPP7OXiAP9ZZpj/MK/NqSzkQ0Yct LE79+HuSdjUsmznUU6KaMtGYc7VH/8UzFfoDg4dqkbVsE6UDYh7dtuS8TyPRirItC8+a reGfeMxgOL9Dh0EsnTiRaSLf0CFEU6AaqoLEObDCQlaLYHGMCMEoykvoF0pz1bfFFHni BO4qe9jr3rALrUQjvX8NuHFMArvz5kKQ0SOjSkcs/Ur/xfYZJC+kZ3J22dqMcdz77w8+ dppQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HEUiHc3BepZuFlGCqCQWhynG2hvpPI9P6H+Mmkh1zoY=; b=vJRp6NPWvRM6tLPV5CJLAJfc71Czs79J9W7+k4EqP4pHU4pQsvO/qtKIUGzHKExPOa 2xSBmuqE6J/L4iMiG6x+5Qn87EDxQ4TxFdglHk5HwbtQ9bqJVrR5mKO4bBs3DyqmILuA wIVRtdHnyB/xqV9miDU3W2lyMcJxGtprK3IN5Z/Wb/+L7xF2FT3kp7Htz315bJ0UBvYd yWKWGp7jPXzot37ONKFQe1JbYAyjexlTa0bAuX52QDtCtzwFXxMkEo57tq8EPz3PYQMJ DIXePFe/tGagr7HmQiGYuWO5ivHUB349IRf2sXxnoZl0AXrRXGQjraDSSkVSowXbboLo an/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iJSkEHUZ; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k14-20020a170906a38e00b007803449809esi9623760ejz.355.2022.11.01.10.58.02; Tue, 01 Nov 2022 10:58:26 -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=@intel.com header.s=Intel header.b=iJSkEHUZ; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231244AbiKARms (ORCPT + 99 others); Tue, 1 Nov 2022 13:42:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230435AbiKARmi (ORCPT ); Tue, 1 Nov 2022 13:42:38 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EAAB1CB08; Tue, 1 Nov 2022 10:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667324558; x=1698860558; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F1q8w57mHPaiy0oFIx6dL3sLIgTgPFyzkabGHkE+Pbc=; b=iJSkEHUZQ80xSdg39ECByhFTNzrHmEvw8DSAsj/dlRlse1IiSyRX000p VU0EgYah5iHP34oZMH8E2/shn0CdaBnU/AarVMHraz1O8Ro5i1vHK+z/m cv79dJcu2PrsCnJL8RHZm6H/BO17K0kd6iVDaVNbbST5osAbxQmGww+cV JiY5IVEqIWA7dinya60RUSwoRiUwrt/L3ait5RT39o9/oEEi/JwGIlBGw O9WFwW0vEFhtrn8l6ZfYLo8P6b0p4p3oAEYTG5X/vxylKmegFmg1Xq9kX trZpCTn4p7EwLrt9+VjW3Ns37xrBWkwirnGHcFGucTsKO+etum8nQgUiZ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="310909165" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="310909165" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2022 10:42:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="667272869" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="667272869" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 01 Nov 2022 10:42:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E71DCD0; Tue, 1 Nov 2022 19:42:57 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Thierry Reding , Andy Shevchenko Subject: [PATCH v1 2/3] pwm: core: Drop unneeded casting in pwm_seq_show() Date: Tue, 1 Nov 2022 19:42:54 +0200 Message-Id: <20221101174255.54452-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221101174255.54452-1-andriy.shevchenko@linux.intel.com> References: <20221101174255.54452-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748317509974804745?= X-GMAIL-MSGID: =?utf-8?q?1748317509974804745?= The casting form void * to char * is not needed and done implicitly. Signed-off-by: Andy Shevchenko --- drivers/pwm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 855abd0a776f..36128f3301ac 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -1158,7 +1158,7 @@ static int pwm_seq_show(struct seq_file *s, void *v) { struct pwm_chip *chip = list_entry(v, struct pwm_chip, list); - seq_printf(s, "%s%s/%s, %d PWM device%s\n", (char *)s->private, + seq_printf(s, "%s%s/%s, %d PWM device%s\n", s->private, chip->dev->bus ? chip->dev->bus->name : "no-bus", dev_name(chip->dev), chip->npwm, (chip->npwm != 1) ? "s" : ""); From patchwork Tue Nov 1 17:42:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13821 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3117091wru; Tue, 1 Nov 2022 10:56:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Go5sRbpVkggnGrydXKqKojuXX0d3Z6osggwVTu4sOD8XDStDuTFLm3G0wn0y+cS8GOHsO X-Received: by 2002:a17:907:8a18:b0:7ad:a942:f0e2 with SMTP id sc24-20020a1709078a1800b007ada942f0e2mr19699447ejc.119.1667325378672; Tue, 01 Nov 2022 10:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667325378; cv=none; d=google.com; s=arc-20160816; b=GqE0lU124H+kR2GTkdk7tLJKKNAbWhGIE4wOOUw9BNnrHDq7J+w61x7rSdQBWQz2mE Lgi+RpFs2k4luUYfG9SiLl5bNJhQ32eoeYpN4wpm3GNUWC8rCpJhIOSQMFsuCllDWei3 bIw5qL4WQdc709tIIgMoy/+WlNXyWDYJO9TfhZ14B1gdV7LcpUY5ft61ViVUwQh8+dRi S//MpsiJ1uYzuIC0jPwFhO0MZ6eA4NyVztH211bZIIbptpsLhCRmjS4cg8F+dQU9p+ho xJsRtJSD/jC/VitGqf1Is+kGyBrA6kSm77BdFi5zlC9s/p6eLb/L4RCot0VWbCEagx28 vSRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6r3zcfqJicr1tQdJcajG3H5MhCXcKfS3DgwTBniaNvA=; b=hqxybvORRQSQANhKVi4gkkqAajoVvNAY3j8c8c86P6bseRmKqApsg3+D+a0yVgshaC LNiF2t0JQVvPVSOkAqFHPU5NzaslDTlJaBw/v69weAqT10Q6GOrvfdq2o2CCzqU78TA1 b45DR56+/peugFXPHbJ79Np/Os2okzUjsA2PyW9aRDtsU2WRiXNCE4YxCem3MXUFZxUi p1khgKK2C3FG2gfzpWXJd2ACW49UwOfbC/fYoONqIDQU7Pmb9eijCyxJFE8xqK8d/oSQ JuTtaEt4R/y0qRUtkZVXxaxGx0e6mVAVnMCOk8sW9CQIskP4Fg2Cyt8Pn6327m8y+T6D ID3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Uvmfhpia; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne3-20020a1709077b8300b007aa6ce58d9asi13360728ejc.712.2022.11.01.10.55.54; Tue, 01 Nov 2022 10:56:18 -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=@intel.com header.s=Intel header.b=Uvmfhpia; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230340AbiKARml (ORCPT + 99 others); Tue, 1 Nov 2022 13:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbiKARmi (ORCPT ); Tue, 1 Nov 2022 13:42:38 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB5BA1D0E6; Tue, 1 Nov 2022 10:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667324556; x=1698860556; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SbsFTojRHajkqxc6yQDWgDcq4VABF214el1jsXeM55s=; b=UvmfhpiaRo9PXBsFqP7lwaYFwVpHuEjJuZ95TSl3D03DvPY5iOXrJcAc yzXCEJW0Hgg6GI1v8CWBUg2/GIXvr/OnHiTmFXD5RS6Y8PaSz8BfqMnPI 6NdVm0Ya9UVk9Fop2Y7g13bsMk4F3719YJVLKg71AcpFKM3PHFtfZgfD7 8vz9kK1ZZQdNGMuFHW3h8Iq1sfRBBQ111Gho8j1yvhUKjvZojuvN6gBdk rZwXhk1uX8a5SxiJ6nX8+o0YcGXQASgciaEW6XEjadf8tB0krJOEwmG5c zG7ZBS+ImcEoAT5Y2HBs5mi53FVOlzFGXCHp8zc8rEgDg1v7Fl3KcaxvN g==; X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="310909163" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="310909163" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2022 10:42:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="667272870" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="667272870" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 01 Nov 2022 10:42:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id F008F155; Tue, 1 Nov 2022 19:42:57 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Thierry Reding , Andy Shevchenko Subject: [PATCH v1 3/3] pwm: core: Remove S_IFREG from debugfs_create_file() Date: Tue, 1 Nov 2022 19:42:55 +0200 Message-Id: <20221101174255.54452-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221101174255.54452-1-andriy.shevchenko@linux.intel.com> References: <20221101174255.54452-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748317376669688839?= X-GMAIL-MSGID: =?utf-8?q?1748317376669688839?= The debugfs_create_file() already has a check and adds S_IFREG automatically. Remove unneeded flag. Signed-off-by: Andy Shevchenko --- drivers/pwm/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 36128f3301ac..c004a8a662d6 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -1179,8 +1179,7 @@ DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); static int __init pwm_debugfs_init(void) { - debugfs_create_file("pwm", S_IFREG | 0444, NULL, NULL, - &pwm_debugfs_fops); + debugfs_create_file("pwm", 0444, NULL, NULL, &pwm_debugfs_fops); return 0; }