From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756096AbcAZCUt (ORCPT ); Mon, 25 Jan 2016 21:20:49 -0500 Received: from mail-qg0-f45.google.com ([209.85.192.45]:33289 "EHLO mail-qg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752914AbcAZCUr (ORCPT ); Mon, 25 Jan 2016 21:20:47 -0500 From: Lucas Tanure To: Alexander Shishkin Cc: linux-kernel@vger.kernel.org Subject: [PATCH] stm class: Use a signed return type for stm_find_master_chan Date: Tue, 26 Jan 2016 00:20:42 -0200 Message-Id: <1453774842-25351-1-git-send-email-tanure@linux.com> X-Mailer: git-send-email 2.7.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The return type "unsigned int" was used by the stm_find_master_chan function despite of the aspect that it will eventually return a negative error code. Done with the help of Coccinelle. Signed-off-by: Lucas Tanure --- drivers/hwtracing/stm/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index b6445d9..cc520f0 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -233,7 +233,7 @@ static int find_free_channels(unsigned long *bitmap, unsigned int start, return -1; } -static unsigned int +static int stm_find_master_chan(struct stm_device *stm, unsigned int width, unsigned int *mstart, unsigned int mend, unsigned int *cstart, unsigned int cend) @@ -293,7 +293,7 @@ static int stm_output_assign(struct stm_device *stm, unsigned int width, goto unlock; ret = stm_find_master_chan(stm, width, &midx, mend, &cidx, cend); - if (ret) + if (ret < 0) goto unlock; output->master = midx; -- 2.7.0