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] [thread-next>] [day] [month] [year] [list]
Message-ID: <152297026107.143116.8868825918169537109@swboyd.mtv.corp.google.com>
Date:   Thu, 05 Apr 2018 16:17:41 -0700
From:   Stephen Boyd <sboyd@...nel.org>
To:     Evan Green <evgreen@...omium.org>, Taniya Das <tdas@...eaurora.org>
Cc:     sboyd@...eaurora.org, mturquette@...libre.com,
        Andy Gross <andy.gross@...aro.org>,
        David Brown <david.brown@...aro.org>,
        Rajendra Nayak <rnayak@...eaurora.org>,
        okukatla@...eaurora.org, anischal@...eaurora.org,
        linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
        linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
        collinsd@...eaurora.org
Subject: Re: [PATCH 1/2] clk: qcom: clk-rpmh: Add QCOM RPMh clock driver

Quoting Taniya Das (2018-04-02 03:33:26)
> 
> > 
> >> +
> >> +#include "common.h"
> >> +#include "clk-regmap.h"
> >> +
> >> +#define CLK_RPMH_ARC_EN_OFFSET 0
> >> +#define CLK_RPMH_VRM_EN_OFFSET 4
> >> +#define CLK_RPMH_VRM_OFF_VAL 0
> >> +#define CLK_RPMH_VRM_ON_VAL 1
> >> +#define CLK_RPMH_APPS_RSC_AO_STATE_MASK (BIT(RPMH_WAKE_ONLY_STATE) | \
> >> +                                        BIT(RPMH_ACTIVE_ONLY_STATE))
> >> +#define CLK_RPMH_APPS_RSC_STATE_MASK (BIT(RPMH_WAKE_ONLY_STATE) | \
> >> +                                     BIT(RPMH_ACTIVE_ONLY_STATE) | \
> >> +                                     BIT(RPMH_SLEEP_STATE))
> >> +struct clk_rpmh {
> >> +       const char *res_name;
> >> +       u32 res_addr;
> >> +       u32 res_en_offset;
> >> +       u32 res_on_val;
> >> +       u32 res_off_val;
> >> +       u32 state;
> >> +       u32 aggr_state;
> >> +       u32 last_sent_aggr_state;
> >> +       u32 valid_state_mask;
> >> +       struct rpmh_client *rpmh_client;
> >> +       unsigned long rate;
> >> +       struct clk_rpmh *peer;
> >> +       struct clk_hw hw;
> > 
> > I believe this member should go at the beginning of the structure. At least
> > that's what everyone else seems to do, and that's what the clk.txt
> > documentation seems to ask for.
> >
> 
> Yes I missed that, would update it in the next patch series.

Where is the documentation asking for that? There isn't any place that
clk_hw should be in a structure. container_of() can figure it out all
the time, and that macro is preferred instead of plain casts from one
type to another because it provides slightly more type safety.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ