Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp502150rdb; Mon, 29 Jan 2024 08:42:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvls08P9si+sBU7KYKFI+7NIXJB1UGoEs3pzH0MU0lR2xJCmxWV3JNj4VKnBTH9FCEfBuZ X-Received: by 2002:a05:6a20:dd04:b0:19c:a0f0:b0ea with SMTP id kv4-20020a056a20dd0400b0019ca0f0b0eamr3960976pzb.19.1706546531295; Mon, 29 Jan 2024 08:42:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706546531; cv=pass; d=google.com; s=arc-20160816; b=R0zbhryTS26oz6zmVJxpu9/321tKHDajLxwelyMIb0NzPDddzl5wj2oC9FerlevdUG OJizkjlZQoYJlkAOmdUPVJqWPv7anzZyjgkQFCFCuWFNzaisHAq2cuZAKez8MH3rUltR uKojRg3K5unZLlVtmICv4V7cGY8Uh/gQ7MNivq0LA5DIU1JMDT6Ifk/QSulQr3ftg3T0 lOiqHQmXHogtg9uHsJ+NBCDb7iLkIe3zyB5b4jUn6aTZo7DCi7xWbudLwmeVIaV5PBgS W4RwvzMoZ8/ewFertq4d7D34lWygLSWb/x8iGZu7HVjkUsC5kXgcvDq0w6x1UckUxqRL 4gLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=YcR0RngMHDWHorIafaca0CeWi9w1b3Ln6Rgdrt2bb24=; fh=4LIu5opAwLV7NEWuWaesW8kxXXZagKTitwg1cEZexpE=; b=pd+QrXWWGP2T/gCNF+8sjyft3nK+9GcINAYOzoS7Q4RrY4jTrDYhc4gAvB90eZYy6K H7dHvctZrnF3yUQQJfDMXAFIEoYbQ0R+KxcWffSzTX+6Vtt2fiOtkQrr4N7kRM1omGzU 7YUJpTZAsJmweyzgSccpUPGHr7ZsH/0p9uyIhOx7skaCwoYKSWCcePu6VjOyjC2dyB23 4y1i+MOIvDutApK2pu9BrJs38uv4x7qhH7IqzCzHz6VGFANFBdpa6MOsHalc0iDiN5wg vSSa8uEMl+TRcm1WCBGitYAXTejNWRa2d40JmeeOOwlrEEVeqYUwEYOxVHZrhrRjDaYJ cwrA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-43118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43118-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id eh6-20020a056a00808600b006de39de76aasi723366pfb.312.2024.01.29.08.42.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 08:42:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-43118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43118-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5F0632868A1 for ; Mon, 29 Jan 2024 16:37:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EED9315DBD8; Mon, 29 Jan 2024 16:32:14 +0000 (UTC) Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF24E15B99D; Mon, 29 Jan 2024 16:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706545934; cv=none; b=Nv2V+CeK9bUT5vrHLyHBHdg13E1IU33StFQfdkHx7euNj+pG3eufHI5cQvEVdQlQ4YMeHSTAQjRtO0fMprg/wz07tdffuMJf5VKRLC3oR8fJ4J/BFLX+KxWTzMQCoyj+RE+N5Qi0ldnyIpdAVjAfVJpRAxZSa9bFTStC0uG4L5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706545934; c=relaxed/simple; bh=SLYZDfBRj0nJ3TIDw4DlpBNWJI9WE3g0fX18rhc77nY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QHbwmcSlMvmf14z0zkFLsOiCfxvtfqJXrh0W2a0vgsssbJFVJsIgf/B+p9JiS3BYoA5OaDen99id31jrwOMrgU1DDQiJ7XZ43Px9qOpOyXtpgB6mkIstHe4pFFkmQuE0CUJVmqw3fKFY0fLHL4v+htzgJuJuFa4PwQCXa8zew/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id 2e1f42a0c7c859a6; Mon, 29 Jan 2024 17:32:04 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id C8DE266975C; Mon, 29 Jan 2024 17:32:03 +0100 (CET) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Ulf Hansson , Stanislaw Gruszka Subject: [PATCH v2 03/10] PM: sleep: stats: Use unsigned int for success and failure counters Date: Mon, 29 Jan 2024 17:13:14 +0100 Message-ID: <2941406.e9J7NaK4W3@kreacher> In-Reply-To: <5770175.DvuYhMxLoT@kreacher> References: <5770175.DvuYhMxLoT@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtgedgjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepgedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehulhhfrdhhrghnshhsohhnsehlihhnrghrohdrohhrghdprhgtphhtthhopehsthgrnhhishhlrgifrdhgrhhushiikhgrsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=4 Fuz1=4 Fuz2=4 From: Rafael J. Wysocki Change the type of the "success" and "fail" fields in struct suspend_stats to unsigned int, because they cannot be negative. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- v1 -> v2: New patch. --- include/linux/suspend.h | 4 ++-- kernel/power/main.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) Index: linux-pm/include/linux/suspend.h =================================================================== --- linux-pm.orig/include/linux/suspend.h +++ linux-pm/include/linux/suspend.h @@ -56,8 +56,8 @@ enum suspend_stat_step { struct suspend_stats { unsigned int step_failures[SUSPEND_NR_STEPS]; - int success; - int fail; + unsigned int success; + unsigned int fail; #define REC_FAILED_NUM 2 int last_failed_dev; char failed_devs[REC_FAILED_NUM][40]; Index: linux-pm/kernel/power/main.c =================================================================== --- linux-pm.orig/kernel/power/main.c +++ linux-pm/kernel/power/main.c @@ -339,8 +339,8 @@ static ssize_t _name##_show(struct kobje } \ static struct kobj_attribute _name = __ATTR_RO(_name) -suspend_attr(success, "%d\n"); -suspend_attr(fail, "%d\n"); +suspend_attr(success, "%u\n"); +suspend_attr(fail, "%u\n"); suspend_attr(last_hw_sleep, "%llu\n"); suspend_attr(total_hw_sleep, "%llu\n"); suspend_attr(max_hw_sleep, "%llu\n"); @@ -458,7 +458,7 @@ static int suspend_stats_show(struct seq last_step = suspend_stats.last_failed_step + REC_FAILED_NUM - 1; last_step %= REC_FAILED_NUM; - seq_printf(s, "success: %d\nfail: %d\n", + seq_printf(s, "success: %u\nfail: %u\n", suspend_stats.success, suspend_stats.fail); for (step = SUSPEND_FREEZE; step <= SUSPEND_NR_STEPS; step++)