From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylwester Nawrocki Subject: Re: [RFC 2/4] dma: add dmaengine driver for Samsung s3c24xx SoCs Date: Wed, 15 May 2013 23:20:08 +0200 Message-ID: <5193FC08.5040002@gmail.com> References: <201305111330.05046.heiko@sntech.de> <201305111331.25405.heiko@sntech.de> <201305152231.52423.heiko@sntech.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-ea0-f170.google.com ([209.85.215.170]:38083 "EHLO mail-ea0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932698Ab3EOVUN (ORCPT ); Wed, 15 May 2013 17:20:13 -0400 In-Reply-To: <201305152231.52423.heiko@sntech.de> Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: =?ISO-8859-1?Q?Heiko_St=FCbner?= Cc: Linus Walleij , Dan Williams , Vinod Koul , "linux-kernel@vger.kernel.org" , linux-samsung-soc , Kukjin Kim , "linux-arm-kernel@lists.infradead.org" , Russell King - ARM Linux On 05/15/2013 10:31 PM, Heiko St=FCbner wrote: >>> + BUG(); >> > >> > Isn't that a bit nasty. This macro should be used with care and w= e >> > should recover if possible. dev_err()? > > runtime_config already denies any settings not in the 1,2 or 4bytes r= ange - > the default-part should therefore never be reached. So if any other v= alue > magically appears in the register and triggers the default-part, some= thing is > seriously wrong. So my guess is, the BUG might be appropriate. > > On the other hand the whole default+BUG part could also simply go awa= y, for > the same reasons. IMHO BUG() is not needed at all. As Linus suggested dev_err() is such c= ase or WARN_ON() would be more appropriate. This has been discussed in the = past extensively, not sure if you are aware of the other Linus' opinion on BUG()/BUG_ON() proliferation: https://lkml.org/lkml/2012/9/27/461 Regards, Sylwester From mboxrd@z Thu Jan 1 00:00:00 1970 From: sylvester.nawrocki@gmail.com (Sylwester Nawrocki) Date: Wed, 15 May 2013 23:20:08 +0200 Subject: [RFC 2/4] dma: add dmaengine driver for Samsung s3c24xx SoCs In-Reply-To: <201305152231.52423.heiko@sntech.de> References: <201305111330.05046.heiko@sntech.de> <201305111331.25405.heiko@sntech.de> <201305152231.52423.heiko@sntech.de> Message-ID: <5193FC08.5040002@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 05/15/2013 10:31 PM, Heiko St?bner wrote: >>> + BUG(); >> > >> > Isn't that a bit nasty. This macro should be used with care and we >> > should recover if possible. dev_err()? > > runtime_config already denies any settings not in the 1,2 or 4bytes range - > the default-part should therefore never be reached. So if any other value > magically appears in the register and triggers the default-part, something is > seriously wrong. So my guess is, the BUG might be appropriate. > > On the other hand the whole default+BUG part could also simply go away, for > the same reasons. IMHO BUG() is not needed at all. As Linus suggested dev_err() is such case or WARN_ON() would be more appropriate. This has been discussed in the past extensively, not sure if you are aware of the other Linus' opinion on BUG()/BUG_ON() proliferation: https://lkml.org/lkml/2012/9/27/461 Regards, Sylwester