Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752956AbbLNMEp (ORCPT ); Mon, 14 Dec 2015 07:04:45 -0500 Received: from mga11.intel.com ([192.55.52.93]:48677 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752911AbbLNMEo convert rfc822-to-8bit (ORCPT ); Mon, 14 Dec 2015 07:04:44 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,427,1444719600"; d="scan'208";a="840731784" From: "Winkler, Tomas" To: Andrzej Hajda CC: Bartlomiej Zolnierkiewicz , Marek Szyprowski , Jonathan Corbet , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "Greg KH (gregkh@linuxfoundation.org)" Subject: RE: [PATCH] doc: mei: fix handling return value of mei_recv_msg Thread-Topic: [PATCH] doc: mei: fix handling return value of mei_recv_msg Thread-Index: AQHRNldlkXEcr9/U7UG/oqym5ZCFF57KYeIg Date: Mon, 14 Dec 2015 12:04:40 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B540D589E@hasmsx109.ger.corp.intel.com> References: <1450087564-28441-1-git-send-email-a.hajda@samsung.com> <1450087564-28441-2-git-send-email-a.hajda@samsung.com> In-Reply-To: <1450087564-28441-2-git-send-email-a.hajda@samsung.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.184.70.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1400 Lines: 38 > The function can return negative values, so its result should > be assigned to signed variable. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 > > Signed-off-by: Andrzej Hajda > --- > Documentation/misc-devices/mei/mei-amt-version.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/misc-devices/mei/mei-amt-version.c > b/Documentation/misc-devices/mei/mei-amt-version.c > index 57d0d87..33e67bd 100644 > --- a/Documentation/misc-devices/mei/mei-amt-version.c > +++ b/Documentation/misc-devices/mei/mei-amt-version.c > @@ -370,7 +370,7 @@ static uint32_t amt_host_if_call(struct amt_host_if > *acmd, > unsigned int expected_sz) > { > uint32_t in_buf_sz; If are you at that then it will be desired to change the type to ssize_t also for in_buf_sz as mei_recv_msg takes ssize_t argument. > - uint32_t out_buf_sz; > + ssize_t out_buf_sz; > ssize_t written; > uint32_t status; > struct amt_host_if_resp_header *msg_hdr; Thanks Tomas -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/