All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: "Smith, Stan" <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] osmtest - use helper function
Date: Tue, 25 May 2010 14:16:55 +0300	[thread overview]
Message-ID: <20100525111655.GP28549@me> (raw)
In-Reply-To: <3F6F638B8D880340AB536D29CD4C1E192562EBBB95-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>

On 10:23 Fri 21 May     , Smith, Stan wrote:
> 
> Use defined inline helper function instead of actual implementation.
> Separate implementation from use.
> 
> signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Applied by hands (the patch is broken too). Thanks.

Sasha

> 
> diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
> index 50f94db..5d9c54c 100644
> --- a/opensm/osmtest/osmtest.c
> +++ b/opensm/osmtest/osmtest.c
> @@ -719,7 +719,7 @@ osmtest_get_node_rec(IN osmtest_t * const p_osmt,
>         p_context->p_osmt = p_osmt;
>         user.comp_mask = IB_NR_COMPMASK_NODEGUID;
>         user.attr_id = IB_MAD_ATTR_NODE_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -793,7 +793,7 @@ osmtest_get_node_rec_by_lid(IN osmtest_t * const p_osmt,
>         p_context->p_osmt = p_osmt;
>         user.comp_mask = IB_NR_COMPMASK_LID;
>         user.attr_id = IB_MAD_ATTR_NODE_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -1057,7 +1057,7 @@ osmtest_get_port_rec(IN osmtest_t * const p_osmt,
>         p_context->p_osmt = p_osmt;
>         user.comp_mask = IB_PIR_COMPMASK_LID;
>         user.attr_id = IB_MAD_ATTR_PORTINFO_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -4171,7 +4171,7 @@ osmtest_get_link_rec_by_lid(IN osmtest_t * const p_osmt,
>         if (to_lid)
>                 user.comp_mask |= IB_LR_COMPMASK_TO_LID;
>         user.attr_id = IB_MAD_ATTR_LINK_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -4249,7 +4249,7 @@ osmtest_get_guidinfo_rec_by_lid(IN osmtest_t * const p_osmt,
>         p_context->p_osmt = p_osmt;
>         user.comp_mask = IB_GIR_COMPMASK_LID;
>         user.attr_id = IB_MAD_ATTR_GUIDINFO_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -4328,7 +4328,7 @@ osmtest_get_pkeytbl_rec_by_lid(IN osmtest_t * const p_osmt,
>         p_context->p_osmt = p_osmt;
>         user.comp_mask = IB_PKEY_COMPMASK_LID;
>         user.attr_id = IB_MAD_ATTR_PKEY_TBL_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -4407,7 +4407,7 @@ osmtest_get_sw_info_rec_by_lid(IN osmtest_t * const p_osmt,
>         if (lid)
>                 user.comp_mask = IB_SWIR_COMPMASK_LID;
>         user.attr_id = IB_MAD_ATTR_SWITCH_INFO_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -4486,7 +4486,7 @@ osmtest_get_lft_rec_by_lid(IN osmtest_t * const p_osmt,
>         if (lid)
>                 user.comp_mask = IB_LFTR_COMPMASK_LID;
>         user.attr_id = IB_MAD_ATTR_LFT_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -4565,7 +4565,7 @@ osmtest_get_mft_rec_by_lid(IN osmtest_t * const p_osmt,
>         if (lid)
>                 user.comp_mask = IB_MFTR_COMPMASK_LID;
>         user.attr_id = IB_MAD_ATTR_MFT_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> @@ -4637,7 +4637,7 @@ osmtest_sminfo_record_request(IN osmtest_t * const p_osmt,
> 
>         p_context->p_osmt = p_osmt;
>         user.attr_id = IB_MAD_ATTR_SMINFO_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>         p_sm_info_opt = p_options;
>         if (p_sm_info_opt->sm_guid != 0) {
>                 record.sm_info.guid = p_sm_info_opt->sm_guid;
> @@ -4737,7 +4737,7 @@ osmtest_informinfo_request(IN osmtest_t * const p_osmt,
>         p_context->p_osmt = p_osmt;
>         user.attr_id = attr_id;
>         if (attr_id == IB_MAD_ATTR_INFORM_INFO_RECORD) {
> -               user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +               user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>                 p_inform_info_rec_opt = p_options;
>                 if (p_inform_info_rec_opt->subscriber_gid.unicast.prefix != 0 &&
>                     p_inform_info_rec_opt->subscriber_gid.unicast.
> @@ -4751,7 +4751,7 @@ osmtest_informinfo_request(IN osmtest_t * const p_osmt,
>                 user.comp_mask |= IB_IIR_COMPMASK_ENUM;
>                 user.p_attr = &record;
>         } else {
> -               user.attr_offset = cl_ntoh16((uint16_t) (sizeof(rec) >> 3));
> +               user.attr_offset = ib_get_attr_offset((uint16_t) (sizeof(record)));
>                 /* comp mask bits below are for InformInfoRecord rather than InformInfo */
>                 /* as currently no comp mask bits defined for InformInfo!!! */
>                 user.comp_mask = IB_IIR_COMPMASK_SUBSCRIBE;
> @@ -4900,7 +4900,7 @@ osmtest_validate_single_node_rec_lid(IN osmtest_t * const p_osmt,
>         context.p_osmt = p_osmt;
>         user.comp_mask = IB_NR_COMPMASK_LID;
>         user.attr_id = IB_MAD_ATTR_NODE_RECORD;
> -       user.attr_offset = cl_ntoh16((uint16_t) (sizeof(record) >> 3));
> +       user.attr_offset = ib_get_attr_offset((uint16_t) sizeof(record));
>         user.p_attr = &record;
> 
>         req.query_type = OSMV_QUERY_USER_DEFINED;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2010-05-25 11:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 17:23 [PATCH] osmtest - use helper function Smith, Stan
     [not found] ` <3F6F638B8D880340AB536D29CD4C1E192562EBBB95-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-05-25 11:16   ` Sasha Khapyorsky [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=20100525111655.GP28549@me \
    --to=sashak-smomgflxvozwk0htik3j/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.