All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Engestrom <eric.engestrom@imgtec.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@fb.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Dan Williams <dan.j.williams@intel.com>,
	Ming Lin <ming.l@ssi.samsung.com>,
	Mike Christie <mchristi@redhat.com>
Subject: Re: [PATCH v2] skd: fix assert typo
Date: Fri, 16 Sep 2016 14:06:19 +0100	[thread overview]
Message-ID: <20160916130619.GW3075@imgtec.com> (raw)
In-Reply-To: <x49lgysj9ux.fsf@segfault.boston.devel.redhat.com>

On Fri, Sep 16, 2016 at 08:40:54AM -0400, Jeff Moyer wrote:
> Eric Engestrom <eric.engestrom@imgtec.com> 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 <jmoyer@redhat.com>
> > Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> > ---
> >  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");
> >  	}
> >  }

      reply	other threads:[~2016-09-16 13:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 10:26 [PATCH] skd: fix assert typo Eric Engestrom
2016-09-12 17:43 ` Jeff Moyer
2016-09-16  9:31   ` [PATCH v2] " Eric Engestrom
2016-09-16 11:59     ` Johannes Thumshirn
2016-09-16 12:40     ` Jeff Moyer
2016-09-16 13:06       ` Eric Engestrom [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160916130619.GW3075@imgtec.com \
    --to=eric.engestrom@imgtec.com \
    --cc=axboe@fb.com \
    --cc=dan.j.williams@intel.com \
    --cc=jmoyer@redhat.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchristi@redhat.com \
    --cc=ming.l@ssi.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.