Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp746033imu; Tue, 20 Nov 2018 06:23:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/WDJUHDhXAw0UooFowkRq3mWv1atp5G6PmHbOn/8+hiDxAk1W6xBSrSy0XWGj2mDO/AaIIw X-Received: by 2002:a63:af18:: with SMTP id w24mr2070880pge.385.1542723783836; Tue, 20 Nov 2018 06:23:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542723783; cv=none; d=google.com; s=arc-20160816; b=ul9lZrv91oav76HUp40hkaVAjZ3U4hADLRq0b0i1l7/7bl3pJVJn9/dkZJylNFWPUC B5j8ggNGAcWnaaH4jZMG2gS9jIpw+4BjmNN8PS5PFO3mvypIPXLbDPAzTREPljR23/6I XvlwQavogTtvuR6Q9ftqcGT6r32fMFkotgo7b80F7117hWzNcaQ+UqEt/g8FhEckNlRM SFz1H9BI3lW/iKlAUz0jW7MYoTCctjganghQ74uTXMsSS+kBVteMTeOwiPAnTLsEHOAO BPuQ89MIuI0ysGuAgrEtGig9bwYJviuUZOppHWTVayFl6WIuipMgy2hqZlo5Sb6XdH0t fD2A== 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; bh=MPwoc9Yaeg9I1Zle8xC0OODs9ZsmQRnOEw0UzSKGDVc=; b=aFHQ+JcRfUd6e+Afm0UvuGs50ocxmnTZuaXpyxurqmzOsTOic0PVxpFCwwBfzup3nG 4nSHk5yuKyZ9EPY1C4Wyu1A1o/FSPPj7JaaBqoCrN89aV/9Xc/9t3FiSHfSOHzipuj8G QaSTvUNsiForCPYNTdt8Ih9+ZBkY6tii1GTvs+V3mrxuamJaGiN1HMt/nM27OKxSEBxI XLsrvo48yw17drl3CE1x2MzXg0STS+8+akY58UJcxcL2WLTEryJyzziBeNsdI4JlHDx7 mXB96z1rT9NabHQvrEdrvgASSq7EK/6bXZVZylMViqjkNl2WuIx6UR+L8mQ025oM2u8C 1fhw== 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 bg7si11152162plb.149.2018.11.20.06.22.48; Tue, 20 Nov 2018 06:23:03 -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 S1729768AbeKUAuw (ORCPT + 99 others); Tue, 20 Nov 2018 19:50:52 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:15128 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727586AbeKUAuw (ORCPT ); Tue, 20 Nov 2018 19:50:52 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C761796010B5F; Tue, 20 Nov 2018 22:21:24 +0800 (CST) Received: from localhost.localdomain (10.175.124.28) by smtp.huawei.com (10.3.19.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 20 Nov 2018 22:21:19 +0800 From: Gao Xiang To: Greg Kroah-Hartman , CC: LKML , , "Chao Yu" , Miao Xie , , Gao Xiang Subject: [PATCH 06/10] staging: erofs: fix the definition of DBG_BUGON Date: Tue, 20 Nov 2018 22:34:21 +0800 Message-ID: <20181120143425.43637-7-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181120143425.43637-1-gaoxiang25@huawei.com> References: <20181120143425.43637-1-gaoxiang25@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's better not to positively BUG_ON the kernel, however developers need a way to locate issues as soon as possible. DBG_BUGON is introduced and it could only crash when EROFS_FS_DEBUG (EROFS developping feature) is on. It is helpful for developers to find and solve bugs quickly. Previously, DBG_BUGON is defined as ((void)0) if EROFS_FS_DEBUG is off, but some unused variable warnings as follows could occur: drivers/staging/erofs/unzip_vle.c: In function ‘init_always’: drivers/staging/erofs/unzip_vle.c:61:33: warning: unused variable ‘work’ [-Wunused-variable] struct z_erofs_vle_work *const work = ^~~~ Fix it to #define DBG_BUGON(x) ((void)(x)). Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index f77653d33633..0aa2a41b9885 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -39,7 +39,7 @@ #define debugln(x, ...) ((void)0) #define dbg_might_sleep() ((void)0) -#define DBG_BUGON(...) ((void)0) +#define DBG_BUGON(x) ((void)(x)) #endif enum { -- 2.14.4