linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	linux-staging@lists.linux.dev
Subject: Re: [PATCH 5/5] staging: r8188eu: Use vsprintf extension %phCX to format a copy_to_user string
Date: Fri, 27 Aug 2021 10:42:30 +0200	[thread overview]
Message-ID: <YSildgE0Ul4akIUJ@kroah.com> (raw)
In-Reply-To: <152e1b8f84c4686ea38182ca55344ed7f2cede65.1630003183.git.joe@perches.com>

On Thu, Aug 26, 2021 at 11:43:05AM -0700, Joe Perches wrote:
> This reduces object size without changing the string content.
> 
> compiled x86-64 defconfig w/ r8188eu and gcc 10.3.0
> 
> $ size drivers/staging/r8188eu/os_dep/ioctl_linux.o*
>    text	   data	    bss	    dec	    hex	filename
>   72556	   1548	      0	  74104	  12178	drivers/staging/r8188eu/os_dep/ioctl_linux.o.new
>   72758	   1548	      0	  74306	  12242	drivers/staging/r8188eu/os_dep/ioctl_linux.o.old
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/staging/r8188eu/os_dep/ioctl_linux.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> index ab4a9200f0791..048164659d872 100644
> --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> @@ -2907,10 +2907,8 @@ static int rtw_p2p_get_groupid(struct net_device *dev,
>  	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
>  	struct wifidirect_info *pwdinfo = &padapter->wdinfo;
>  
> -	sprintf(extra, "\n%.2X:%.2X:%.2X:%.2X:%.2X:%.2X %s",
> -		pwdinfo->groupid_info.go_device_addr[0], pwdinfo->groupid_info.go_device_addr[1],
> -		pwdinfo->groupid_info.go_device_addr[2], pwdinfo->groupid_info.go_device_addr[3],
> -		pwdinfo->groupid_info.go_device_addr[4], pwdinfo->groupid_info.go_device_addr[5],
> +	sprintf(extra, "\n%pM %s",
> +		pwdinfo->groupid_info.go_device_addr,
>  		pwdinfo->groupid_info.ssid);

We can just use the lower-case one here, no need for a new modifier just
for something like this (i.e. log file output)

thanks,

greg k-h

  reply	other threads:[~2021-08-27  8:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 18:43 [PATCH 0/5] vsprintf and uses: Add upper case output to %*ph extension Joe Perches
2021-08-26 18:43 ` [PATCH 1/5] vsprintf/Documentation: Add X to %*ph extension to output upper case hex Joe Perches
2021-08-27  7:48   ` Andy Shevchenko
2021-08-27  8:08     ` Joe Perches
2021-08-27  8:49       ` Andy Shevchenko
2021-08-27 10:49         ` Petr Mladek
2021-08-28  2:49         ` Joe Perches
2021-08-26 18:43 ` [PATCH 2/5] scsi: aacraid: Use vsprintf %phNX extension Joe Perches
2021-08-26 18:43 ` [PATCH 3/5] scsi: hpsa: " Joe Perches
2021-08-26 18:43 ` [PATCH 4/5] scsi: smartpqi: " Joe Perches
2021-08-26 18:43 ` [PATCH 5/5] staging: r8188eu: Use vsprintf extension %phCX to format a copy_to_user string Joe Perches
2021-08-27  8:42   ` Greg Kroah-Hartman [this message]
2021-08-27 15:23     ` Joe Perches
2021-08-27 15:27       ` Greg Kroah-Hartman
2021-08-27 15:52         ` Joe Perches
2021-08-27  7:51 ` [PATCH 0/5] vsprintf and uses: Add upper case output to %*ph extension Andy Shevchenko
2021-08-27  8:10   ` Joe Perches
2021-08-27  8:46     ` Andy Shevchenko
2021-08-27 10:23       ` Greg KH
2021-08-27 16:09         ` Joe Perches

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=YSildgE0Ul4akIUJ@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    /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).