linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Suwan Kim <suwan.kim027@gmail.com>
Cc: gregkh@linuxfoundation.org, <linux-usb@vger.kernel.org>,
	<mathias.nyman@linux.intel.com>,
	<heikki.krogerus@linux.intel.com>, <linux-kernel@vger.kernel.org>,
	<balbi@kernel.org>
Subject: Re: [PATCH] usb: core: Remove unnecessary memset()
Date: Mon, 10 Dec 2018 15:06:11 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1812101503110.1562-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20181204143143.8407-1-suwan.kim027@gmail.com>

On Tue, 4 Dec 2018, Suwan Kim wrote:

> register_root_hub() calls memset() setting usb_dev->bus->devmap.
> devicemap to 0 during hcd probe function (usb_hcd_pci_probe). But
> in previous function which is also the procedure of usb_hcd_pci_probe(),
> usb_bus_init() already initialized bus->devmap calling memset().
> Furthermore, register_root_hub() is called only once in kernel.
> So, calling memset() which resets usb_bus->devmap.devicemap in
> register_root_hub() is redundant.
> 
> Signed-off-by: Suwan Kim <suwan.kim027@gmail.com>
> ---
>  drivers/usb/core/hcd.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 487025d31d44..015b126ce455 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -1074,8 +1074,6 @@ static int register_root_hub(struct usb_hcd *hcd)
>  
>  	usb_dev->devnum = devnum;
>  	usb_dev->bus->devnum_next = devnum + 1;
> -	memset (&usb_dev->bus->devmap.devicemap, 0,
> -			sizeof usb_dev->bus->devmap.devicemap);
>  	set_bit (devnum, usb_dev->bus->devmap.devicemap);
>  	usb_set_device_state(usb_dev, USB_STATE_ADDRESS);

Acked-by: Alan Stern <stern@rowland.harvard.edu>


      reply	other threads:[~2018-12-10 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 14:31 [PATCH] usb: core: Remove unnecessary memset() Suwan Kim
2018-12-10 20:06 ` Alan Stern [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44L0.1812101503110.1562-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=suwan.kim027@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).