From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934212AbcIPNGq (ORCPT ); Fri, 16 Sep 2016 09:06:46 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:42771 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756411AbcIPNGc (ORCPT ); Fri, 16 Sep 2016 09:06:32 -0400 Date: Fri, 16 Sep 2016 14:06:19 +0100 From: Eric Engestrom To: Jeff Moyer CC: , Jens Axboe , Johannes Thumshirn , Dan Williams , Ming Lin , Mike Christie Subject: Re: [PATCH v2] skd: fix assert typo Message-ID: <20160916130619.GW3075@imgtec.com> References: <20160916093125.14322-1-eric.engestrom@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) X-Originating-IP: [10.60.4.28] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 16, 2016 at 08:40:54AM -0400, Jeff Moyer wrote: > Eric Engestrom writes: > > > The assert was missing a `!` to become active, but since that would only turn > > it into a complicated codepath for a pr_err(), let's simply replace it. > > The skd assert macro prints out file and line number, which would have > been nice to keep. Sorry I didn't explicitly mention that last time. I'm not a fan of duplicating code, so if you want to keep the SKD_ASSERT() format, my suggestion would be to go with the v1 of this patch. It might end up having an `if` that will always be true, but the compiler will most likely take care of optimising that away :) Cheers, Eric > > -Jeff > > > > > CC: Jeff Moyer > > Signed-off-by: Eric Engestrom > > --- > > drivers/block/skd_main.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c > > index 3822eae..c04e92a 100644 > > --- a/drivers/block/skd_main.c > > +++ b/drivers/block/skd_main.c > > @@ -1905,7 +1905,7 @@ static void skd_send_internal_skspcl(struct skd_device *skdev, > > break; > > > > default: > > - SKD_ASSERT("Don't know what to send"); > > + pr_err("Don't know what to send"); > > return; > > > > } > > @@ -2105,7 +2105,7 @@ static void skd_complete_internal(struct skd_device *skdev, > > break; > > > > default: > > - SKD_ASSERT("we didn't send this"); > > + pr_err("we didn't send this"); > > } > > }