From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965842AbbLRVlT (ORCPT ); Fri, 18 Dec 2015 16:41:19 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:33779 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965583AbbLRVj2 (ORCPT ); Fri, 18 Dec 2015 16:39:28 -0500 From: John Stultz To: lkml Cc: Andrzej Hajda , Thomas Gleixner , Ingo Molnar , Miroslav Lichvar , Prarit Bhargava , Richard Cochran , John Stultz Subject: [PATCH 05/11] selftests/timers: fix write return value handlng Date: Fri, 18 Dec 2015 13:39:10 -0800 Message-Id: <1450474756-10144-6-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450474756-10144-1-git-send-email-john.stultz@linaro.org> References: <1450474756-10144-1-git-send-email-john.stultz@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrzej Hajda The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Prarit Bhargava Cc: Richard Cochran Signed-off-by: Andrzej Hajda Signed-off-by: John Stultz --- tools/testing/selftests/timers/clocksource-switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c index 627ec74..fd88e30 100644 --- a/tools/testing/selftests/timers/clocksource-switch.c +++ b/tools/testing/selftests/timers/clocksource-switch.c @@ -97,7 +97,7 @@ int get_cur_clocksource(char *buf, size_t size) int change_clocksource(char *clocksource) { int fd; - size_t size; + ssize_t size; fd = open("/sys/devices/system/clocksource/clocksource0/current_clocksource", O_WRONLY); -- 1.9.1