From patchwork Fri Jun 9 18:09:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 104787 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp603480vqr; Wed, 7 Jun 2023 18:44:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CcE4FXvm6gnq1Z6TMEhDD6KPYbyFuRr+40tBRN8xpCcG+HqwygfYc4cpNFbb48/0REl4y X-Received: by 2002:a17:90a:8586:b0:256:6462:e399 with SMTP id m6-20020a17090a858600b002566462e399mr901572pjn.5.1686188667647; Wed, 07 Jun 2023 18:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686188667; cv=none; d=google.com; s=arc-20160816; b=dqfE9KmY7d4xKjPN7M/En1W3GyMAO2uNKqulx3ivIWTDCYBHvo15L9GZc7oY4eQucR bMTU1qxA4vLtYH9vSFZaUY7tbUxd8z6plOOLSWYTyqPJXZjqMy0foLp+b8GwoRypesFT BsHY5zgJUgHkYP/s2vTiMUOv899ru4c69MNUIPUaO5L1njNA1GUNqRtTlVNCfQCMOqLA +z1kMXtWd+9X7C1+aHuCWNtL8cDgu9XcBSmQCilKk8sY1IaQIBOLxECH9BXCwGgBNjLF MifutGNX33IeQxSlJTEg+T+9soqYTR5q21B9m2q7oezLMECyROoh98ctoKqll2LPNiU8 ltTA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx12-20020a17090b4b0c00b00256976ca96esi223270pjb.126.2023.06.07.18.44.08; Wed, 07 Jun 2023 18:44:27 -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 S233065AbjFHBio (ORCPT + 99 others); Wed, 7 Jun 2023 21:38:44 -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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768096968536435642?= X-GMAIL-MSGID: =?utf-8?q?1768096968536435642?= 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);