Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752436AbcLLNEe (ORCPT ); Mon, 12 Dec 2016 08:04:34 -0500 Received: from forward1h.cmail.yandex.net ([87.250.230.16]:41483 "EHLO forward1h.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985AbcLLNEc (ORCPT ); Mon, 12 Dec 2016 08:04:32 -0500 Authentication-Results: mxback15h.mail.yandex.net; dkim=pass header.i=@yandex.com.tr From: Ozgur Karatas Envelope-From: mueddib@yandex.com.tr To: Leon Romanovsky Cc: "yishaih@mellanox.com" , netdev , linux-kernel In-Reply-To: <20161212123937.GA6503@mtr-leonro.local> References: <811031481540339@web1j.yandex.ru> <20161212123937.GA6503@mtr-leonro.local> Subject: Re: [PATCH 1/1] Fixed to BUG_ON to WARN_ON def MIME-Version: 1.0 Message-Id: <2090831481547868@web27h.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 12 Dec 2016 15:04:28 +0200 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2305 Lines: 58 Dear Romanovsky; I'm trying to learn english and I apologize for my mistake words and phrases. So, I think the code when call to "sg_set_buf" and next time set memory and buffer. For example, isn't to call "WARN_ON" function, get a error to implicit declaration, right? Because, you will use to "BUG_ON" get a error implicit declaration of functions. sg_set_buf(mem, buf, PAGE_SIZE << order); WARN_ON(mem->offset); Thanks for information and learn to me. Regards, Ozgur Karatas 12.12.2016, 14:39, "Leon Romanovsky" : > On Mon, Dec 12, 2016 at 12:58:59PM +0200, Ozgur Karatas wrote: >>  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 > > NAK, Leon Romanovsky > > If we put aside commit message issue, which was pointed to you by Stefan, your > proposed change is incorrect. By chnaging BUG_ONs to be WARN_ONs, you > will left the driver in improper state. > > Thanks > >>  --- >>  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