Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2487151ybx; Fri, 8 Nov 2019 05:07:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwah840AIDEN/OmPZegkaaIEwaKPa/pE84cGS2T2qELqxenNnCIDbLXT+lVQMX2NvcrqSFG X-Received: by 2002:aa7:c493:: with SMTP id m19mr10107921edq.39.1573218444183; Fri, 08 Nov 2019 05:07:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573218444; cv=none; d=google.com; s=arc-20160816; b=hRYLq+iLcSqNRwpMUGAizkDGLL/Gx3Png+Q8v3rY4CpzeKWyfNo6RewIXg+voh/4q8 4GNBxdNnaLlTDWDKjDpSxSmDDo/wSakNOGn4f67zPb9rB3DZwlTmQoanaIucbq3Pjfpf xeVHX2Ofyl7UXa7nNLUt4K0vI3KEZSFLCL51Hl0McftMwjNts7R3MLCekzIAbEOypmKM lmlIU0SLbjXIFd+U11ekoI/ciP0bCP8fQtE+OyH2MHjHzbqgcCTkS1AdOzv/sdzrQWsD m8bG8HGAuwHyFcPnBTPmVXBl1iIFwvyMGhQxQjU56Lpr6S/92IgY4fSPVVpXldbq1926 gZuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IVdoGLW+H0ZKnJRayTBX6GqWyaD6YHKGaBDMMFO7/WI=; b=TS4eINfL7HYUm1oB0NMMSmDzJ5e3q+v2rTcaMoAweqcrsD4QXP4GxliUYwg48A/zKc 9xZYYvpj/xk9nw5LElMWLFE9tLtlwtAD6ADowHmm8ty5cxUZc1xFFUVMPWPxw392szYR Kj0dmMFy/8dmT3XZ+zqfGtBYnI8wFhnmmxwSDPPqBKw4X7H5dzFfSBY6X7C/vroeXJv+ Xo7ZRvSyn2IEUvvdEIbrm+DhiY9i4qyxm08fY+qZ78O3yP5LvpCkMGk1gmP9QmmJ8MrR 9/4JRfBbxlcvEPYfGqxiTMBrDk25go7mVh1p5i4W27Mqd+z1tTilot1lgSLBRvTvx3E8 b9Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=XGWfSCSU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si3965202eje.357.2019.11.08.05.07.01; Fri, 08 Nov 2019 05:07:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=XGWfSCSU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731610AbfKHNDM (ORCPT + 99 others); Fri, 8 Nov 2019 08:03:12 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:34249 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730733AbfKHNCX (ORCPT ); Fri, 8 Nov 2019 08:02:23 -0500 Received: by mail-lf1-f66.google.com with SMTP id f5so4431763lfp.1 for ; Fri, 08 Nov 2019 05:02:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IVdoGLW+H0ZKnJRayTBX6GqWyaD6YHKGaBDMMFO7/WI=; b=XGWfSCSUEAVnpUU/P6J3Qpi258NYlF3UJQSunn16SlUdmsp2q+W8Bk2e/nwHBQtUA0 fTuY1Ravcq9bFl1d3rl/f799vNBuCYFEgPCX2t9OqCPlkEeIvRZyKcQb8orXRDyeqpLG r3uSJRO/BS/Xt5o6Y8WDp/Fl9289KO+LrOKYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IVdoGLW+H0ZKnJRayTBX6GqWyaD6YHKGaBDMMFO7/WI=; b=mz8fjQ1ox9cqNInGo4rdAGIPdkQS94toRhfNh88QgBMSs8locT+E9Iq6VbEoY93HIY uIi/yOKCrcpUvFeOvvLFXgCN6SS7K2l63LOkXcwrYA+oIR9LPO/WAij2xroolRO3flof 73jQROmLOpg671dITd766TvH6BdqExe2tDcPQgKVfKvyM3IgXFiQG9CTdPMb4JOrGvUA QD5jzQC5omBfFPLSaltFLfi90laFln14Q/hVcXwZqox/TriRmrT2lXAjPN3zPG0LFVyf no18Z/kvQwgcTmx5Gi+fNtuLaGav7Ug0+I+8WyMWKDXBwL68QwgxE0QsPEjAQN755esm mW+Q== X-Gm-Message-State: APjAAAUynwlp7LqZ+2cX9cIDPeL4AAFGXgNR9STRDrr4CMJQboJYc/i1 FZyCQHYGRxEZQ+Q01LHk+kKnKw== X-Received: by 2002:a19:148:: with SMTP id 69mr6994219lfb.76.1573218141700; Fri, 08 Nov 2019 05:02:21 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id d28sm2454725lfn.33.2019.11.08.05.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 05:02:21 -0800 (PST) From: Rasmus Villemoes To: Qiang Zhao , Li Yang , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Wood , Rasmus Villemoes , netdev@vger.kernel.org Subject: [PATCH v4 43/47] net/wan/fsl_ucc_hdlc: avoid use of IS_ERR_VALUE() Date: Fri, 8 Nov 2019 14:01:19 +0100 Message-Id: <20191108130123.6839-44-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191108130123.6839-1-linux@rasmusvillemoes.dk> References: <20191108130123.6839-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building this on a 64-bit platform gcc rightly warns that the error checking is broken (-ENOMEM stored in an u32 does not compare greater than (unsigned long)-MAX_ERRNO). Instead, now that qe_muram_alloc() returns s32, use that type to store the return value and use standard kernel style "ret < 0". Signed-off-by: Rasmus Villemoes --- drivers/net/wan/fsl_ucc_hdlc.c | 10 +++++----- drivers/net/wan/fsl_ucc_hdlc.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index ce6af7d5380f..405b24a5a60d 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -84,8 +84,8 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) int ret, i; void *bd_buffer; dma_addr_t bd_dma_addr; - u32 riptr; - u32 tiptr; + s32 riptr; + s32 tiptr; u32 gumr; ut_info = priv->ut_info; @@ -195,7 +195,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) priv->ucc_pram_offset = qe_muram_alloc(sizeof(struct ucc_hdlc_param), ALIGNMENT_OF_UCC_HDLC_PRAM); - if (IS_ERR_VALUE(priv->ucc_pram_offset)) { + if (priv->ucc_pram_offset < 0) { dev_err(priv->dev, "Can not allocate MURAM for hdlc parameter.\n"); ret = -ENOMEM; goto free_tx_bd; @@ -233,14 +233,14 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) /* Alloc riptr, tiptr */ riptr = qe_muram_alloc(32, 32); - if (IS_ERR_VALUE(riptr)) { + if (riptr < 0) { dev_err(priv->dev, "Cannot allocate MURAM mem for Receive internal temp data pointer\n"); ret = -ENOMEM; goto free_tx_skbuff; } tiptr = qe_muram_alloc(32, 32); - if (IS_ERR_VALUE(tiptr)) { + if (tiptr < 0) { dev_err(priv->dev, "Cannot allocate MURAM mem for Transmit internal temp data pointer\n"); ret = -ENOMEM; goto free_riptr; diff --git a/drivers/net/wan/fsl_ucc_hdlc.h b/drivers/net/wan/fsl_ucc_hdlc.h index 8b3507ae1781..71d5ad0a7b98 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.h +++ b/drivers/net/wan/fsl_ucc_hdlc.h @@ -98,7 +98,7 @@ struct ucc_hdlc_private { unsigned short tx_ring_size; unsigned short rx_ring_size; - u32 ucc_pram_offset; + s32 ucc_pram_offset; unsigned short encoding; unsigned short parity; -- 2.23.0