Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932767AbcLLLG7 (ORCPT ); Mon, 12 Dec 2016 06:06:59 -0500 Received: from forward16m.cmail.yandex.net ([5.255.216.147]:40910 "EHLO forward16m.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932181AbcLLLG5 (ORCPT ); Mon, 12 Dec 2016 06:06:57 -0500 X-Greylist: delayed 475 seconds by postgrey-1.27 at vger.kernel.org; Mon, 12 Dec 2016 06:06:57 EST Authentication-Results: mxback7j.mail.yandex.net; dkim=pass header.i=@yandex.com.tr From: Ozgur Karatas Envelope-From: mueddib@yandex.com.tr To: yishaih@mellanox.com Cc: netdev , linux-kernel Subject: [PATCH 1/1] Fixed to BUG_ON to WARN_ON def MIME-Version: 1.0 Message-Id: <811031481540339@web1j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 12 Dec 2016 12:58:59 +0200 Content-Transfer-Encoding: 7bit Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1111 Lines: 32 Hello all, I think should be use to "WARN_ON" and checkpatch script give to error, I fixed and I think should don't use "BUG_ON". Regards, Signed-off-by: Ozgur Karatas --- drivers/net/ethernet/mellanox/mlx4/icm.c | 4 ++-- diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c index 2a9dd46..3fde535 100644 --- a/drivers/net/ethernet/mellanox/mlx4/icm.c +++ b/drivers/net/ethernet/mellanox/mlx4/icm.c @@ -119,7 +119,7 @@ static int mlx4_alloc_icm_coherent(struct device *dev, struct scatterlist *mem, return -ENOMEM; sg_set_buf(mem, buf, PAGE_SIZE << order); - BUG_ON(mem->offset); + WARN_ON(mem->offset); sg_dma_len(mem) = PAGE_SIZE << order; return 0; } @@ -133,7 +133,7 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, int ret; /* We use sg_set_buf for coherent allocs, which assumes low memory */ - BUG_ON(coherent && (gfp_mask & __GFP_HIGHMEM)); + WARN_ON(coherent && (gfp_mask & __GFP_HIGHMEM)); icm = kmalloc_node(sizeof(*icm), gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN), -- 2.1.4