public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Meng Tang <tangmeng@uniontech.com>
Cc: stas.yakovlev@gmail.com, kvalo@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipw2200: Fix permissions setted by DEVICE_ATTR
Date: Fri, 25 Mar 2022 20:37:45 +0100	[thread overview]
Message-ID: <Yj4aCUlGY12VvuI/@lunn.ch> (raw)
In-Reply-To: <20220325074141.17446-1-tangmeng@uniontech.com>

On Fri, Mar 25, 2022 at 03:41:41PM +0800, Meng Tang wrote:
> Because xcode_version and rtc only implement the show function
> and do not provide the store function, so ucode_version and rtc
> only need the read permission, not need the write permission more.
> 
> So, remove the write permission from xcode_version and rtc.
> 
> Signed-off-by: Meng Tang <tangmeng@uniontech.com>
> ---
>  drivers/net/wireless/intel/ipw2x00/ipw2200.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> index 6830e88c4ed6..fa4f38d54d0a 100644
> --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> @@ -1578,7 +1578,7 @@ static ssize_t show_ucode_version(struct device *d,
>  	return sprintf(buf, "0x%08x\n", tmp);
>  }
>  
> -static DEVICE_ATTR(ucode_version, 0644, show_ucode_version, NULL);
> +static DEVICE_ATTR(ucode_version, 0444, show_ucode_version, NULL);

DEVICE_ATTR_RO() exists to make this more obvious. But it looks like
you would need to rename the show_ucode_version() to
ucode_version_show() in order to use it.

     Andrew

  reply	other threads:[~2022-03-25 19:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  7:41 [PATCH] ipw2200: Fix permissions setted by DEVICE_ATTR Meng Tang
2022-03-25 19:37 ` Andrew Lunn [this message]
2022-03-29 20:41 ` Stanislav Yakovlev

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=Yj4aCUlGY12VvuI/@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stas.yakovlev@gmail.com \
    --cc=tangmeng@uniontech.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