Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp44862rwd; Wed, 7 Jun 2023 19:03:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JjwIIbEi182MEWiOJMYkdDx1zapfeu3LbrjVlFWzFyKnkG+8eUp5nyj0OuItszT3biH39 X-Received: by 2002:a17:903:445:b0:1b0:ec0:7cff with SMTP id iw5-20020a170903044500b001b00ec07cffmr796679plb.10.1686189789329; Wed, 07 Jun 2023 19:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686189789; cv=none; d=google.com; s=arc-20160816; b=UUS5r4cNbLH0pyrQKGIPtiKCQoEO1dWx5T7uj/d/YtR6loeLZPkQrDkhlxAIUcxNJP Bo+BxDW52hNe3zphotfQ4oCb5KPydMxr7NiZRo0idUwLlb0c2Khm2XJPT//i+EA06uua ZsstdfNsDkHzKi53ID0DmY1Nh/K6Qesm3LothFrVf8a1Mcl8KV3ygprYnZp8Qbs0EcDo 8l3Uw/n2zFqodnnOF7MGmJf0TaFAVI8IQ82fdOAc9n54QDtyK3OlUdQMM4mYfkF9OU7v 8dWkaShd2gfok/RixEy3KiFjLpCpU4Db8B2oG/CiJRnnnKwTv9E61d9qipni0AMQItCb apqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=cZC4ol6tSgCIGDrXFa8FEa0SNOxgQ4NkQWfzoXUxZyc=; b=dzVrZ1NxRRBe2fYCVOj5MH7RLcLdn4l3LfnJL0iEhNxgcTBOwYJzuXUtNTq5uJ2LdT Fmq0VrVhE2Th1yEMnawgJc0iO2HGjYgz0rkVloaIVeFvpKNH0oHPe9K7n2WI+XcSS7ty CUyVitSVLRoT6WKP3dNfDBVcoaBGIPTQ9P/a/XZf6b1dEbiBcyALCTkQpl5mb4ndRaZn Dr4btwk4J/XtVNzYhO7damLySup6PsOAS3xoAMss8yxJRa8xrv9b4RkCNkkp+NyLcd0Y qKBfnH9TG8BViQHoRw0WvCQu1t2o64o+bcgLw6WxxXOLtwFn6I2OjPrXe7QsxciV5qAw 4GSA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju19-20020a170903429300b001b039693da8si215717plb.635.2023.06.07.19.02.56; Wed, 07 Jun 2023 19:03:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233030AbjFHBin (ORCPT + 99 others); Wed, 7 Jun 2023 21:38:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjFHBim (ORCPT ); Wed, 7 Jun 2023 21:38:42 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 21ED01FF3 for ; Wed, 7 Jun 2023 18:38:40 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id C0E5C1801128C4; Thu, 8 Jun 2023 09:38:37 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: jstultz@google.com, tglx@linutronix.de, sboyd@kernel.org Cc: linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] time: alarmtimer: Optimization function return value Date: Sat, 10 Jun 2023 02:09:55 +0800 Message-Id: <20230609180955.4357-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=4.3 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RCVD_IN_SBL_CSS,RDNS_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: **** 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 Replace -1 return values with -EPERM. Signed-off-by: Li zeming --- kernel/time/alarmtimer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 82b28ab0f328..e918d556dd51 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -92,9 +92,9 @@ static int alarmtimer_rtc_add_device(struct device *dev) return -EBUSY; if (!test_bit(RTC_FEATURE_ALARM, rtc->features)) - return -1; + return -EPERM; if (!device_may_wakeup(rtc->dev.parent)) - return -1; + return -EPERM; pdev = platform_device_register_data(dev, "alarmtimer", PLATFORM_DEVID_AUTO, NULL, 0); @@ -104,7 +104,7 @@ static int alarmtimer_rtc_add_device(struct device *dev) spin_lock_irqsave(&rtcdev_lock, flags); if (!IS_ERR(pdev) && !rtcdev) { if (!try_module_get(rtc->owner)) { - ret = -1; + ret = -EPERM; goto unlock; } @@ -113,7 +113,7 @@ static int alarmtimer_rtc_add_device(struct device *dev) get_device(dev); pdev = NULL; } else { - ret = -1; + ret = -EPERM; } unlock: spin_unlock_irqrestore(&rtcdev_lock, flags); -- 2.18.2