From: Haneen Mohammed <hamohammed.sa@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>, outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v8 2/5] Staging: emxx_udc: Replace custom printk macro ERR with pr_err
Date: Fri, 27 Feb 2015 14:42:05 +0300 [thread overview]
Message-ID: <20150227114205.GB28904@example.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1502271158410.2668@hadrien>
On Fri, Feb 27, 2015 at 11:59:57AM +0100, Julia Lawall wrote:
> On Fri, 27 Feb 2015, Haneen Mohammed wrote:
>
> > This patch removes half custom printk macros ERR and replace it with
>
> Removing the macro would seem like remomving the definition. Here you are
> removing the uses. That could be more clear.
>
> > pr_err, for no appropriate struct device *dev field where found for dev_err.
> > Issue addressed by checkpathc.pl.
> >
> > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> > ---
> > v6: Justify the use of pr_err instead of dev_err.
> >
> > drivers/staging/emxx_udc/emxx_udc.c | 56 ++++++++++++++++++-------------------
> > 1 file changed, 28 insertions(+), 28 deletions(-)
> >
> > diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
> > index f2ddad3..094e018 100644
> > --- a/drivers/staging/emxx_udc/emxx_udc.c
> > +++ b/drivers/staging/emxx_udc/emxx_udc.c
> > @@ -115,7 +115,7 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc *udc)
> > pr_info("=== %s()\n", __func__);
> >
> > if (udc == NULL) {
> > - ERR("%s udc == NULL\n", __func__);
> > + pr_err("udc: %s udc == NULL\n", __func__);
> > return;
> > }
> >
> > @@ -2258,7 +2258,7 @@ static int _nbu2ss_pullup(struct nbu2ss_udc *udc, int is_on)
>
> Are you sure that there is no appropriate field in the nbu2ss_udc
> structure?
>
> julia
>
nbu2ss_udc structure in the following function has a dev field.
"static void _nbu2ss_dump_register(struct nbu2ss_udc *udc)"
But I thought I can't use dev_err in the following because if udc is
null then udc->dev would be null, so I used pr_err instead.
if (udc == NULL) {
pr_err("udc: %s udc == NULL\n", __func__);
Or that is fine and using dev_err(udc->dev, even if udc is null wouldn't affect the program?
Thanks,
Haneen
> > u32 reg_dt;
> >
> > if (!udc) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("udc: %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -2612,13 +2612,13 @@ static int nbu2ss_ep_enable(
> > struct nbu2ss_udc *udc;
> >
> > if ((_ep == NULL) || (desc == NULL)) {
> > - ERR(" *** %s, bad param\n", __func__);
> > + pr_err("udc: *** %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > ep = container_of(_ep, struct nbu2ss_ep, ep);
> > if ((ep == NULL) || (ep->udc == NULL)) {
> > - ERR(" *** %s, ep == NULL !!\n", __func__);
> > + pr_err("udc: *** %s, ep == NULL !!\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -2626,7 +2626,7 @@ static int nbu2ss_ep_enable(
> > if ((ep_type == USB_ENDPOINT_XFER_CONTROL)
> > || (ep_type == USB_ENDPOINT_XFER_ISOC)) {
> >
> > - ERR(" *** %s, bat bmAttributes\n", __func__);
> > + pr_err("udc: *** %s, bat bmAttributes\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -2672,13 +2672,13 @@ static int nbu2ss_ep_disable(struct usb_ep *_ep)
> > unsigned long flags;
> >
> > if (_ep == NULL) {
> > - ERR(" *** %s, bad param\n", __func__);
> > + pr_err("udc: *** %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > ep = container_of(_ep, struct nbu2ss_ep, ep);
> > if ((ep == NULL) || (ep->udc == NULL)) {
> > - ERR(" *** %s, ep == NULL !!\n", __func__);
> > + pr_err("udc: *** %s, ep == NULL !!\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -2742,10 +2742,10 @@ static int nbu2ss_ep_queue(
> > /* catch various bogus parameters */
> > if ((_ep == NULL) || (_req == NULL)) {
> > if (_ep == NULL)
> > - ERR("*** %s --- _ep == NULL\n", __func__);
> > + pr_err("udc: *** %s --- _ep == NULL\n", __func__);
> >
> > if (_req == NULL)
> > - ERR("*** %s --- _req == NULL\n", __func__);
> > + pr_err("udc: *** %s --- _req == NULL\n", __func__);
> >
> > return -EINVAL;
> > }
> > @@ -2756,13 +2756,13 @@ static int nbu2ss_ep_queue(
> > || !list_empty(&req->queue))) {
> >
> > if (!_req->complete)
> > - ERR("*** %s --- !_req->complete\n", __func__);
> > + pr_err("udc: *** %s --- !_req->complete\n", __func__);
> >
> > if (!_req->buf)
> > - ERR("*** %s --- !_req->buf\n", __func__);
> > + pr_err("udc: *** %s --- !_req->buf\n", __func__);
> >
> > if (!list_empty(&req->queue))
> > - ERR("*** %s --- !list_empty(&req->queue)\n", __func__);
> > + pr_err("udc: *** %s --- !list_empty(&req->queue)\n", __func__);
> >
> > return -EINVAL;
> > }
> > @@ -2849,13 +2849,13 @@ static int nbu2ss_ep_dequeue(
> >
> > /* catch various bogus parameters */
> > if ((_ep == NULL) || (_req == NULL)) {
> > - /* ERR("%s, bad param(1)\n", __func__); */
> > + /* pr_err("udc: %s, bad param(1)\n", __func__); */
> > return -EINVAL;
> > }
> >
> > ep = container_of(_ep, struct nbu2ss_ep, ep);
> > if (!ep) {
> > - ERR("%s, ep == NULL !!\n", __func__);
> > + pr_err("udc: %s, ep == NULL !!\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -2895,19 +2895,19 @@ static int nbu2ss_ep_set_halt(struct usb_ep *_ep, int value)
> > /* INFO("=== %s()\n", __func__); */
> >
> > if (!_ep) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("udc: %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > ep = container_of(_ep, struct nbu2ss_ep, ep);
> > if (!ep) {
> > - ERR("%s, bad ep\n", __func__);
> > + pr_err("udc: %s, bad ep\n", __func__);
> > return -EINVAL;
> > }
> >
> > udc = ep->udc;
> > if (!udc) {
> > - ERR(" *** %s, bad udc\n", __func__);
> > + pr_err("udc: *** %s, bad udc\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -2949,19 +2949,19 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep)
> > /* INFO("=== %s()\n", __func__); */
> >
> > if (!_ep) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("udc: %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > ep = container_of(_ep, struct nbu2ss_ep, ep);
> > if (!ep) {
> > - ERR("%s, bad ep\n", __func__);
> > + pr_err("udc: %s, bad ep\n", __func__);
> > return -EINVAL;
> > }
> >
> > udc = ep->udc;
> > if (!udc) {
> > - ERR("%s, bad udc\n", __func__);
> > + pr_err("udc: %s, bad udc\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -2997,19 +2997,19 @@ static void nbu2ss_ep_fifo_flush(struct usb_ep *_ep)
> > /* INFO("=== %s()\n", __func__); */
> >
> > if (!_ep) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("udc: %s, bad param\n", __func__);
> > return;
> > }
> >
> > ep = container_of(_ep, struct nbu2ss_ep, ep);
> > if (!_ep) {
> > - ERR("%s, bad ep\n", __func__);
> > + pr_err("udc: %s, bad ep\n", __func__);
> > return;
> > }
> >
> > udc = ep->udc;
> > if (!udc) {
> > - ERR("%s, bad udc\n", __func__);
> > + pr_err("udc: %s, bad udc\n", __func__);
> > return;
> > }
> >
> > @@ -3053,7 +3053,7 @@ static int nbu2ss_gad_get_frame(struct usb_gadget *pgadget)
> > /* INFO("=== %s()\n", __func__); */
> >
> > if (pgadget == NULL) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("udc: %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -3083,7 +3083,7 @@ static int nbu2ss_gad_wakeup(struct usb_gadget *pgadget)
> > /* INFO("=== %s()\n", __func__); */
> >
> > if (pgadget == NULL) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("%s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -3123,7 +3123,7 @@ static int nbu2ss_gad_set_selfpowered(struct usb_gadget *pgadget,
> > /* INFO("=== %s()\n", __func__); */
> >
> > if (pgadget == NULL) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("udc: %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -3152,7 +3152,7 @@ static int nbu2ss_gad_vbus_draw(struct usb_gadget *pgadget, unsigned mA)
> > /* INFO("=== %s()\n", __func__); */
> >
> > if (pgadget == NULL) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("udc: %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > @@ -3174,7 +3174,7 @@ static int nbu2ss_gad_pullup(struct usb_gadget *pgadget, int is_on)
> > /* INFO("=== %s()\n", __func__); */
> >
> > if (pgadget == NULL) {
> > - ERR("%s, bad param\n", __func__);
> > + pr_err("udc: %s, bad param\n", __func__);
> > return -EINVAL;
> > }
> >
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1425033066-20762-1-git-send-email-hamohammed.sa%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
next prev parent reply other threads:[~2015-02-27 11:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 9:48 [PATCH v6 0/4] Staging: emxx_udc: Fix checkpatch.pl warnings Haneen Mohammed
2015-02-27 10:01 ` [PATCH v7 0/5] " Haneen Mohammed
2015-02-27 10:26 ` [PATCH v8 " Haneen Mohammed
2015-02-27 10:28 ` [PATCH v8 1/5] Staging: emxx_udc: Fix do not add new typedefs remove and volatile Haneen Mohammed
2015-02-27 10:31 ` [PATCH v8 2/5] Staging: emxx_udc: Replace custom printk macro ERR with pr_err Haneen Mohammed
2015-02-27 10:59 ` [Outreachy kernel] " Julia Lawall
2015-02-27 11:42 ` Haneen Mohammed [this message]
2015-02-27 10:32 ` [PATCH v8 3/5] Staging: emxx_udc: Replace custom printk macro ERR with dev_err Haneen Mohammed
2015-02-27 10:34 ` [PATCH v8 4/5] Staging: emxx_udc: Remove custom printk macro ERR Haneen Mohammed
2015-02-27 10:35 ` [PATCH v8 5/5] Staging: emxx_udc: Clean dev_err() logging Haneen Mohammed
2015-02-27 10:57 ` [Outreachy kernel] " Julia Lawall
2015-02-27 11:22 ` Haneen Mohammed
2015-03-01 20:53 ` [PATCH v9 0/4] emxx_udc: Fix checkpatch.pl warnings Haneen Mohammed
2015-03-01 20:55 ` [PATCH v9 1/4] Staging: emxx_udc: Fix do not add new typedefs and remove volatile Haneen Mohammed
2015-03-02 1:12 ` [Outreachy kernel] " Greg KH
2015-03-01 21:00 ` [PATCH v9 2/4] Staging: emxx_udc: Replace custom printk macro ERR with dev_err or pr_err Haneen Mohammed
2015-03-01 21:03 ` [PATCH v9 3/4] Staging: emxx_udc: Remove custom printk macro ERR Haneen Mohammed
2015-03-01 21:04 ` [PATCH v9 4/4] Staging: emxx_udc: Clean dev_err() logging Haneen Mohammed
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=20150227114205.GB28904@example.com \
--to=hamohammed.sa@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=outreachy-kernel@googlegroups.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.