lkml.org 
[lkml]   [2011]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRE: [PATCH net-next 2/2] drivers/net: Remove casts of void *
    > -----Original Message-----
    > From: Joe Perches [mailto:joe@perches.com]
    > Subject: [PATCH net-next 2/2] drivers/net: Remove casts of void *
    >
    > Unnecessary casts of void * clutter the code.
    >
    > Signed-off-by: Joe Perches <joe@perches.com>
    > ---
    > diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
    > index 0c12c2d..30719f5 100644
    > --- a/drivers/net/benet/be_cmds.c
    > +++ b/drivers/net/benet/be_cmds.c
    > @@ -2334,8 +2334,7 @@ int be_cmd_get_cntl_attributes(struct be_adapter
    > *adapter)
    >
    > status = be_mbox_notify_wait(adapter);
    > if (!status) {
    > - attribs = (struct mgmt_controller_attrib *)( attribs_cmd.va
    > +
    > - sizeof(struct be_cmd_resp_hdr));
    > + attribs = attribs_cmd.va + sizeof(struct be_cmd_resp_hdr);
    > adapter->hba_port_num = attribs->hba_attribs.phy_port;
    > }
    >
    > diff --git a/drivers/net/benet/be_ethtool.c
    > b/drivers/net/benet/be_ethtool.c
    > index facfe3c..5572c78 100644
    > --- a/drivers/net/benet/be_ethtool.c
    > +++ b/drivers/net/benet/be_ethtool.c
    > @@ -386,7 +386,7 @@ static int be_get_settings(struct net_device
    > *netdev, struct ethtool_cmd *ecmd)
    > }
    > status = be_cmd_get_phy_info(adapter, &phy_cmd);
    > if (!status) {
    > - resp = (struct be_cmd_resp_get_phy_info *)
    > phy_cmd.va;
    > + resp = phy_cmd.va;
    > intf_type = le16_to_cpu(resp->interface_type);
    >
    > switch (intf_type) {
    > @@ -690,7 +690,7 @@ be_read_eeprom(struct net_device *netdev, struct
    > ethtool_eeprom *eeprom,
    > status = be_cmd_get_seeprom_data(adapter, &eeprom_cmd);
    >
    > if (!status) {
    > - resp = (struct be_cmd_resp_seeprom_read *) eeprom_cmd.va;
    > + resp = eeprom_cmd.va;
    > memcpy(data, resp->seeprom_data + eeprom->offset, eeprom-
    > >len);
    > }
    > dma_free_coherent(&adapter->pdev->dev, eeprom_cmd.size,
    > eeprom_cmd.va,

    The be2net part of the patch looks good.

    Acked-by: Ajit Khaparde ajit.khaparde@emulex.com

    \
     
     \ /
      Last update: 2011-06-14 20:35    [W:0.024 / U:33.188 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site