From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753541AbcICOmC (ORCPT ); Sat, 3 Sep 2016 10:42:02 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48897 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753168AbcICOmB (ORCPT ); Sat, 3 Sep 2016 10:42:01 -0400 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 0B6236216D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=kvalo@codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [v2] ErrHandling:Make IS_ERR_VALUE_U32 as generic API to avoid IS_ERR_VALUE abuses. From: Kalle Valo In-Reply-To: <1468083696-15283-1-git-send-email-arvind.yadav.cs@gmail.com> To: Arvind Yadav Cc: zajec5@gmail.com, viresh.kumar@linaro.org, akpm@linux-foundation.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linville@tuxdriver.com, Arvind Yadav Message-Id: <20160903142913.16FBA6216D@smtp.codeaurora.org> Date: Sat, 3 Sep 2016 14:29:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arvind Yadav wrote: > IS_ERR_VALUE() assumes that its parameter is an unsigned long. > It can not be used to check if an 'unsigned int' reflects an error. > As they pass an 'unsigned int' into a function that takes an > 'unsigned long' argument. This happens to work because the type > is sign-extended on 64-bit architectures before it gets converted > into an unsigned type. > > However, anything that passes an 'unsigned short' or 'unsigned int' > argument into IS_ERR_VALUE() is guaranteed to be broken, as are > 8-bit integers and types that are wider than 'unsigned long'. > > It would be nice to any users that are not passing 'unsigned int' > arguments. > > Signed-off-by: Arvind Yadav This touches include/linux/err.h and I'm not very enthusiastic to change anything in include directory without wider support. I recommend first to just fix bcma. And separately you can try to improve linux/err.h via some more approariate tree, not via wireless trees. -- Sent by pwcli https://patchwork.kernel.org/patch/9222139/