From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753588AbcBORSD (ORCPT ); Mon, 15 Feb 2016 12:18:03 -0500 Received: from mga04.intel.com ([192.55.52.120]:59329 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751951AbcBORM2 (ORCPT ); Mon, 15 Feb 2016 12:12:28 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,451,1449561600"; d="scan'208";a="885400776" From: Alexander Shishkin To: Greg KH Cc: Mathieu Poirier , Chunyan Zhang , laurent.fert@intel.com, yann.fouassier@intel.com, linux-kernel@vger.kernel.org, Lucas Tanure , Alexander Shishkin Subject: [PATCH 01/20] stm class: Use a signed return type for stm_find_master_chan Date: Mon, 15 Feb 2016 19:11:51 +0200 Message-Id: <1455556330-12473-2-git-send-email-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455556330-12473-1-git-send-email-alexander.shishkin@linux.intel.com> References: <20160215164411.GA25556@kroah.com> <1455556330-12473-1-git-send-email-alexander.shishkin@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lucas Tanure 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 Signed-off-by: Alexander Shishkin --- 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 aef8ddb244..cdec240bd6 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