linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: [SCSI] bfa: Added support to obtain SFP info.
@ 2014-03-27 23:05 Dan Carpenter
  2014-03-27 23:07 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-03-27 23:05 UTC (permalink / raw)
  To: kgudipat; +Cc: linux-scsi

Hello Krishna Gudipati,

The patch 51e569aa1f0c: "[SCSI] bfa: Added support to obtain SFP
info." from Jun 24, 2011, leads to the following static checker
warning:

	drivers/scsi/bfa/bfa_ioc.c:3668 bfa_cb_sfp_state_query()
	warn: add curly braces?

drivers/scsi/bfa/bfa_ioc.c
  3659  static void
  3660  bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
  3661  {
  3662          bfa_trc(sfp, sfp->portspeed);
  3663          if (sfp->media) {
  3664                  bfa_sfp_media_get(sfp);
  3665                  if (sfp->state_query_cbfn)
                                                   ^
Add a curly brace here?

  3666                          sfp->state_query_cbfn(sfp->state_query_cbarg,
  3667                                          sfp->status);
  3668                          sfp->media = NULL;
  3669                  }
  3670  
  3671                  if (sfp->portspeed) {
  3672                          sfp->status = bfa_sfp_speed_valid(sfp, sfp->portspeed);
  3673                          if (sfp->state_query_cbfn)
  3674                                  sfp->state_query_cbfn(sfp->state_query_cbarg,
  3675                                                  sfp->status);
  3676                                  sfp->portspeed = BFA_PORT_SPEED_UNKNOWN;
  3677                  }
  3678  
  3679                  sfp->state_query_lock = 0;
  3680                  sfp->state_query_cbfn = NULL;

                ^
And another close curly brace here?

  3681  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [SCSI] bfa: Added support to obtain SFP info.
  2014-03-27 23:05 [SCSI] bfa: Added support to obtain SFP info Dan Carpenter
@ 2014-03-27 23:07 ` Dan Carpenter
  2014-04-29 12:51   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-03-27 23:07 UTC (permalink / raw)
  To: kgudipat; +Cc: linux-scsi

On Fri, Mar 28, 2014 at 02:05:14AM +0300, Dan Carpenter wrote:
> Hello Krishna Gudipati,
> 
> The patch 51e569aa1f0c: "[SCSI] bfa: Added support to obtain SFP
> info." from Jun 24, 2011, leads to the following static checker
> warning:
> 
> 	drivers/scsi/bfa/bfa_ioc.c:3668 bfa_cb_sfp_state_query()
> 	warn: add curly braces?
> 
> drivers/scsi/bfa/bfa_ioc.c
>   3659  static void
>   3660  bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
>   3661  {
>   3662          bfa_trc(sfp, sfp->portspeed);
>   3663          if (sfp->media) {
>   3664                  bfa_sfp_media_get(sfp);
>   3665                  if (sfp->state_query_cbfn)
>                                                    ^
> Add a curly brace here?
> 
>   3666                          sfp->state_query_cbfn(sfp->state_query_cbarg,
>   3667                                          sfp->status);
>   3668                          sfp->media = NULL;
>   3669                  }
>   3670  
>   3671                  if (sfp->portspeed) {
>   3672                          sfp->status = bfa_sfp_speed_valid(sfp, sfp->portspeed);
>   3673                          if (sfp->state_query_cbfn)
>   3674                                  sfp->state_query_cbfn(sfp->state_query_cbarg,
>   3675                                                  sfp->status);
>   3676                                  sfp->portspeed = BFA_PORT_SPEED_UNKNOWN;

It looks like this if statement needs curly braces as well.

regards,
dan carpenter

>   3677                  }
>   3678  
>   3679                  sfp->state_query_lock = 0;
>   3680                  sfp->state_query_cbfn = NULL;
> 
>                 ^
> And another close curly brace here?
> 
>   3681  }
> 
> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [SCSI] bfa: Added support to obtain SFP info.
  2014-03-27 23:07 ` Dan Carpenter
@ 2014-04-29 12:51   ` Dan Carpenter
  2014-04-30  8:43     ` Anil Gurumurthy
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-04-29 12:51 UTC (permalink / raw)
  To: linux-scsi; +Cc: Vijaya Mohan Guvva, Anil Gurumurthy, Sudarsana Kalluru

Krishna isn't around any more.  Does anyone else know what's going on
in this code?  It looks buggy to me.

regards,
dan carpenter

On Fri, Mar 28, 2014 at 02:07:37AM +0300, Dan Carpenter wrote:
> On Fri, Mar 28, 2014 at 02:05:14AM +0300, Dan Carpenter wrote:
> > Hello Krishna Gudipati,
> > 
> > The patch 51e569aa1f0c: "[SCSI] bfa: Added support to obtain SFP
> > info." from Jun 24, 2011, leads to the following static checker
> > warning:
> > 
> > 	drivers/scsi/bfa/bfa_ioc.c:3668 bfa_cb_sfp_state_query()
> > 	warn: add curly braces?
> > 
> > drivers/scsi/bfa/bfa_ioc.c
> >   3659  static void
> >   3660  bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
> >   3661  {
> >   3662          bfa_trc(sfp, sfp->portspeed);
> >   3663          if (sfp->media) {
> >   3664                  bfa_sfp_media_get(sfp);
> >   3665                  if (sfp->state_query_cbfn)
> >                                                    ^
> > Add a curly brace here?
> > 
> >   3666                          sfp->state_query_cbfn(sfp->state_query_cbarg,
> >   3667                                          sfp->status);
> >   3668                          sfp->media = NULL;
> >   3669                  }
> >   3670  
> >   3671                  if (sfp->portspeed) {
> >   3672                          sfp->status = bfa_sfp_speed_valid(sfp, sfp->portspeed);
> >   3673                          if (sfp->state_query_cbfn)
> >   3674                                  sfp->state_query_cbfn(sfp->state_query_cbarg,
> >   3675                                                  sfp->status);
> >   3676                                  sfp->portspeed = BFA_PORT_SPEED_UNKNOWN;
> 
> It looks like this if statement needs curly braces as well.
> 
> regards,
> dan carpenter
> 
> >   3677                  }
> >   3678  
> >   3679                  sfp->state_query_lock = 0;
> >   3680                  sfp->state_query_cbfn = NULL;
> > 
> >                 ^
> > And another close curly brace here?
> > 
> >   3681  }
> > 
> > regards,
> > dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [SCSI] bfa: Added support to obtain SFP info.
  2014-04-29 12:51   ` Dan Carpenter
@ 2014-04-30  8:43     ` Anil Gurumurthy
  0 siblings, 0 replies; 4+ messages in thread
From: Anil Gurumurthy @ 2014-04-30  8:43 UTC (permalink / raw)
  To: Dan Carpenter, linux-scsi; +Cc: Sudarsana Kalluru

[-- Attachment #1: Type: text/plain, Size: 3710 bytes --]

Hi Dan,
  The indentation of the code is an issue here. We will fix it in the next patch submission.

The code should be
static void
bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
{
        bfa_trc(sfp, sfp->portspeed);
        if (sfp->media) {
                bfa_sfp_media_get(sfp);
                if (sfp->state_query_cbfn)
                        sfp->state_query_cbfn(sfp->state_query_cbarg,
                                              sfp->status);
                sfp->media = NULL;
        }

        if (sfp->portspeed) {
                sfp->status = bfa_sfp_speed_valid(sfp, sfp->portspeed);
                if (sfp->state_query_cbfn)
                        sfp->state_query_cbfn(sfp->state_query_cbarg,
                                              sfp->status);
                sfp->portspeed = BFA_PORT_SPEED_UNKNOWN;
        }

        sfp->state_query_lock = 0;
        sfp->state_query_cbfn = NULL;
}

Thanks,
Anil

-----Original Message-----
From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
Sent: 29 April 2014 18:21
To: linux-scsi
Cc: Vijaya Mohan Guvva; Anil Gurumurthy; Sudarsana Kalluru
Subject: Re: [SCSI] bfa: Added support to obtain SFP info.

Krishna isn't around any more.  Does anyone else know what's going on in this code?  It looks buggy to me.

regards,
dan carpenter

On Fri, Mar 28, 2014 at 02:07:37AM +0300, Dan Carpenter wrote:
> On Fri, Mar 28, 2014 at 02:05:14AM +0300, Dan Carpenter wrote:
> > Hello Krishna Gudipati,
> >
> > The patch 51e569aa1f0c: "[SCSI] bfa: Added support to obtain SFP
> > info." from Jun 24, 2011, leads to the following static checker
> > warning:
> >
> >     drivers/scsi/bfa/bfa_ioc.c:3668 bfa_cb_sfp_state_query()
> >     warn: add curly braces?
> >
> > drivers/scsi/bfa/bfa_ioc.c
> >   3659  static void
> >   3660  bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp)
> >   3661  {
> >   3662          bfa_trc(sfp, sfp->portspeed);
> >   3663          if (sfp->media) {
> >   3664                  bfa_sfp_media_get(sfp);
> >   3665                  if (sfp->state_query_cbfn)
> >                                                    ^ Add a curly
> > brace here?
> >
> >   3666                          sfp->state_query_cbfn(sfp->state_query_cbarg,
> >   3667                                          sfp->status);
> >   3668                          sfp->media = NULL;
> >   3669                  }
> >   3670
> >   3671                  if (sfp->portspeed) {
> >   3672                          sfp->status = bfa_sfp_speed_valid(sfp, sfp->portspeed);
> >   3673                          if (sfp->state_query_cbfn)
> >   3674                                  sfp->state_query_cbfn(sfp->state_query_cbarg,
> >   3675                                                  sfp->status);
> >   3676                                  sfp->portspeed = BFA_PORT_SPEED_UNKNOWN;
>
> It looks like this if statement needs curly braces as well.
>
> regards,
> dan carpenter
>
> >   3677                  }
> >   3678
> >   3679                  sfp->state_query_lock = 0;
> >   3680                  sfp->state_query_cbfn = NULL;
> >
> >                 ^
> > And another close curly brace here?
> >
> >   3681  }
> >
> > regards,
> > dan carpenter

________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4994 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-30  8:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 23:05 [SCSI] bfa: Added support to obtain SFP info Dan Carpenter
2014-03-27 23:07 ` Dan Carpenter
2014-04-29 12:51   ` Dan Carpenter
2014-04-30  8:43     ` Anil Gurumurthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).