lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ce8c8a7342282467c3b681fd1b0874817250c16e.camel@perches.com>
Date:   Thu, 01 Aug 2019 12:16:23 -0700
From:   Joe Perches <joe@...ches.com>
To:     Alex Deucher <alexdeucher@...il.com>,
        Colin King <colin.king@...onical.com>
Cc:     Rex Zhu <rex.zhu@....com>, Evan Quan <evan.quan@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        David Zhou <David1.Zhou@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>, kernel-janitors@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH][drm-next] drm/amd/powerplay: fix a few spelling mistakes

On Thu, 2019-08-01 at 15:02 -0400, Alex Deucher wrote:
> Applied.  thanks!
> 
> Alex
> 
> On Thu, Aug 1, 2019 at 4:39 AM Colin King <colin.king@...onical.com> wrote:
> > From: Colin Ian King <colin.king@...onical.com>
> > 
> > There are a few spelling mistakes "unknow" -> "unknown" and
> > "enabeld" -> "enabled". Fix these.
[]
> > diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
[]
> > @@ -39,7 +39,7 @@ static const char* __smu_message_names[] = {
> >  const char *smu_get_message_name(struct smu_context *smu, enum smu_message_type type)
> >  {
> >         if (type < 0 || type > SMU_MSG_MAX_COUNT)

This looks like an off-by-one test against
SMU_MSG_MAX_COUNT where type
should be >=

> > -               return "unknow smu message";
> > +               return "unknown smu message";
> >         return __smu_message_names[type];
[]
> > @@ -52,7 +52,7 @@ static const char* __smu_feature_names[] = {
> >  const char *smu_get_feature_name(struct smu_context *smu, enum smu_feature_mask feature)
> >  {
> >         if (feature < 0 || feature > SMU_FEATURE_COUNT)

here too

> > -               return "unknow smu feature";
> > +               return "unknown smu feature";
> >         return __smu_feature_names[feature];

Perhaps instead it should be against ARRAY_SIZE(__smu_<foo>)

Also, the  __SMU_DUMMY_MAP macro is unnecessarily complex.

It might be better to have some direct
index and name struct like

struct enum_name {
	int val;
	const char *name;
};

And walk that.

Perhaps add a macro like

#define enum_map(e)
	{.val = e, .name = #e}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ