Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp213819imp; Wed, 20 Feb 2019 23:25:05 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib4UppaYYaZ57s+zT8mib4r1/wxt6YuItw/1iHZtYM5Ghl/BrXwlEmkU3JWsd0YyzvQYtsB X-Received: by 2002:a17:902:f83:: with SMTP id 3mr35691863plz.125.1550733904980; Wed, 20 Feb 2019 23:25:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550733904; cv=none; d=google.com; s=arc-20160816; b=jzuL+jCQz5myckpqkJLcyZx4EKu63a8RLNgO/Xo6M5nUy7e6sPn1RKE3iVIjYcWife 7iqzv7SnYvwXfY1MbmINkIKpH8ayRkiAndgq4nagV2EAQ50Vw8kkQfw40GG0bfL55FNs wsoYQgKHXGDp7CKoW4RLjaIpvh1t8da3VGNpqpH2CFA0WWXsUscltPxX0ifXWVruJdJN 1TNwQCbsh8JU6zL/9FLEGNWQYcPS+wMTT6b11GnyZP6cUsoS8r4USiA4s0zsZdBQn6uE N5adBoCiZ9vQSYeenTbR7SHAvz1+fJBVuLhAxuOjI5z73cqwwQ0inuAD0SOVsm9hGaVM WTIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KQC4IjI+7ty3VFbO8kU6gEddR8NaDw5GGbLjd2R+r5U=; b=k8yCIQP07JGn7M9wHBp1nUgohWxM2bsCP656Ac6Uh8nc4kUcZEgwL51WQ6be/bjAQB KvmlUaaJNnDeACmHY7iE9PpLpiDfN8TCETxkM4IV3sNaoO9DeX9MdbhcYcx/gMbW7CSo Lj1XW/n0//SWsZLMWNo00Zr4TMbYdr3nOchuFNBu5VHT1/94l3b5OkIpI12HctKwvYp4 OlEEKzadXtarL9MIjJ+KmaaPlDXDkCDU9qgK47pKvJHgxrKmovArc+N1YeekGbV6wgte f8FXoxbUD4NUVDmeUvyD64dsGpMGAlGtFCMgIIS9OfX2+xznf7V1z29VJWu1UKrcDPfQ tKrw== ARC-Authentication-Results: i=1; mx.google.com; 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 a6si19478332pff.199.2019.02.20.23.24.48; Wed, 20 Feb 2019 23:25:04 -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; 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 S1727258AbfBUHWk (ORCPT + 99 others); Thu, 21 Feb 2019 02:22:40 -0500 Received: from 178.115.242.59.static.drei.at ([178.115.242.59]:40403 "EHLO mail.osadl.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbfBUHWk (ORCPT ); Thu, 21 Feb 2019 02:22:40 -0500 Received: by mail.osadl.at (Postfix, from userid 1001) id A48025C044A; Thu, 21 Feb 2019 08:22:10 +0100 (CET) Date: Thu, 21 Feb 2019 08:22:10 +0100 From: Nicholas Mc Guire To: Nathan Chancellor Cc: Greg Kroah-Hartman , Nicholas Mc Guire , Nick Desaulniers , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtlwifi: Use proper enum for return in halmac_parse_psd_data_88xx Message-ID: <20190221072210.GB1044@osadl.at> References: <20190221052524.16064-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190221052524.16064-1-natechancellor@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2019 at 10:25:24PM -0700, Nathan Chancellor wrote: > Clang warns: > > drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c:2472:11: > warning: implicit conversion from enumeration type 'enum > halmac_cmd_process_status' to different enumeration type 'enum > halmac_ret_status' [-Wenum-conversion] > return HALMAC_CMD_PROCESS_ERROR; > ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~ > 1 warning generated. > yup - my bad I somehow managed to end up in halmac_cmd_process_status rather than halmac_ret_status - HALMAC_RET_MALLOC_FAIL makes sense here. interesting that gcc did not fuss at this. thx! hofrat > Fix this by using the proper enum for allocation failures, > HALMAC_RET_MALLOC_FAIL, which is used in the rest of this file. > > Fixes: e4b08e16b7d9 ("staging: r8822be: check kzalloc return or bail") > Link: https://github.com/ClangBuiltLinux/linux/issues/375 > Signed-off-by: Nathan Chancellor Reviewed-by: Nicholas Mc Guire > --- > drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c > index ec742da030db..ddbeff8224ab 100644 > --- a/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c > +++ b/drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c > @@ -2469,7 +2469,7 @@ halmac_parse_psd_data_88xx(struct halmac_adapter *halmac_adapter, u8 *c2h_buf, > if (!psd_set->data) { > psd_set->data = kzalloc(psd_set->data_size, GFP_KERNEL); > if (!psd_set->data) > - return HALMAC_CMD_PROCESS_ERROR; > + return HALMAC_RET_MALLOC_FAIL; > } > > if (segment_id == 0) > -- > 2.21.0.rc1 >