Skip to content

Commit

Permalink
cxgb3: Fix __must_check warning with dev_dbg.
Browse files Browse the repository at this point in the history
Fix the warning:
drivers/net/cxgb3/cxgb3_main.c: In function ‘offload_open’:
drivers/net/cxgb3/cxgb3_main.c:936: warning: ignoring return value of
 ‘sysfs_create_group’, declared with attribute warn_unused_result

Now the return value is checked; if sysfs_create_group() returns failure,
a warning is printed using dev_dbg, and the code continues as before.  Use
of dev_dbg ensures printk is not needlessly included unless desired for
debugging.

Signed-off-by: Dan Noe <dpn@isomerica.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Dan Noe authored and Jeff Garzik committed Apr 17, 2008
1 parent 10e05f7 commit d96a51f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/cxgb3/cxgb3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,8 @@ static int offload_open(struct net_device *dev)
adapter->port[0]->mtu : 0xffff);
init_smt(adapter);

/* Never mind if the next step fails */
sysfs_create_group(&tdev->lldev->dev.kobj, &offload_attr_group);
if (sysfs_create_group(&tdev->lldev->dev.kobj, &offload_attr_group))
dev_dbg(&dev->dev, "cannot create sysfs group\n");

/* Call back all registered clients */
cxgb3_add_clients(tdev);
Expand Down

0 comments on commit d96a51f

Please sign in to comment.