RE: [PATCH v1 1/2] usb: dwc3: core: add support for remapping global register start address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > > > +     if (dev) {
> > >
> > > Why do we need this if (dev) check? When would this not be the case?
> >
> > I want the variable "fixed_dwc3_globals_regs_start" to be a local variable.
> > So I added an if statement.
> > I can modify it to "if (dev->of_node)" which looks more make sense.
> 
> Why? If it's within this function, it's a local variable. Don't create arbitrary
> condition just to limit the scope of the variable.
> 
> Thanks,
> Thinh
> 

I agree that don't create arbitrary conditions just to limit the scope of variables.
The property "snps,global-regs-starting-offset" is in the device tree,
so checking dev->of_node exists is a must.

Thanks,
Stanley




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux