Re: [PATCH v2 08/12] staging: tidspbridge: convert rmgr to list_head

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

 



On Sun, Nov 07, 2010 at 02:11:24PM +0200, Ionut Nicu wrote:
> Hi Greg,
> 
> On Sat, 2010-11-06 at 11:26 -0700, Greg KH wrote:
> > On Sat, Nov 06, 2010 at 08:18:27PM +0200, Ionut Nicu wrote:
> > > Hi Rene,
> > > 
> > > On Fri, 2010-11-05 at 18:07 -0600, Sapiens, Rene wrote:
> > > > Hi Ionut,
> > > > 
> > > > On Fri, Nov 5, 2010 at 9:13 AM, Ionut Nicu <ionut.nicu@xxxxxxxxx> wrote:
> > > > > Convert the rmgr module of the tidspbridge driver
> > > > > to use struct list_head instead of struct lst_list.
> > > > >
> > > > > Signed-off-by: Ionut Nicu <ionut.nicu@xxxxxxxxxx>
> > > > 
> > > > <snip>
> > > > 
> > > > > diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c
> > > > 
> > > > <snip>
> > > > 
> > > > > @@ -492,16 +465,17 @@ u32 drv_get_next_dev_object(u32 hdev_obj)
> > > > >        u32 dw_next_dev_object = 0;
> > > > >        struct drv_object *pdrv_obj;
> > > > >        struct drv_data *drv_datap = dev_get_drvdata(bridge);
> > > > > +       struct list_head *curr;
> > > > >
> > > > >        DBC_REQUIRE(hdev_obj != 0);
> > > > 
> > > > can we remove the DBC_REQUIRE and always check for !hdev_obj?
> > > > 
> > > 
> > > Sounds ok to me.
> > > 
> > > As a general remark, I personally think that the DBC_* macros should be
> > > replaced with BUG_ON, WARN_ON, but that's a subject for other patches.
> > > What do you think? 
> > 
> > They should probably be deleted, I will not add any BUG_ON to a driver,
> > nor should anyone else.  That's just rude behavior to crash the system,
> > don't you think?
> > 
> 
> You're right. Removing them sounds like a better plan. There over 1000
> DBC_* lines in this driver, so I guess it will clean it up a little bit.
> 
> Just out of curiosity, in what cases is it acceptable to use
> BUG_ON/WARN_ON?

In a driver, almost never.  Use dev_err() and friends instead.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux